Skip to content

Commit 98512c1

Browse files
support new manifest format during code load
1 parent ccf7824 commit 98512c1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

base/loading.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,17 @@ 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))
498+
d === nothing && return nothing
494499
found_where = false
495500
found_name = false
496501
for (dep_name, entries) in d
@@ -538,7 +543,8 @@ function explicit_manifest_uuid_path(project_file::String, pkg::PkgId)::Union{No
538543
manifest_file = project_file_manifest_path(project_file)
539544
manifest_file === nothing && return nothing # no manifest, skip env
540545

541-
d = parsed_toml(manifest_file)
546+
d = get_deps(parsed_toml(manifest_file))
547+
d === nothing && return nothing
542548
entries = get(d, pkg.name, nothing)::Union{Nothing, Vector{Any}}
543549
entries === nothing && return nothing # TODO: allow name to mismatch?
544550
for entry in entries

0 commit comments

Comments
 (0)