Skip to content

Commit

Permalink
avoid hardcoded list of packages in sysimage
Browse files Browse the repository at this point in the history
(cherry picked from commit 1da1725d25ee46ce8b7d0b9f1b5b6d2805a86dbe)
  • Loading branch information
KristofferC committed Sep 13, 2023
1 parent 62b4bf3 commit de75210
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions test/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,25 +394,21 @@ precompile_test_harness(false) do dir
@test_throws ErrorException Base.read_dependency_src(cachefile, joinpath(dir, "foo.jl"))

modules, deps1 = Base.cache_dependencies(cachefile)
@test Dict(modules) == merge(
modules_ok = merge(
Dict(let m = Base.PkgId(s)
m => Base.module_build_id(Base.root_module(m))
end for s in
[ "Base", "Core", "Main",
string(Foo2_module), string(FooBase_module) ]),
string(Foo2_module), string(FooBase_module),]),
# plus modules included in the system image
Dict(let m = Base.root_module(Base, s)
Base.PkgId(m) => Base.module_build_id(m)
end for s in
[:ArgTools, :Artifacts, :Base64, :CRC32c, :Dates,
:Downloads, :FileWatching, :Future, :InteractiveUtils, :libblastrampoline_jll,
:LibCURL, :LibCURL_jll, :LibGit2, :Libdl, :LinearAlgebra,
:Logging, :Markdown, :Mmap, :MozillaCACerts_jll, :NetworkOptions, :OpenBLAS_jll, :Pkg, :Printf,
:p7zip_jll, :REPL, :Random, :SHA, :Serialization, :Sockets,
:TOML, :Tar, :Test, :UUIDs, :Unicode,
:nghttp2_jll]
),
end for s in [Symbol(x.name) for x in Base._sysimage_modules if !(x.name in ["Base", "Core", "Main"])]),
# plus test module,
Dict(Base.PkgId(Base.root_module(Base, :Test)) => Base.module_build_id(Base.root_module(Base, :Test)))
)
@test Dict(modules) == modules_ok

@test discard_module.(deps) == deps1
modules, (deps, requires), required_modules, _... = Base.parse_cache_header(cachefile; srcfiles_only=true)
@test map(x -> x.filename, deps) == [Foo_file]
Expand Down

0 comments on commit de75210

Please sign in to comment.