Skip to content

Commit 2877f3b

Browse files
support new manifest format during code load
1 parent ccf7824 commit 2877f3b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

base/loading.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,16 @@ function explicit_project_deps_get(project_file::String, name::String)::Union{No
485485
return nothing
486486
end
487487

488+
# handles returning deps list for both old and new manifest formats
489+
# if no `deps` field, then its either the older flat format or empty, so return self
490+
get_deps(d) = get(d, "deps", d)
491+
488492
# find `where` stanza and return the PkgId for `name`
489493
# return `nothing` if it did not find `where` (indicating caller should continue searching)
490494
function explicit_manifest_deps_get(project_file::String, where::UUID, name::String)::Union{Nothing,PkgId}
491495
manifest_file = project_file_manifest_path(project_file)
492496
manifest_file === nothing && return nothing # manifest not found--keep searching LOAD_PATH
493-
d = parsed_toml(manifest_file)
497+
d = get_deps(parsed_toml(manifest_file))
494498
found_where = false
495499
found_name = false
496500
for (dep_name, entries) in d
@@ -538,7 +542,7 @@ function explicit_manifest_uuid_path(project_file::String, pkg::PkgId)::Union{No
538542
manifest_file = project_file_manifest_path(project_file)
539543
manifest_file === nothing && return nothing # no manifest, skip env
540544

541-
d = parsed_toml(manifest_file)
545+
d = get_deps(parsed_toml(manifest_file))
542546
entries = get(d, pkg.name, nothing)::Union{Nothing, Vector{Any}}
543547
entries === nothing && return nothing # TODO: allow name to mismatch?
544548
for entry in entries

0 commit comments

Comments
 (0)