Open vchuravy opened 2 months ago
We already do this for Base so maybe we can change that latter path to
@REPL
?
FWIW, we already do some dynamic rewriting of stdlib path so that they are valid on the local system:
# Path is valid locally
julia> @which REPL.symbol_latex("s")
symbol_latex(s::String)
@ REPL ~/.julia/juliaup/julia-1.10.2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/REPL/src/docview.jl:403
julia> m = @which REPL.symbol_latex("s");
# What is actually stored is the build path
julia> m.file
Symbol("/Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/REPL/src/docview.jl")
We already do this for Base so maybe we can change that latter path to
@REPL
?
We already do that too, but the problem is the paths are wrong for the REPL files in the distributed code (as noted in this issue exactly) so the replacement doesn't happen. And it only applies to Julia code, not native code (which may have come from binary builder or system library built on some deb-builder cluster):
julia> Profile.print(C=true)
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
╎1 /Users/jameson/julia/src/jlapi.c:1059; jl_repl_entrypoint
╎ 1 /Users/jameson/julia/src/jlapi.c:900; true_main
╎ 1 /Users/jameson/julia/src/./julia.h:2185; jl_apply
╎ 1 /Users/jameson/julia/src/gf.c:2975; _jl_invoke
╎ 1 /Users/jameson/julia/usr/lib/julia/sys.dylib:?; jfptr__start_70204
╎ 1 @Base/client.jl:543; _start()
╎ ╎ 1 @Base/client.jl:569; repl_main
╎ ╎ 1 @Base/client.jl:432; run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool, color_set::Bool)
╎ ╎ 1 @Base/essentials.jl:1027; invokelatest
╎ ╎ 1 @Base/essentials.jl:1030; #invokelatest#2
╎ ╎ 1 /Users/jameson/julia/src/builtins.c:875; jl_f__call_latest
╎ ╎ ╎ 1 /Users/jameson/julia/src/./julia.h:2185; jl_apply
╎ ╎ ╎ 1 /Users/jameson/julia/src/gf.c:2975; _jl_invoke
╎ ╎ ╎ 1 /Users/jameson/julia/usr/share/julia/compiled/v1.12/REPL/u0gqU_764VE.dylib:?; jfptr_YY.1159_16881
╎ ╎ ╎ 1 @Base/client.jl:448; (::Base.var"#1159#1161"{Bool, Symbol, Bool})(REPL::Module)
╎ ╎ ╎ 1 /Users/jameson/julia/src/gf.c:2975; _jl_invoke
╎ ╎ ╎ ╎ 1 /Users/jameson/julia/usr/share/julia/compiled/v1.12/REPL/u0gqU_764VE.dylib:?; jfptr_run_repl_12388
╎ ╎ ╎ ╎ 1 @REPL/src/REPL.jl:485; run_repl(repl::AbstractREPL, consumer::Any)
╎ ╎ ╎ ╎ 1 @REPL/src/REPL.jl:499; run_repl(repl::AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
╎ ╎ ╎ ╎ 1 /Users/jameson/julia/src/gf.c:2975; _jl_invoke
╎ ╎ ╎ ╎ 1 @REPL/src/REPL.jl:340; kwcall(::NamedTuple, ::typeof(REPL.start_repl_backend), backend::REPL.REPLBackend, consumer::Any)
So we currently store absolut paths in debuginfo for Julia and it's library. Locally this might be fine, but for our build artifacts this is rather pointless.
@KristofferC raised this recently as:
The buildpath of
/Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11
is long and at least for me unecessary.There are two parts of this.
An example for 2 comes from:
We already do this for
Base
so maybe we can change that latter path to@REPL
?The bigger challenge here is to make sure that system profilers, "click on path" in REPL and other things keep working. So we might need to remap files to local directories for presentation.
While discussing with @KristofferC I noticed that GCC/Clang support remapping paths using
-ffile-prefix-map
.I locally tried the following patch:
and the test-case:
Opening this as an issue instead of a PR since I suspect this will need a larger conversation that also includes changes to BinaryBuilder.
cc: @topolarity @vtjnash @giordano @staticfloat