From aeea0f72e9b1ca4830ab1c19b88b16f7e1a497a0 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Thu, 14 Nov 2024 14:26:02 -0500 Subject: [PATCH] Revert "use a fixed world for code loading (#49525)" This reverts commit 59bf9e84a25ff8756d2e5d0ac73825f3b66493dc. --- base/Base.jl | 1 - base/loading.jl | 23 +++++------------------ 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/base/Base.jl b/base/Base.jl index 1f737452fa17af..3b3422a1f8e639 100644 --- a/base/Base.jl +++ b/base/Base.jl @@ -382,7 +382,6 @@ function __init__() # triggering a profile via signals is not implemented on windows start_profile_listener() end - _require_world_age[] = get_world_counter() # Prevent spawned Julia process from getting stuck waiting on Tracy to connect. delete!(ENV, "JULIA_WAIT_FOR_TRACY") if get_bool_env("JULIA_USE_FLISP_PARSER", false) === false diff --git a/base/loading.jl b/base/loading.jl index 79b4fb8cb9fcca..9decf2d72e354e 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -2323,8 +2323,6 @@ end # XXX: (this is deprecated, but still used by Distributed) const toplevel_load = Ref(true) -const _require_world_age = Ref{UInt}(typemax(UInt)) - """ require(into::Module, module::Symbol) @@ -2347,14 +2345,6 @@ For more details regarding code loading, see the manual sections on [modules](@r [parallel computing](@ref code-availability). """ function require(into::Module, mod::Symbol) - world = _require_world_age[] - if world == typemax(UInt) - world = get_world_counter() - end - return invoke_in_world(world, __require, into, mod) -end - -function __require(into::Module, mod::Symbol) if into === __toplevel__ && generating_output(#=incremental=#true) error("`using/import $mod` outside of a Module detected. Importing a package outside of a module \ is not allowed during package precompilation.") @@ -2459,14 +2449,11 @@ function collect_manifest_warnings() return msg end -function require(uuidkey::PkgId) - world = _require_world_age[] - if world == typemax(UInt) - world = get_world_counter() - end - return invoke_in_world(world, __require, uuidkey) -end -__require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey) +# __require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey) +require(uuidkey::PkgId) = @lock require_lock _require_prelocked(uuidkey) + +const REPL_PKGID = PkgId(UUID("3fa0cd96-eef1-5676-8a61-b3b8758bbffb"), "REPL") + function _require_prelocked(uuidkey::PkgId, env=nothing) assert_havelock(require_lock) m = start_loading(uuidkey, UInt128(0), true)