Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
avoid hardcoded list of packages in sysimage
(cherry picked from commit 1da1725d25ee46ce8b7d0b9f1b5b6d2805a86dbe)
  • Loading branch information
KristofferC committed Sep 13, 2023
commit de75210909a350373a26a36d90797ffbfcaebe33
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