Skip to content

Commit ad1dc39

Browse files
author
KristofferC
committed
fix lookup when extension is in [deps]
1 parent e3f2f6b commit ad1dc39

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

base/loading.jl

+19-16
Original file line numberDiff line numberDiff line change
@@ -974,14 +974,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
974974
entry = entry::Dict{String, Any}
975975
uuid = get(entry, "uuid", nothing)::Union{String, Nothing}
976976
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}
977980
if UUID(uuid) === where.uuid
978981
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}
982982
if deps isa Vector{String}
983983
found_name = name in deps
984-
break
984+
found_name && @goto done
985985
elseif deps isa Dict{String, Any}
986986
deps = deps::Dict{String, Any}
987987
for (dep, uuid) in deps
@@ -1000,30 +1000,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
10001000
return PkgId(UUID(uuid), name)
10011001
end
10021002
exts = extensions[where.name]::Union{String, Vector{String}}
1003+
weakdeps = get(entry, "weakdeps", nothing)::Union{Vector{String}, Dict{String, Any}, Nothing}
10031004
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
10151018
end
10161019
end
10171020
end
10181021
end
1019-
end
10201022
# `name` is not an ext, do standard lookup as if this was the parent
10211023
return identify_package(PkgId(UUID(uuid), dep_name), name)
10221024
end
10231025
end
10241026
end
10251027
end
10261028
end
1029+
@label done
10271030
found_where || return nothing
10281031
found_name || return PkgId(name)
10291032
# Only reach here if deps was not a dict which mean we have a unique name for the dep

0 commit comments

Comments
 (0)