|
78 | 78 | pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, pkgs, PRESERVE_NONE, ctx.julia_version)
|
79 | 79 |
|
80 | 80 | if VERSION >= VersionNumber("1.9")
|
81 |
| - # Check for weak dependencies, which appear on the RHS of the deps_map but not in pkgs. |
82 |
| - # Build up weak_name_to_uuid |
83 |
| - uuid_to_name = Dict() |
84 |
| - for pkg in pkgs |
85 |
| - uuid_to_name[pkg.uuid] = pkg.name |
86 |
| - end |
87 |
| - weak_name_to_uuid = Dict() |
88 |
| - for (uuid, deps) in pairs(deps_map) |
89 |
| - for (dep_name, dep_uuid) in pairs(deps) |
90 |
| - if !haskey(uuid_to_name, dep_uuid) |
91 |
| - weak_name_to_uuid[dep_name] = dep_uuid |
| 81 | + while true |
| 82 | + # Check for weak dependencies, which appear on the RHS of the deps_map but not in pkgs. |
| 83 | + # Build up weak_name_to_uuid |
| 84 | + uuid_to_name = Dict() |
| 85 | + for pkg in pkgs |
| 86 | + uuid_to_name[pkg.uuid] = pkg.name |
| 87 | + end |
| 88 | + weak_name_to_uuid = Dict() |
| 89 | + for (uuid, deps) in pairs(deps_map) |
| 90 | + for (dep_name, dep_uuid) in pairs(deps) |
| 91 | + if !haskey(uuid_to_name, dep_uuid) |
| 92 | + weak_name_to_uuid[dep_name] = dep_uuid |
| 93 | + end |
92 | 94 | end
|
93 | 95 | end
|
94 |
| - end |
95 | 96 |
|
96 |
| - # If we have nontrivial weak dependencies, add each one to the initial pkgs and then re-run _resolve |
97 |
| - if !isempty(weak_name_to_uuid) |
| 97 | + if isempty(weak_name_to_uuid) |
| 98 | + break |
| 99 | + end |
| 100 | +
|
| 101 | + # We have nontrivial weak dependencies, so add each one to the initial pkgs and then re-run _resolve |
98 | 102 | println("Found weak dependencies: $(keys(weak_name_to_uuid))")
|
99 | 103 |
|
100 | 104 | orig_uuids = Set([pkg.uuid for pkg in orig_pkgs])
|
|
113 | 117 | orig_pkgs[length(orig_pkgs)] = update_package_add(ctx, pkg, entry, false)
|
114 | 118 | end
|
115 | 119 |
|
116 |
| - pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, orig_pkgs, PRESERVE_NONE, ctx.julia_version) |
| 120 | + global pkgs, deps_map = _resolve(ctx.io, ctx.env, ctx.registries, orig_pkgs, PRESERVE_NONE, ctx.julia_version) |
117 | 121 | end
|
118 | 122 | end
|
119 | 123 | '';
|
|
0 commit comments