Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Feb 27, 2024
1 parent e63298c commit bf05d28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 3 additions & 1 deletion base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,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)
Expand Down Expand Up @@ -2313,7 +2314,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
Expand Down
6 changes: 1 addition & 5 deletions base/precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bf05d28

Please sign in to comment.