Skip to content

Commit 332c21f

Browse files
authored
Use upstream functionality for fixing stdlib paths (#139)
1 parent 4f3819c commit 332c21f

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

src/utils.jl

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -359,29 +359,11 @@ function maybe_fix_path(file)
359359
file = normpath(newfile)
360360
end
361361
end
362-
return maybe_fixup_stdlib_path(file)
362+
return Base.fixup_stdlib_path(file)
363363
end
364364

365-
safe_isfile(x) = try isfile(x); catch; false end
366-
const BUILDBOT_STDLIB_PATH = dirname(abspath(String((@which uuid1()).file), "..", "..", ".."))
367-
replace_buildbot_stdlibpath(str::String) = replace(str, BUILDBOT_STDLIB_PATH => Sys.STDLIB)
368-
"""
369-
path = maybe_fixup_stdlib_path(path::String)
370-
371-
Return `path` corrected for julia issue [#26314](https://github.com/JuliaLang/julia/issues/26314) if applicable.
372-
Otherwise, return the input `path` unchanged.
373-
374-
Due to the issue mentioned above, location info for methods defined one of Julia's standard libraries
375-
are, for non source Julia builds, given as absolute paths on the worker that built the `julia` executable.
376-
This function corrects such a path to instead refer to the local path on the users drive.
377-
"""
378-
function maybe_fixup_stdlib_path(path)
379-
if !safe_isfile(path)
380-
maybe_stdlib_path = replace_buildbot_stdlibpath(path)
381-
safe_isfile(maybe_stdlib_path) && return maybe_stdlib_path
382-
end
383-
return path
384-
end
365+
# Some packages use this function
366+
maybe_fixup_stdlib_path(path) = Base.fixup_stdlib_path(path)
385367

386368
function postpath(filename, pre)
387369
idx = findfirst(pre, filename)

0 commit comments

Comments
 (0)