@@ -538,8 +538,7 @@ function flatten(data::Vector, lidict::LineInfoDict)
538538 return (newdata, newdict)
539539end
540540
541- const SRC_DIR = normpath (joinpath (Sys. BUILD_ROOT_PATH, " src" ))
542- const COMPILER_DIR = " ../usr/share/julia/Compiler/"
541+ const SRC_DIR = normpath (Base. SOURCEDIR, " src" )
543542
544543# Take a file-system path and try to form a concise representation of it
545544# based on the package ecosystem
@@ -548,17 +547,18 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri
548547 return get! (filenamecache, spath) do
549548 path = Base. fixup_stdlib_path (string (spath))
550549 path_norm = normpath (path)
551- possible_base_path = normpath (joinpath ( Sys. BINDIR, Base. DATAROOTDIR, " julia" , " base" , path) )
550+ possible_base_path = normpath (Sys. BINDIR, Base. DATAROOTDIR, " julia" , " base" , path)
552551 lib_dir = abspath (Sys. BINDIR, Base. LIBDIR)
552+ compiler_dir = normpath (Base. DATAROOT, " julia" , " Compiler/" )
553553 if startswith (path_norm, SRC_DIR)
554554 remainder = only (split (path_norm, SRC_DIR, keepempty= false ))
555555 return (isfile (path_norm) ? path_norm : " " ), " @juliasrc" , remainder
556556 elseif startswith (path_norm, lib_dir)
557557 remainder = only (split (path_norm, lib_dir, keepempty= false ))
558558 return (isfile (path_norm) ? path_norm : " " ), " @julialib" , remainder
559- elseif contains (path, COMPILER_DIR )
560- remainder = split (path, COMPILER_DIR , keepempty= false )[end ]
561- possible_compiler_path = normpath (joinpath ( Sys. BINDIR, Base. DATAROOTDIR, " julia" , " Compiler" , remainder) )
559+ elseif startswith (path_norm, compiler_dir )
560+ remainder = split (path_norm, compiler_dir , keepempty= false )[end ]
561+ possible_compiler_path = normpath (Sys. BINDIR, Base. DATAROOTDIR, " julia" , " Compiler" , remainder)
562562 return (isfile (possible_compiler_path) ? possible_compiler_path : " " ), " @Compiler" , remainder
563563 elseif isabspath (path)
564564 if ispath (path)
@@ -586,11 +586,10 @@ function short_path(spath::Symbol, filenamecache::Dict{Symbol, Tuple{String,Stri
586586 elseif isfile (possible_base_path)
587587 # do the same mechanic for Base (or Core/Compiler) files as above,
588588 # but they start from a relative path
589- return possible_base_path, " @Base" , normpath (path)
589+ return possible_base_path, " @Base" , path_norm
590590 else
591591 # for non-existent relative paths (such as "REPL[1]"), just consider simplifying them
592- path = normpath (path)
593- return " " , " " , path # drop leading "./"
592+ return " " , " " , path_norm # drop leading "./"
594593 end
595594 end
596595end
0 commit comments