-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
edit
and less
fail for stdlib functions in distribution binaries
#26314
Comments
Note that this problem can be circumvented by locally rebuilding the system image. |
If we want to kill this with a bazooka, see rust-lang/rust#38322 (comment) and |
dup #21921 (probably) |
The distinction from #21921 is that in out-of-tree builds |
This comment has been minimized.
This comment has been minimized.
Since this has been marked as priority, what are the chances that we'll have correct paths in 1.1.0? Can this be added in 1.1.1? Isn't it technically breaking? In my opinion this is really important and it'd be a shame if we'd had to wait for 4 more month. |
Here is a quick monkey-patch you can do in """
Original `Base.find_source_file`.
"""
function _find_source_file_orig(path::AbstractString)
(isabspath(path) || isfile(path)) && return path
base_path = joinpath(Sys.BINDIR::String, Base.DATAROOTDIR, "julia", "base", path)
return isfile(base_path) ? base_path : nothing
end
function Base.find_source_file(path::AbstractString)
found = _find_source_file_orig(path)
if found isa AbstractString && ! isfile(found)
for m in methods(Pkg.add)
exfile = try
String(m.file)
catch err
continue
end
idx = findlast(joinpath(Base.Filesystem.path_separator,
"share", "julia"), exfile)
if idx isa Nothing
continue
end
prefix = exfile[1:idx[1]]
if startswith(path, prefix)
# e.g., relpath = "share/julia/stdlib/v0.7/..."
relpath = path[length(prefix)+1:end]
return joinpath(Base.Sys.BINDIR, "..", relpath)
end
end
end
return found
end |
@tkf: This doesn't seem to work: julia> using Statistics
julia> @which mean(rand(3))
mean(A::AbstractArray) in Statistics at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Statistics\src\Statistics.jl:128 |
It looks like |
Additional notes: For LLDB, this can be corrected for by running |
edit
and less
fail for stdlib functions in distribution binaries
This still seems to be an issue (tried with v1.2-rc2 and v1.3, using the official binaries on 64-bit Linux). I guess this needs more than JuliaDebug/JuliaInterpreter.jl#144 and #31388 ? Is there a chance to fix this in v1.2 or v1.3? It's possible to work around it (via symlink or so), I usually do, but that's kinda hard to sell that to novice users when introducing them to Julia (and showing them how easy it is to see how things work inside). :-) |
JuliaInterpreter/Debugger seems to have their own fix for this. Would either of @timholy or @KristofferC possibly know if that fix could be used on base itself? |
+1 from me. The possibility to use |
We could probably use the same trick here. Will try it out and report back. |
The trouble is that file names in stdlib methods are (inappropriate) absolute paths:
We can cheat:
This is troublesome for those of us who want to consult "The Real Documentation" but didn't build from source.
(edited to fit more useful issue title)
The text was updated successfully, but these errors were encountered: