Skip to content

Commit b43764d

Browse files
IanButterworthjohanmon
authored andcommitted
add option to compilecache so that Pkg precompilation can not skip different versions of loaded modules (JuliaLang#40345)
* allow Pkg precomp to not skip loaded modules * rename to ignore_loaded_modules * arg alignment
1 parent 2991a4b commit b43764d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

base/loading.jl

+8-4
Original file line numberDiff line numberDiff line change
@@ -1303,16 +1303,20 @@ end
13031303

13041304
const MAX_NUM_PRECOMPILE_FILES = Ref(10)
13051305

1306-
function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout)
1306+
function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout,
1307+
ignore_loaded_modules::Bool = true)
1308+
13071309
@nospecialize internal_stderr internal_stdout
13081310
# decide where to put the resulting cache file
13091311
cachepath = compilecache_dir(pkg)
13101312

13111313
# build up the list of modules that we want the precompile process to preserve
13121314
concrete_deps = copy(_concrete_dependencies)
1313-
for (key, mod) in loaded_modules
1314-
if !(mod === Main || mod === Core || mod === Base)
1315-
push!(concrete_deps, key => module_build_id(mod))
1315+
if ignore_loaded_modules
1316+
for (key, mod) in loaded_modules
1317+
if !(mod === Main || mod === Core || mod === Base)
1318+
push!(concrete_deps, key => module_build_id(mod))
1319+
end
13161320
end
13171321
end
13181322
# run the expression and cache the result

0 commit comments

Comments
 (0)