Skip to content

Commit c21e1a9

Browse files
authored
Merge pull request #199 from JunoLab/sp/fixprecomperr
re-use `basepath` for getting path to julia install
2 parents 681115c + 52122c8 commit c21e1a9

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

src/utils.jl

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ end
219219
function fixpath(
220220
filename::AbstractString;
221221
badpath = basebuilddir,
222-
goodpath = juliadir,
222+
goodpath = basepath("..")
223223
)
224224
startswith(filename, badpath) || return fullpath(normpath(filename)) # NOTE: `fullpath` added when adapted
225225
filec = filename
@@ -251,35 +251,6 @@ const basebuilddir = let # NOTE: changed from `begin` to `let` when adapted
251251
dirname(dirname(sysimg))
252252
end
253253

254-
"""
255-
juliadir
256-
257-
Constant specifying full path to julia top-level source directory.
258-
This should be reliable even for local builds, cross-builds, and binary installs.
259-
"""
260-
const juliadir = begin
261-
local jldir = basebuilddir
262-
if !isdir(joinpath(jldir, "base"))
263-
# Binaries probably end up here. We fall back on Sys.BINDIR
264-
jldir = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia")
265-
if !isdir(joinpath(jldir, "base"))
266-
while true
267-
trydir = joinpath(jldir, "base")
268-
isdir(trydir) && break
269-
trydir = joinpath(jldir, "share", "julia", "base")
270-
if isdir(trydir)
271-
jldir = joinpath(jldir, "share", "julia")
272-
break
273-
end
274-
jldirnext = dirname(jldir)
275-
jldirnext == jldir && break
276-
jldir = jldirnext
277-
end
278-
end
279-
end
280-
normpath(jldir)
281-
end
282-
283254
use_compiled_modules() = Base.JLOptions().use_compiled_modules != 0
284255

285256
# For tracking Julia's own stdlibs

0 commit comments

Comments
 (0)