aboutsummaryrefslogtreecommitdiff
path: root/bpkg
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-09-18 17:07:10 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-09-25 11:35:25 +0300
commit2a047701f16ab174d01519c206917a2ea5f9bab1 (patch)
tree350c847b1c873915613c3dcb1f0ccc2140ac9db7 /bpkg
parent9ab0a783d6b6d5d765a0660e0d0ce5f74b4aefff (diff)
Properly re-collect existing packages scheduled for recursive re-collection even if their collection has been pruned
Diffstat (limited to 'bpkg')
-rw-r--r--bpkg/pkg-build-collect.cxx27
-rw-r--r--bpkg/pkg-build.cxx6
2 files changed, 29 insertions, 4 deletions
diff --git a/bpkg/pkg-build-collect.cxx b/bpkg/pkg-build-collect.cxx
index 5c9212b..159871b 100644
--- a/bpkg/pkg-build-collect.cxx
+++ b/bpkg/pkg-build-collect.cxx
@@ -3150,7 +3150,7 @@ namespace bpkg
// Note that while collect_build() may prefer an existing entry in
// the map and return NULL, the recursive collection of this
- // preferred entry may have been postponed due to the existing
+ // preferred entry may has been postponed due to the existing
// dependent (see collect_build_prerequisites() for details). Now,
// we can potentially be recursively collecting such a dependent
// after its re-evaluation to some earlier than this dependency
@@ -5544,7 +5544,12 @@ namespace bpkg
for (bool prog (find_if (postponed_recs.begin (), postponed_recs.end (),
[] (const build_package* p)
{
- return !p->recursive_collection;
+ // Note that we check for the dependencies
+ // presence rather than for the
+ // recursive_collection flag (see below for
+ // details).
+ //
+ return !p->dependencies;
}) != postponed_recs.end () ||
!postponed_repo.empty () ||
!postponed_cfgs.negotiated () ||
@@ -5560,7 +5565,17 @@ namespace bpkg
postponed_packages pcs;
for (build_package* p: postponed_recs)
{
- if (!p->recursive_collection)
+ // Note that we check for the dependencies presence rather than for
+ // the recursive_collection flag to also recollect the existing
+ // dependents which, for example, may have been specified on the
+ // command line and whose recursive collection has been pruned since
+ // there were no reason to collect it (configured, no upgrade,
+ // etc). Also note that this time we expect the collection to be
+ // enforced with the build_recollect flag.
+ //
+ assert ((p->flags & build_package::build_recollect) != 0);
+
+ if (!p->dependencies)
{
package_key pk (p->db, p->name ());
@@ -5612,7 +5627,13 @@ namespace bpkg
// due to it's own existing dependents.
//
if (p->recursive_collection)
+ {
+ // Must be present since the re-collection is enforced.
+ //
+ assert (p->dependencies);
+
prog = true;
+ }
}
}
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index e2dea9d..f13c114 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -4472,7 +4472,11 @@ namespace bpkg
if (find_if (postponed_recs.begin (), postponed_recs.end (),
[] (const build_package* p)
{
- return !p->recursive_collection;
+ // Note that we check for the dependencies presence
+ // rather than for the recursive_collection flag
+ // (see collect_build_postponed() for details).
+ //
+ return !p->dependencies;
}) != postponed_recs.end () ||
!postponed_repo.empty () ||
!postponed_alts.empty () ||