Skip to content

Commit

Permalink
restore DEPOT_PATH etc after precompilation workload ran
Browse files Browse the repository at this point in the history
  • Loading branch information
fatteneder committed Oct 19, 2023
1 parent 3cc4fdc commit 70d049f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2303,10 +2303,18 @@ function include_package_for_output(pkg::PkgId, input::String, depot_path::Vecto
catch ex
precompilableerror(ex) || rethrow()
@debug "Aborting `create_expr_cache'" exception=(ErrorException("Declaration of __precompile__(false) not allowed"), catch_backtrace())
exit(125) # we define status = 125 means PrecompileableError
exit(125) # we define status = 125 means PrecompilableError
finally
Core.Compiler.track_newly_inferred.x = false
end

# restore some globals in case they were altered in the precompilation workload
append!(empty!(Base.DEPOT_PATH), depot_path)
append!(empty!(Base.DL_LOAD_PATH), dl_load_path)
append!(empty!(Base.LOAD_PATH), load_path)
ENV["JULIA_LOAD_PATH"] = join(load_path, Sys.iswindows() ? ';' : ':')
set_active_project(nothing)

end

const PRECOMPILE_TRACE_COMPILE = Ref{String}()
Expand Down

0 comments on commit 70d049f

Please sign in to comment.