Skip to content

Commit 914479b

Browse files
committed
restore DEPOT_PATH etc after precompilation workload ran
1 parent fb01dd2 commit 914479b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

base/loading.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2312,10 +2312,18 @@ function include_package_for_output(pkg::PkgId, input::String, depot_path::Vecto
23122312
catch ex
23132313
precompilableerror(ex) || rethrow()
23142314
@debug "Aborting `create_expr_cache'" exception=(ErrorException("Declaration of __precompile__(false) not allowed"), catch_backtrace())
2315-
exit(125) # we define status = 125 means PrecompileableError
2315+
exit(125) # we define status = 125 means PrecompilableError
23162316
finally
23172317
Core.Compiler.track_newly_inferred.x = false
23182318
end
2319+
2320+
# restore the globals we set before running precompilation workload in case they were altered
2321+
append!(empty!(Base.DEPOT_PATH), depot_path)
2322+
append!(empty!(Base.DL_LOAD_PATH), dl_load_path)
2323+
append!(empty!(Base.LOAD_PATH), load_path)
2324+
ENV["JULIA_LOAD_PATH"] = join(load_path, Sys.iswindows() ? ';' : ':')
2325+
set_active_project(nothing)
2326+
23192327
end
23202328

23212329
const PRECOMPILE_TRACE_COMPILE = Ref{String}()

0 commit comments

Comments
 (0)