From 58dbd2c3f6b46baf23162b0f991b48c6983ee04f Mon Sep 17 00:00:00 2001 From: Ian Date: Sat, 3 Apr 2021 15:23:57 -0400 Subject: [PATCH 1/3] allow Pkg precomp to not skip loaded modules --- base/loading.jl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 1f317b1b161d9..601be72055d63 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1303,16 +1303,20 @@ end const MAX_NUM_PRECOMPILE_FILES = Ref(10) -function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout) +function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout, + skip_loaded_modules::Bool = true) + @nospecialize internal_stderr internal_stdout # decide where to put the resulting cache file cachepath = compilecache_dir(pkg) # build up the list of modules that we want the precompile process to preserve concrete_deps = copy(_concrete_dependencies) - for (key, mod) in loaded_modules - if !(mod === Main || mod === Core || mod === Base) - push!(concrete_deps, key => module_build_id(mod)) + if skip_loaded_modules + for (key, mod) in loaded_modules + if !(mod === Main || mod === Core || mod === Base) + push!(concrete_deps, key => module_build_id(mod)) + end end end # run the expression and cache the result From 4ec243843b727274cfe8fb04097125b403e919a9 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 5 Apr 2021 22:10:23 -0400 Subject: [PATCH 2/3] rename to ignore_loaded_modules --- base/loading.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/loading.jl b/base/loading.jl index 601be72055d63..5c5f00b2448ea 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1304,7 +1304,7 @@ end const MAX_NUM_PRECOMPILE_FILES = Ref(10) function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout, - skip_loaded_modules::Bool = true) + ignore_loaded_modules::Bool = true) @nospecialize internal_stderr internal_stdout # decide where to put the resulting cache file @@ -1312,7 +1312,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in # build up the list of modules that we want the precompile process to preserve concrete_deps = copy(_concrete_dependencies) - if skip_loaded_modules + if ignore_loaded_modules for (key, mod) in loaded_modules if !(mod === Main || mod === Core || mod === Base) push!(concrete_deps, key => module_build_id(mod)) From 0075396b4684ffb412aaa813d7d900bb1aa8e970 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 7 Apr 2021 18:47:35 -0400 Subject: [PATCH 3/3] arg alignment --- base/loading.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/loading.jl b/base/loading.jl index 5c5f00b2448ea..fc4b1b2f1b687 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -1304,7 +1304,7 @@ end const MAX_NUM_PRECOMPILE_FILES = Ref(10) function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, internal_stdout::IO = stdout, - ignore_loaded_modules::Bool = true) + ignore_loaded_modules::Bool = true) @nospecialize internal_stderr internal_stdout # decide where to put the resulting cache file