Skip to content

Commit 385caed

Browse files
KristofferCtopolarity
KristofferC
authored andcommitted
fix lookup when extension is in [deps]
1 parent ca603a1 commit 385caed

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

base/loading.jl

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -878,14 +878,14 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
878878
entry = entry::Dict{String, Any}
879879
uuid = get(entry, "uuid", nothing)::Union{String, Nothing}
880880
uuid === nothing && continue
881+
# deps is either a list of names (deps = ["DepA", "DepB"]) or
882+
# a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
883+
deps = get(entry, "deps", nothing)::Union{Vector{String}, Dict{String, Any}, Nothing}
881884
if UUID(uuid) === where.uuid
882885
found_where = true
883-
# deps is either a list of names (deps = ["DepA", "DepB"]) or
884-
# a table of entries (deps = {"DepA" = "6ea...", "DepB" = "55d..."}
885-
deps = get(entry, "deps", nothing)::Union{Vector{String}, Dict{String, Any}, Nothing}
886886
if deps isa Vector{String}
887887
found_name = name in deps
888-
break
888+
found_name && @goto done
889889
elseif deps isa Dict{String, Any}
890890
deps = deps::Dict{String, Any}
891891
for (dep, uuid) in deps
@@ -904,30 +904,33 @@ function explicit_manifest_deps_get(project_file::String, where::PkgId, name::St
904904
return PkgId(UUID(uuid), name)
905905
end
906906
exts = extensions[where.name]::Union{String, Vector{String}}
907+
weakdeps = get(entry, "weakdeps", nothing)::Union{Vector{String}, Dict{String, Any}, Nothing}
907908
if (exts isa String && name == exts) || (exts isa Vector{String} && name in exts)
908-
weakdeps = get(entry, "weakdeps", nothing)::Union{Vector{String}, Dict{String, Any}, Nothing}
909-
if weakdeps !== nothing
910-
if weakdeps isa Vector{String}
911-
found_name = name in weakdeps
912-
break
913-
elseif weakdeps isa Dict{String, Any}
914-
weakdeps = weakdeps::Dict{String, Any}
915-
for (dep, uuid) in weakdeps
916-
uuid::String
917-
if dep === name
918-
return PkgId(UUID(uuid), name)
909+
for deps′ in [weakdeps, deps]
910+
if deps′ !== nothing
911+
if deps′ isa Vector{String}
912+
found_name = name in deps′
913+
found_name && @goto done
914+
elseif deps′ isa Dict{String, Any}
915+
deps′ = deps′::Dict{String, Any}
916+
for (dep, uuid) in deps′
917+
uuid::String
918+
if dep === name
919+
return PkgId(UUID(uuid), name)
920+
end
921+
end
919922
end
920923
end
921924
end
922925
end
923-
end
924926
# `name` is not an ext, do standard lookup as if this was the parent
925927
return identify_package(PkgId(UUID(uuid), dep_name), name)
926928
end
927929
end
928930
end
929931
end
930932
end
933+
@label done
931934
found_where || return nothing
932935
found_name || return PkgId(name)
933936
# Only reach here if deps was not a dict which mean we have a unique name for the dep

0 commit comments

Comments
 (0)