@@ -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
0 commit comments