From 300f66bb8447301bfc23b5e3bbc5b952506f0b42 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 2 Nov 2023 14:40:41 +0300 Subject: Fix configuration negotiation machinery to non-recursivelly collect being postponed existing dependents --- bpkg/pkg-build-collect.cxx | 13 ++++++++----- bpkg/pkg-build-collect.hxx | 30 +++++++++++++++++++----------- 2 files changed, 27 insertions(+), 16 deletions(-) (limited to 'bpkg') diff --git a/bpkg/pkg-build-collect.cxx b/bpkg/pkg-build-collect.cxx index a70ef10..2be737e 100644 --- a/bpkg/pkg-build-collect.cxx +++ b/bpkg/pkg-build-collect.cxx @@ -5704,6 +5704,13 @@ namespace bpkg // pi->second.wout_config = true; + collect_existing_dependent (o, + ed, + {p}, + replaced_vers, + postponed_cfgs, + unsatisfied_depts); + postponed_existing_dependents.insert (pk); continue; } @@ -6842,17 +6849,13 @@ namespace bpkg << ed.db << " due to bogus postponement of " << "dependency " << pk;}); - // Note that we pass false as the add_required_by argument since - // the postponment is bogus and thus the originating dependency - // for this existing dependent may not be collected. - // recollect_existing_dependent (o, ed, replaced_vers, postponed_recs, postponed_cfgs, unsatisfied_depts, - false /* add_required_by */); + true /* add_required_by */); prog = true; break; } diff --git a/bpkg/pkg-build-collect.hxx b/bpkg/pkg-build-collect.hxx index f1dc18e..74a48a0 100644 --- a/bpkg/pkg-build-collect.hxx +++ b/bpkg/pkg-build-collect.hxx @@ -536,6 +536,10 @@ namespace bpkg // type of dependent and then just process dependencies that have the first // (without config) but not the second (with config). // + // Note that if any of these flags is set to true, then the dependency is + // expected to be collected (present in the build_packages's map; see below + // for the class definition). + // struct postponed_dependency { bool wout_config; // Has dependent without config. @@ -1640,17 +1644,21 @@ namespace bpkg private: // Return the list of existing dependents that has a configuration clause // for any of the selected alternatives together with the dependencies for - // the earliest such an alternative and the original dependency (for which - // the function is called for) position. Return absent dependency for - // those dependents which dependency alternatives selection has deviated - // (normally due to the dependency up/downgrade). Skip dependents which - // are being built and require recursive recollection or dropped (present - // in the map) or expected to be built or dropped (present in rpt_depts or - // replaced_vers). Also skip dependents which impose the version - // constraint on this dependency and the dependency doesn't satisfy this - // constraint. Optionally, skip the existing dependents for which - // re-evaluation is considered optional (exclude_optional argument; see - // pre-reevaluation mode of collect_build_prerequisites() for details). + // the earliest such an alternative and the originating dependency (for + // which the function is called for) position. Return absent dependency + // for those dependents which dependency alternatives selection has + // deviated (normally due to the dependency up/downgrade). Skip dependents + // which are being built and require recursive recollection or dropped + // (present in the map) or expected to be built or dropped (present in + // rpt_depts or replaced_vers). Also skip dependents which impose the + // version constraint on this dependency and the dependency doesn't + // satisfy this constraint. Optionally, skip the existing dependents for + // which re-evaluation is considered optional (exclude_optional argument; + // see pre-reevaluation mode of collect_build_prerequisites() for + // details). + // + // Note that the originating dependency is expected to be collected + // (present in the map). // struct existing_dependent { -- cgit v1.1