Skip to content

Commit aed5189

Browse files
KristofferCNHDaly
authored andcommitted
avoid hardcoded list of packages in sysimage
(cherry picked from commit 1da1725d25ee46ce8b7d0b9f1b5b6d2805a86dbe)
1 parent c24a848 commit aed5189

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

test/precompile.jl

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -394,25 +394,21 @@ precompile_test_harness(false) do dir
394394
@test_throws ErrorException Base.read_dependency_src(cachefile, joinpath(dir, "foo.jl"))
395395

396396
modules, deps1 = Base.cache_dependencies(cachefile)
397-
@test Dict(modules) == merge(
397+
modules_ok = merge(
398398
Dict(let m = Base.PkgId(s)
399399
m => Base.module_build_id(Base.root_module(m))
400400
end for s in
401401
[ "Base", "Core", "Main",
402-
string(Foo2_module), string(FooBase_module) ]),
402+
string(Foo2_module), string(FooBase_module),]),
403403
# plus modules included in the system image
404404
Dict(let m = Base.root_module(Base, s)
405405
Base.PkgId(m) => Base.module_build_id(m)
406-
end for s in
407-
[:ArgTools, :Artifacts, :Base64, :CRC32c, :Dates,
408-
:Downloads, :FileWatching, :Future, :InteractiveUtils, :libblastrampoline_jll,
409-
:LibCURL, :LibCURL_jll, :LibGit2, :Libdl, :LinearAlgebra,
410-
:Logging, :Markdown, :Mmap, :MozillaCACerts_jll, :NetworkOptions, :OpenBLAS_jll, :Pkg, :Printf,
411-
:p7zip_jll, :REPL, :Random, :SHA, :Serialization, :Sockets,
412-
:TOML, :Tar, :Test, :UUIDs, :Unicode,
413-
:nghttp2_jll]
414-
),
406+
end for s in [Symbol(x.name) for x in Base._sysimage_modules if !(x.name in ["Base", "Core", "Main"])]),
407+
# plus test module,
408+
Dict(Base.PkgId(Base.root_module(Base, :Test)) => Base.module_build_id(Base.root_module(Base, :Test)))
415409
)
410+
@test Dict(modules) == modules_ok
411+
416412
@test discard_module.(deps) == deps1
417413
modules, (deps, requires), required_modules, _... = Base.parse_cache_header(cachefile; srcfiles_only=true)
418414
@test map(x -> x.filename, deps) == [Foo_file]

0 commit comments

Comments
 (0)