@@ -2147,8 +2147,6 @@ end
2147
2147
2148
2148
require (uuidkey:: PkgId ) = @lock require_lock _require_prelocked (uuidkey)
2149
2149
2150
- const REPL_PKGID = PkgId (UUID (" 3fa0cd96-eef1-5676-8a61-b3b8758bbffb" ), " REPL" )
2151
-
2152
2150
function _require_prelocked (uuidkey:: PkgId , env= nothing )
2153
2151
if _require_world_age[] != typemax (UInt)
2154
2152
Base. invoke_in_world (_require_world_age[], __require_prelocked, uuidkey, env)
@@ -2262,8 +2260,9 @@ function set_pkgorigin_version_path(pkg::PkgId, path::String)
2262
2260
nothing
2263
2261
end
2264
2262
2265
- # A hook to allow code load to use Pkg.precompile
2263
+ # Unused
2266
2264
const PKG_PRECOMPILE_HOOK = Ref {Function} ()
2265
+ disable_parallel_precompile:: Bool = false
2267
2266
2268
2267
# Returns `nothing` or the new(ish) module
2269
2268
function _require (pkg:: PkgId , env= nothing )
@@ -2284,7 +2283,7 @@ function _require(pkg::PkgId, env=nothing)
2284
2283
end
2285
2284
set_pkgorigin_version_path (pkg, path)
2286
2285
2287
- pkg_precompile_attempted = false # being safe to avoid getting stuck in a Pkg.precompile loop
2286
+ parallel_precompile_attempted = false # being safe to avoid getting stuck in a precompilepkgs loop
2288
2287
reasons = Dict {String,Int} ()
2289
2288
# attempt to load the module file via the precompile cache locations
2290
2289
if JLOptions (). use_compiled_modules != 0
@@ -2314,11 +2313,13 @@ function _require(pkg::PkgId, env=nothing)
2314
2313
2315
2314
if JLOptions (). use_compiled_modules == 1
2316
2315
if ! generating_output (#= incremental=# false )
2317
- if ! pkg_precompile_attempted && isinteractive () && isassigned (PKG_PRECOMPILE_HOOK)
2318
- pkg_precompile_attempted = true
2316
+ project = active_project ()
2317
+ if ! generating_output () && ! parallel_precompile_attempted && ! disable_parallel_precompile && @isdefined (PrecompilePkgs) && project != = nothing &&
2318
+ isfile (project) && project_file_manifest_path (project) != = nothing
2319
+ parallel_precompile_attempted = true
2319
2320
unlock (require_lock)
2320
2321
try
2321
- @invokelatest PKG_PRECOMPILE_HOOK[]( pkg. name, _from_loading = true )
2322
+ PrecompilePkgs . precompilepkgs ([ pkg. name]; _from_loading= true )
2322
2323
finally
2323
2324
lock (require_lock)
2324
2325
end
0 commit comments