Skip to content

Commit 70d049f

Browse files
committed
restore DEPOT_PATH etc after precompilation workload ran
1 parent 3cc4fdc commit 70d049f

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
@@ -2303,10 +2303,18 @@ function include_package_for_output(pkg::PkgId, input::String, depot_path::Vecto
23032303
catch ex
23042304
precompilableerror(ex) || rethrow()
23052305
@debug "Aborting `create_expr_cache'" exception=(ErrorException("Declaration of __precompile__(false) not allowed"), catch_backtrace())
2306-
exit(125) # we define status = 125 means PrecompileableError
2306+
exit(125) # we define status = 125 means PrecompilableError
23072307
finally
23082308
Core.Compiler.track_newly_inferred.x = false
23092309
end
2310+
2311+
# restore some globals in case they were altered in the precompilation workload
2312+
append!(empty!(Base.DEPOT_PATH), depot_path)
2313+
append!(empty!(Base.DL_LOAD_PATH), dl_load_path)
2314+
append!(empty!(Base.LOAD_PATH), load_path)
2315+
ENV["JULIA_LOAD_PATH"] = join(load_path, Sys.iswindows() ? ';' : ':')
2316+
set_active_project(nothing)
2317+
23102318
end
23112319

23122320
const PRECOMPILE_TRACE_COMPILE = Ref{String}()

0 commit comments

Comments
 (0)