Skip to content

Commit 107ba07

Browse files
author
KristofferC
committed
prevent code loading from lookin in the versioned environment when building Julia
1 parent b6a748f commit 107ba07

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

base/initdefs.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,31 +86,33 @@ See also [`JULIA_DEPOT_PATH`](@ref JULIA_DEPOT_PATH), and
8686
"""
8787
const DEPOT_PATH = String[]
8888

89-
function append_default_depot_path!(DEPOT_PATH)
90-
path = joinpath(homedir(), ".julia")
91-
path in DEPOT_PATH || push!(DEPOT_PATH, path)
89+
function append_default_depot_path!(DEPOT_PATH; only_bundled::Bool)
90+
if !only_bundled
91+
path = joinpath(homedir(), ".julia")
92+
path in DEPOT_PATH || push!(DEPOT_PATH, path)
93+
end
9294
path = abspath(Sys.BINDIR, "..", "local", "share", "julia")
9395
path in DEPOT_PATH || push!(DEPOT_PATH, path)
9496
path = abspath(Sys.BINDIR, "..", "share", "julia")
9597
path in DEPOT_PATH || push!(DEPOT_PATH, path)
9698
return DEPOT_PATH
9799
end
98100

99-
function init_depot_path()
101+
function init_depot_path(; only_bundled::Bool=false)
100102
empty!(DEPOT_PATH)
101103
if haskey(ENV, "JULIA_DEPOT_PATH")
102104
str = ENV["JULIA_DEPOT_PATH"]
103105
isempty(str) && return
104106
for path in eachsplit(str, Sys.iswindows() ? ';' : ':')
105107
if isempty(path)
106-
append_default_depot_path!(DEPOT_PATH)
108+
append_default_depot_path!(DEPOT_PATH; only_bundled)
107109
else
108110
path = expanduser(path)
109111
path in DEPOT_PATH || push!(DEPOT_PATH, path)
110112
end
111113
end
112114
else
113-
append_default_depot_path!(DEPOT_PATH)
115+
append_default_depot_path!(DEPOT_PATH; only_bundled)
114116
end
115117
nothing
116118
end

base/sysimg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import Base.MainInclude: eval, include
1212
pushfirst!(Base._included_files, (@__MODULE__, abspath(@__FILE__)))
1313

1414
# set up depot & load paths to be able to find stdlib packages
15-
Base.init_depot_path()
16-
Base.init_load_path()
15+
Base.init_depot_path(; only_bundled=true)
16+
push!(empty!(LOAD_PATH), "@stdlib")
1717

1818
if Base.is_primary_base_module
1919
# load some stdlib packages but don't put their names in Main

0 commit comments

Comments
 (0)