@@ -934,14 +934,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
934934 entry = entry:: Dict{String, Any}
935935 uuid = get (entry, " uuid" , nothing ):: Union{String, Nothing}
936936 uuid === nothing && continue
937+ # deps is either a list of names (deps = ["DepA", "DepB"]) or
938+ # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
939+ deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
937940 if UUID (uuid) === where . uuid
938941 found_where = true
939- # deps is either a list of names (deps = ["DepA", "DepB"]) or
940- # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
941- deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
942942 if deps isa Vector{String}
943943 found_name = name in deps
944- break
944+ found_name && @goto done
945945 elseif deps isa Dict{String, Any}
946946 deps = deps:: Dict{String, Any}
947947 for (dep, uuid) in deps
@@ -960,30 +960,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
960960 return PkgId (UUID (uuid), name)
961961 end
962962 exts = extensions[where . name]:: Union{String, Vector{String}}
963+ weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
963964 if (exts isa String && name == exts) || (exts isa Vector{String} && name in exts)
964- weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
965- if weakdeps != = nothing
966- if weakdeps isa Vector{String}
967- found_name = name in weakdeps
968- break
969- elseif weakdeps isa Dict{String, Any}
970- weakdeps = weakdeps:: Dict{String, Any}
971- for (dep, uuid) in weakdeps
972- uuid:: String
973- if dep === name
974- return PkgId (UUID (uuid), name)
965+ for deps′ in [weakdeps, deps]
966+ if deps′ != = nothing
967+ if deps′ isa Vector{String}
968+ found_name = name in deps′
969+ found_name && @goto done
970+ elseif deps′ isa Dict{String, Any}
971+ deps′ = deps′:: Dict{String, Any}
972+ for (dep, uuid) in deps′
973+ uuid:: String
974+ if dep === name
975+ return PkgId (UUID (uuid), name)
976+ end
977+ end
975978 end
976979 end
977980 end
978981 end
979- end
980982 # `name` is not an ext, do standard lookup as if this was the parent
981983 return identify_package (PkgId (UUID (uuid), dep_name), name)
982984 end
983985 end
984986 end
985987 end
986988 end
989+ @label done
987990 found_where || return nothing
988991 found_name || return PkgId (name)
989992 # Only reach here if deps was not a dict which mean we have a unique name for the dep
@@ -1518,7 +1521,7 @@ function _insert_extension_triggers(parent::PkgId, extensions::Dict{String, Any}
15181521 uuid_trigger = UUID (totaldeps[trigger]:: String )
15191522 trigger_id = PkgId (uuid_trigger, trigger)
15201523 push! (trigger_ids, trigger_id)
1521- if ! haskey (explicit_loaded_modules , trigger_id) || haskey (package_locks, trigger_id)
1524+ if ! haskey (Base . loaded_modules , trigger_id) || haskey (package_locks, trigger_id)
15221525 trigger1 = get! (Vector{ExtensionId}, EXT_DORMITORY, trigger_id)
15231526 push! (trigger1, gid)
15241527 else
@@ -2392,9 +2395,8 @@ function __require_prelocked(uuidkey::PkgId, env=nothing)
23922395 insert_extension_triggers (uuidkey)
23932396 # After successfully loading, notify downstream consumers
23942397 run_package_callbacks (uuidkey)
2395- elseif ! haskey (explicit_loaded_modules, uuidkey)
2396- explicit_loaded_modules[uuidkey] = m
2397- run_package_callbacks (uuidkey)
2398+ else
2399+ newm = root_module (uuidkey)
23982400 end
23992401 return m
24002402end
@@ -2407,7 +2409,6 @@ end
24072409PkgOrigin () = PkgOrigin (nothing , nothing , nothing )
24082410const pkgorigins = Dict {PkgId,PkgOrigin} ()
24092411
2410- const explicit_loaded_modules = Dict {PkgId,Module} () # Emptied on Julia start
24112412const loaded_modules = Dict {PkgId,Module} () # available to be explicitly loaded
24122413const loaded_precompiles = Dict {PkgId,Vector{Module}} () # extended (complete) list of modules, available to be loaded
24132414const loaded_modules_order = Vector {Module} ()
@@ -2448,7 +2449,6 @@ end
24482449 end
24492450 maybe_loaded_precompile (key, module_build_id (m)) === nothing && push! (loaded_modules_order, m)
24502451 loaded_modules[key] = m
2451- explicit_loaded_modules[key] = m
24522452 module_keys[m] = key
24532453 end
24542454 nothing
@@ -2480,9 +2480,6 @@ loaded_modules_array() = @lock require_lock copy(loaded_modules_order)
24802480# after unreference_module, a subsequent require call will try to load a new copy of it, if stale
24812481# reload(m) = (unreference_module(m); require(m))
24822482function unreference_module (key:: PkgId )
2483- if haskey (explicit_loaded_modules, key)
2484- m = pop! (explicit_loaded_modules, key)
2485- end
24862483 if haskey (loaded_modules, key)
24872484 m = pop! (loaded_modules, key)
24882485 # need to ensure all modules are GC rooted; will still be referenced
@@ -3046,7 +3043,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
30463043 # build up the list of modules that we want the precompile process to preserve
30473044 if keep_loaded_modules
30483045 concrete_deps = copy (_concrete_dependencies)
3049- for (pkgreq, modreq) in loaded_modules # TODO : convert all relevant staleness heuristics to use explicit_loaded_modules instead
3046+ for (pkgreq, modreq) in loaded_modules
30503047 if ! (pkgreq === Main || pkgreq === Core || pkgreq === Base)
30513048 push! (concrete_deps, pkgreq => module_build_id (modreq))
30523049 end
@@ -4027,7 +4024,7 @@ end
40274024
40284025# Variants that work for `invoke`d calls for which the signature may not be sufficient
40294026precompile (mi:: Core.MethodInstance , world:: UInt = get_world_counter ()) =
4030- (ccall (:jl_compile_method_instance , Cvoid, (Any, Any , UInt), mi, C_NULL , world); return true )
4027+ (ccall (:jl_compile_method_instance , Cvoid, (Any, Ptr{Cvoid} , UInt), mi, C_NULL , world); return true )
40314028
40324029"""
40334030 precompile(f, argtypes::Tuple{Vararg{Any}}, m::Method)
0 commit comments