aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-06-01 11:23:51 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2022-06-07 21:15:37 +0300
commite65ba5245aa1e67de26186a94dc34c6a7d795f9d (patch)
treeab7d9bdb9c09e4ab8bf9f1b5295682058d380df5
parent0c8e2951cc8b481a9b11af4f1815e63c17f25da1 (diff)
Clear shadow dependents on configuration merge
-rw-r--r--bpkg/pkg-build.cxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index e179d7c..c1cbffe 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -4440,7 +4440,7 @@ namespace bpkg
// Up-negotiate this dependent and re-negotiate (refine) postponed
// if any (being) negotiated configurations were involved into the
- // configuration addition/merge.
+ // configuration addition/merge. @@ Stray/old comment?
//
postponed_configuration& cfg (r.first);
@@ -4512,10 +4512,11 @@ namespace bpkg
<< pkg.available_name_version_db ()
<< " is negotiated";});
- // Note that we still need to recursively collect the not
- // yet collected dependencies before indicating to the
- // caller (returning true) that we are done with this
- // depends value and the dependent is not postponed.
+ // Note that we may still add extra dependenncies to this
+ // cluster which we still need to configure and recursively
+ // collect before indicating to the caller (returning true)
+ // that we are done with this depends value and the
+ // dependent is not postponed.
//
for (const package_key& p: cfg_deps)
{
@@ -5784,8 +5785,7 @@ namespace bpkg
i (b),
e (pcfg->dependents.end ()); i != e; )
{
- // The first step is to resolve package skeletons for the dependent
- // and its dependencies.
+ // Resolve package skeletons for the dependent and its dependencies.
//
// For the dependent, the skeleton should be already there (since we
// should have started recursively collecting it). For a dependency,
@@ -6134,6 +6134,9 @@ namespace bpkg
pc = &postponed_cfgs[ci];
+ // Note that in this case we keep the accumulated configuration
+ // and shadow dependents, if any.
+
pc->depth = 0;
// If requested, "replace" the "later" dependent-dependency
@@ -6224,6 +6227,11 @@ namespace bpkg
assert (!pc->negotiated);
+ // Drop any accumulated shadow dependents (which could be
+ // carried over from retry_configuration logic).
+ //
+ pc->shadow_dependents.clear ();
+
l5 ([&]{trace << "cfg-negotiation of " << *pc << " failed due "
<< "to non-negotiated clusters, force-merging "
<< "based on shadow cluster " << shadow;});