aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-05-24 00:59:08 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-05-24 00:59:46 +0300
commit3d872575f9b97365a6baa53a81cf104e2cfb5baa (patch)
tree5a61846b395a3ec71a2c951666c4298bbc30541e
parent13582557aaa1409c3c5c3bd39e12c16700f62d95 (diff)
Fix assertion failure in build_packages::collect_order_dependents()
-rw-r--r--bpkg/pkg-build-collect.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/bpkg/pkg-build-collect.cxx b/bpkg/pkg-build-collect.cxx
index 2bcd515..98b76b9 100644
--- a/bpkg/pkg-build-collect.cxx
+++ b/bpkg/pkg-build-collect.cxx
@@ -5886,12 +5886,20 @@ namespace bpkg
auto i (find_if (deps.begin (), deps.end (),
[&p] (const auto& v) {return v.first == &p;}));
- // It doesn't seems that we can be adding the same
- // unsatisfactory dependency twice.
+ // Skip the dependency if it is already in the list.
//
- assert (i == deps.end ());
+ // Note that we can be adding the same unsatisfactory dependency
+ // multiple times via different dependency paths. For example:
+ //
+ // 1. libboost-core -> libboost-mpl -> libboost-regex
+ // 2. libboost-utility -> libboost-mpl -> libboost-regex
+ //
+ // In this case, however, the constraint should be the same.
+ //
+ assert (i == deps.end () || i->second == c);
- deps.push_back (make_pair (&p, move (c)));
+ if (i == deps.end ())
+ deps.push_back (make_pair (&p, move (c)));
}
else
{