diff --git a/base/loading.jl b/base/loading.jl index 3e9fe07d7fe8af..a2ff56be74e00a 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -2254,6 +2254,7 @@ end # Unused const PKG_PRECOMPILE_HOOK = Ref{Function}() +disable_parallel_precompile::Bool = false # Returns `nothing` or the new(ish) module function _require(pkg::PkgId, env=nothing) @@ -2305,7 +2306,8 @@ function _require(pkg::PkgId, env=nothing) if JLOptions().use_compiled_modules == 1 if !generating_output(#=incremental=#false) project = active_project() - if !parallel_precompile_attempted && @isdefined(PrecompilePkgs) && project !== nothing && isfile(project) && project_file_manifest_path(project) !== nothing + if !generating_output() && !parallel_precompile_attempted && !disable_parallel_precompile && @isdefined(PrecompilePkgs) && project !== nothing && + isfile(project) && project_file_manifest_path(project) !== nothing parallel_precompile_attempted = true unlock(require_lock) try diff --git a/base/precompile.jl b/base/precompile.jl index b2eb68a75a14d4..b344ef91cdbe79 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -342,10 +342,6 @@ function precompilepkgs(pkgs::Vector{String}=String[]; internal_call::Bool=false env = ExplicitEnv() - if isempty(pkgs) - pkgs = collect(keys(env.project_deps)) - end - # Windows sometimes hits a ReadOnlyMemoryError, so we halve the default number of tasks. Issue #2323 # TODO: Investigate why this happens in windows and restore the full task limit default_num_tasks = Sys.iswindows() ? div(Sys.CPU_THREADS::Int, 2) + 1 : Sys.CPU_THREADS::Int + 1 @@ -789,7 +785,7 @@ function precompilepkgs(pkgs::Vector{String}=String[]; internal_call::Bool=false notify(was_processed[pkg]) catch err_outer # For debugging: - @error "Task failed" exception=(err_outer, catch_backtrace()) + # @error "Task failed" exception=(err_outer, catch_backtrace()) handle_interrupt(err_outer) || rethrow() notify(was_processed[pkg]) finally