Skip to content

Commit 53fcbfe

Browse files
IanButterworthstaticfloat
authored andcommitted
add option to compilecache so that Pkg precompilation can not skip different versions of loaded modules (#40345)
* allow Pkg precomp to not skip loaded modules * rename to ignore_loaded_modules * arg alignment (cherry picked from commit 0da808d)
1 parent dc37dc1 commit 53fcbfe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

base/loading.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,15 +1301,18 @@ end
13011301

13021302
const MAX_NUM_PRECOMPILE_FILES = Ref(10)
13031303

1304-
function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout)
1304+
function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout,
1305+
ignore_loaded_modules::Bool = true)
13051306
# decide where to put the resulting cache file
13061307
cachepath = compilecache_dir(pkg)
13071308

13081309
# build up the list of modules that we want the precompile process to preserve
13091310
concrete_deps = copy(_concrete_dependencies)
1310-
for (key, mod) in loaded_modules
1311-
if !(mod === Main || mod === Core || mod === Base)
1312-
push!(concrete_deps, key => module_build_id(mod))
1311+
if ignore_loaded_modules
1312+
for (key, mod) in loaded_modules
1313+
if !(mod === Main || mod === Core || mod === Base)
1314+
push!(concrete_deps, key => module_build_id(mod))
1315+
end
13131316
end
13141317
end
13151318
# run the expression and cache the result

0 commit comments

Comments
 (0)