@@ -2137,8 +2137,6 @@ end
2137
2137
2138
2138
require (uuidkey:: PkgId ) = @lock require_lock _require_prelocked (uuidkey)
2139
2139
2140
- const REPL_PKGID = PkgId (UUID (" 3fa0cd96-eef1-5676-8a61-b3b8758bbffb" ), " REPL" )
2141
-
2142
2140
function _require_prelocked (uuidkey:: PkgId , env= nothing )
2143
2141
if _require_world_age[] != typemax (UInt)
2144
2142
Base. invoke_in_world (_require_world_age[], __require_prelocked, uuidkey, env)
@@ -2254,7 +2252,7 @@ function set_pkgorigin_version_path(pkg::PkgId, path::Union{String,Nothing})
2254
2252
nothing
2255
2253
end
2256
2254
2257
- # A hook to allow code load to use Pkg.precompile
2255
+ # Unused
2258
2256
const PKG_PRECOMPILE_HOOK = Ref {Function} ()
2259
2257
2260
2258
# Returns `nothing` or the new(ish) module
@@ -2276,7 +2274,7 @@ function _require(pkg::PkgId, env=nothing)
2276
2274
end
2277
2275
set_pkgorigin_version_path (pkg, path)
2278
2276
2279
- pkg_precompile_attempted = false # being safe to avoid getting stuck in a Pkg.precompile loop
2277
+ parallel_precompile_attempted = false # being safe to avoid getting stuck in a precompilepkgs loop
2280
2278
reasons = Dict {String,Int} ()
2281
2279
# attempt to load the module file via the precompile cache locations
2282
2280
if JLOptions (). use_compiled_modules != 0
@@ -2306,11 +2304,12 @@ function _require(pkg::PkgId, env=nothing)
2306
2304
2307
2305
if JLOptions (). use_compiled_modules == 1
2308
2306
if ! generating_output (#= incremental=# false )
2309
- if ! pkg_precompile_attempted && isinteractive () && isassigned (PKG_PRECOMPILE_HOOK)
2310
- pkg_precompile_attempted = true
2307
+ project = active_project ()
2308
+ if ! parallel_precompile_attempted && @isdefined (PrecompilePkgs) && project != = nothing && isfile (project)
2309
+ parallel_precompile_attempted = true
2311
2310
unlock (require_lock)
2312
2311
try
2313
- @invokelatest PKG_PRECOMPILE_HOOK[]( pkg. name, _from_loading = true )
2312
+ PrecompilePkgs . precompilepkgs ([ pkg. name]; _from_loading= true )
2314
2313
finally
2315
2314
lock (require_lock)
2316
2315
end
0 commit comments