@@ -974,14 +974,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
974
974
entry = entry:: Dict{String, Any}
975
975
uuid = get (entry, " uuid" , nothing ):: Union{String, Nothing}
976
976
uuid === nothing && continue
977
+ # deps is either a list of names (deps = ["DepA", "DepB"]) or
978
+ # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
979
+ deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
977
980
if UUID (uuid) === where . uuid
978
981
found_where = true
979
- # deps is either a list of names (deps = ["DepA", "DepB"]) or
980
- # a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
981
- deps = get (entry, " deps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
982
982
if deps isa Vector{String}
983
983
found_name = name in deps
984
- break
984
+ found_name && @goto done
985
985
elseif deps isa Dict{String, Any}
986
986
deps = deps:: Dict{String, Any}
987
987
for (dep, uuid) in deps
@@ -1000,30 +1000,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
1000
1000
return PkgId (UUID (uuid), name)
1001
1001
end
1002
1002
exts = extensions[where . name]:: Union{String, Vector{String}}
1003
+ weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
1003
1004
if (exts isa String && name == exts) || (exts isa Vector{String} && name in exts)
1004
- weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
1005
- if weakdeps != = nothing
1006
- if weakdeps isa Vector{String}
1007
- found_name = name in weakdeps
1008
- break
1009
- elseif weakdeps isa Dict{String, Any}
1010
- weakdeps = weakdeps:: Dict{String, Any}
1011
- for (dep, uuid) in weakdeps
1012
- uuid:: String
1013
- if dep === name
1014
- return PkgId (UUID (uuid), name)
1005
+ for deps′ in [weakdeps, deps]
1006
+ if deps′ != = nothing
1007
+ if deps′ isa Vector{String}
1008
+ found_name = name in deps′
1009
+ found_name && @goto done
1010
+ elseif deps′ isa Dict{String, Any}
1011
+ deps′ = deps′:: Dict{String, Any}
1012
+ for (dep, uuid) in deps′
1013
+ uuid:: String
1014
+ if dep === name
1015
+ return PkgId (UUID (uuid), name)
1016
+ end
1017
+ end
1015
1018
end
1016
1019
end
1017
1020
end
1018
1021
end
1019
- end
1020
1022
# `name` is not an ext, do standard lookup as if this was the parent
1021
1023
return identify_package (PkgId (UUID (uuid), dep_name), name)
1022
1024
end
1023
1025
end
1024
1026
end
1025
1027
end
1026
1028
end
1029
+ @label done
1027
1030
found_where || return nothing
1028
1031
found_name || return PkgId (name)
1029
1032
# Only reach here if deps was not a dict which mean we have a unique name for the dep
@@ -1554,7 +1557,7 @@ function _insert_extension_triggers(parent::PkgId, extensions::Dict{String, Any}
1554
1557
# TODO : Better error message if this lookup fails?
1555
1558
uuid_trigger = UUID (totaldeps[trigger]:: String )
1556
1559
trigger_id = PkgId (uuid_trigger, trigger)
1557
- if ! haskey (explicit_loaded_modules , trigger_id) || haskey (package_locks, trigger_id)
1560
+ if ! haskey (Base . loaded_modules , trigger_id) || haskey (package_locks, trigger_id)
1558
1561
trigger1 = get! (Vector{ExtensionId}, EXT_DORMITORY, trigger_id)
1559
1562
push! (trigger1, gid)
1560
1563
else
@@ -2428,9 +2431,8 @@ function __require_prelocked(uuidkey::PkgId, env=nothing)
2428
2431
insert_extension_triggers (uuidkey)
2429
2432
# After successfully loading, notify downstream consumers
2430
2433
run_package_callbacks (uuidkey)
2431
- elseif ! haskey (explicit_loaded_modules, uuidkey)
2432
- explicit_loaded_modules[uuidkey] = m
2433
- run_package_callbacks (uuidkey)
2434
+ else
2435
+ newm = root_module (uuidkey)
2434
2436
end
2435
2437
return m
2436
2438
end
@@ -2443,7 +2445,6 @@ end
2443
2445
PkgOrigin () = PkgOrigin (nothing , nothing , nothing )
2444
2446
const pkgorigins = Dict {PkgId,PkgOrigin} ()
2445
2447
2446
- const explicit_loaded_modules = Dict {PkgId,Module} () # Emptied on Julia start
2447
2448
const loaded_modules = Dict {PkgId,Module} () # available to be explicitly loaded
2448
2449
const loaded_precompiles = Dict {PkgId,Vector{Module}} () # extended (complete) list of modules, available to be loaded
2449
2450
const loaded_modules_order = Vector {Module} ()
@@ -2483,7 +2484,6 @@ end
2483
2484
end
2484
2485
maybe_loaded_precompile (key, module_build_id (m)) === nothing && push! (loaded_modules_order, m)
2485
2486
loaded_modules[key] = m
2486
- explicit_loaded_modules[key] = m
2487
2487
module_keys[m] = key
2488
2488
end
2489
2489
nothing
@@ -2515,9 +2515,6 @@ loaded_modules_array() = @lock require_lock copy(loaded_modules_order)
2515
2515
# after unreference_module, a subsequent require call will try to load a new copy of it, if stale
2516
2516
# reload(m) = (unreference_module(m); require(m))
2517
2517
function unreference_module (key:: PkgId )
2518
- if haskey (explicit_loaded_modules, key)
2519
- m = pop! (explicit_loaded_modules, key)
2520
- end
2521
2518
if haskey (loaded_modules, key)
2522
2519
m = pop! (loaded_modules, key)
2523
2520
# need to ensure all modules are GC rooted; will still be referenced
@@ -3126,7 +3123,7 @@ function compilecache(pkg::PkgId, path::String, internal_stderr::IO = stderr, in
3126
3123
# build up the list of modules that we want the precompile process to preserve
3127
3124
if keep_loaded_modules
3128
3125
concrete_deps = copy (_concrete_dependencies)
3129
- for (pkgreq, modreq) in loaded_modules # TODO : convert all relevant staleness heuristics to use explicit_loaded_modules instead
3126
+ for (pkgreq, modreq) in loaded_modules
3130
3127
if ! (pkgreq === Main || pkgreq === Core || pkgreq === Base)
3131
3128
push! (concrete_deps, pkgreq => module_build_id (modreq))
3132
3129
end
0 commit comments