@@ -934,14 +934,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
934
934
entry = entry:: Dict{String, Any}
935
935
uuid = get (entry, " uuid" , nothing ):: Union{String, Nothing}
936
936
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}
937
940
if UUID (uuid) === where . uuid
938
941
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}
942
942
if deps isa Vector{String}
943
943
found_name = name in deps
944
- break
944
+ found_name && @goto done
945
945
elseif deps isa Dict{String, Any}
946
946
deps = deps:: Dict{String, Any}
947
947
for (dep, uuid) in deps
@@ -960,30 +960,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
960
960
return PkgId (UUID (uuid), name)
961
961
end
962
962
exts = extensions[where . name]:: Union{String, Vector{String}}
963
+ weakdeps = get (entry, " weakdeps" , nothing ):: Union{Vector{String}, Dict{String, Any}, Nothing}
963
964
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
975
978
end
976
979
end
977
980
end
978
981
end
979
- end
980
982
# `name` is not an ext, do standard lookup as if this was the parent
981
983
return identify_package (PkgId (UUID (uuid), dep_name), name)
982
984
end
983
985
end
984
986
end
985
987
end
986
988
end
989
+ @label done
987
990
found_where || return nothing
988
991
found_name || return PkgId (name)
989
992
# 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}
1518
1521
uuid_trigger = UUID (totaldeps[trigger]:: String )
1519
1522
trigger_id = PkgId (uuid_trigger, trigger)
1520
1523
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)
1522
1525
trigger1 = get! (Vector{ExtensionId}, EXT_DORMITORY, trigger_id)
1523
1526
push! (trigger1, gid)
1524
1527
else
@@ -2392,9 +2395,8 @@ function __require_prelocked(uuidkey::PkgId, env=nothing)
2392
2395
insert_extension_triggers (uuidkey)
2393
2396
# After successfully loading, notify downstream consumers
2394
2397
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)
2398
2400
end
2399
2401
return m
2400
2402
end
@@ -2407,7 +2409,6 @@ end
2407
2409
PkgOrigin () = PkgOrigin (nothing , nothing , nothing )
2408
2410
const pkgorigins = Dict {PkgId,PkgOrigin} ()
2409
2411
2410
- const explicit_loaded_modules = Dict {PkgId,Module} () # Emptied on Julia start
2411
2412
const loaded_modules = Dict {PkgId,Module} () # available to be explicitly loaded
2412
2413
const loaded_precompiles = Dict {PkgId,Vector{Module}} () # extended (complete) list of modules, available to be loaded
2413
2414
const loaded_modules_order = Vector {Module} ()
@@ -2448,7 +2449,6 @@ end
2448
2449
end
2449
2450
maybe_loaded_precompile (key, module_build_id (m)) === nothing && push! (loaded_modules_order, m)
2450
2451
loaded_modules[key] = m
2451
- explicit_loaded_modules[key] = m
2452
2452
module_keys[m] = key
2453
2453
end
2454
2454
nothing
@@ -2480,9 +2480,6 @@ loaded_modules_array() = @lock require_lock copy(loaded_modules_order)
2480
2480
# after unreference_module, a subsequent require call will try to load a new copy of it, if stale
2481
2481
# reload(m) = (unreference_module(m); require(m))
2482
2482
function unreference_module (key:: PkgId )
2483
- if haskey (explicit_loaded_modules, key)
2484
- m = pop! (explicit_loaded_modules, key)
2485
- end
2486
2483
if haskey (loaded_modules, key)
2487
2484
m = pop! (loaded_modules, key)
2488
2485
# 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
3046
3043
# build up the list of modules that we want the precompile process to preserve
3047
3044
if keep_loaded_modules
3048
3045
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
3050
3047
if ! (pkgreq === Main || pkgreq === Core || pkgreq === Base)
3051
3048
push! (concrete_deps, pkgreq => module_build_id (modreq))
3052
3049
end
@@ -4027,7 +4024,7 @@ end
4027
4024
4028
4025
# Variants that work for `invoke`d calls for which the signature may not be sufficient
4029
4026
precompile (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 )
4031
4028
4032
4029
"""
4033
4030
precompile(f, argtypes::Tuple{Vararg{Any}}, m::Method)
0 commit comments