Skip to content

Commit 7e46ffa

Browse files
authored
clear more state before serializing sysimage (#899)
1 parent 6e0c20f commit 7e46ffa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/PackageCompiler.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,16 @@ function create_sysimg_object_file(object_file::String,
419419
end
420420

421421
print(julia_code_buffer, """
422+
empty!(Core.ARGS)
423+
empty!(Base.ARGS)
422424
empty!(LOAD_PATH)
423425
empty!(DEPOT_PATH)
426+
empty!(Base.TOML_CACHE.d)
427+
Base.TOML.reinit!(Base.TOML_CACHE.p, "")
428+
@eval Sys begin
429+
BINDIR = ""
430+
STDLIB = ""
431+
end
424432
""")
425433

426434
julia_code = String(take!(julia_code_buffer))

0 commit comments

Comments
 (0)