diff options
Diffstat (limited to 'bpkg/pkg-build-collect.hxx')
-rw-r--r-- | bpkg/pkg-build-collect.hxx | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/bpkg/pkg-build-collect.hxx b/bpkg/pkg-build-collect.hxx index f84c86f..ad2b89e 100644 --- a/bpkg/pkg-build-collect.hxx +++ b/bpkg/pkg-build-collect.hxx @@ -221,9 +221,9 @@ namespace bpkg package_version_key dependent; // False for non-packages. Otherwise, indicates whether the constraint - // comes from the selected dependent or not. + // comes from the existing rather than the being built dependent. // - bool selected_dependent; + bool existing_dependent; // Create constraint for a package dependent. // @@ -231,17 +231,17 @@ namespace bpkg database& db, package_name nm, version ver, - bool s) + bool e) : value (move (v)), dependent (db, move (nm), move (ver)), - selected_dependent (s) {} + existing_dependent (e) {} // Create constraint for a non-package dependent. // constraint_type (version_constraint v, database& db, string nm) : value (move (v)), dependent (db, move (nm)), - selected_dependent (false) {} + existing_dependent (false) {} }; vector<constraint_type> constraints; @@ -311,7 +311,9 @@ namespace bpkg // If true, then this package is requested to be deorphaned. Can only be // true if the package is already selected and is orphaned. Used by the // unsatisfied dependency constraints resolution logic (see - // try_replace_dependency() in pkg-build.cxx for details). + // try_replace_dependency() in pkg-build.cxx for details). Also, the + // package deorphaning target versions are normally preferred over the + // other versions by collect_build(). // bool deorphan; @@ -762,21 +764,22 @@ namespace bpkg cancel_bogus (tracer&, bool scratch); }; - - // Dependents with their unsatisfactory dependencies and the respective - // ignored constraints. + // Dependents with their ignored dependency constraints and, optionally, + // with the respective unsatisfactory dependency versions. // // Note that during the collecting of all the explicitly specified packages // and their dependencies for the build, we may discover that a being // up/downgraded dependency doesn't satisfy all the being reconfigured, - // up/downgraded, or newly built dependents. Rather than fail immediately in - // such a case, we postpone the failure, add the unsatisfied dependents and - // their respective constraints to the unsatisfied dependents list, and - // continue the collection/ordering in the hope that these problems will be - // resolved naturally as a result of the requested recollection from scratch - // or execution plan refinement (dependents will also be up/downgraded or - // dropped, dependencies will be up/downgraded to a different versions, - // etc). + // up/downgraded, or newly built dependents. We may also discover that a + // user-specified dependency constraint does not satisfy constraints imposed + // by some dependent packages on this dependency. Rather than fail + // immediately in such cases, we postpone the failure, add the unsatisfied + // dependents and their respective constraints to the unsatisfied dependents + // list, and continue the collection/ordering in the hope that these + // problems will be resolved naturally as a result of the requested + // recollection from scratch or execution plan refinement (dependents will + // also be up/downgraded or dropped, dependencies will be up/downgraded to a + // different versions, etc). // // Also note that after collecting/ordering of all the explicitly specified // packages and their dependencies for the build we also collect/order their @@ -836,10 +839,11 @@ namespace bpkg // build_package::constraint_type constraint; - // Available package version which satisfies the above constraint. + // Optional available package version which satisfies the above + // constraint. // - version available_version; - bool available_system; + optional<version> available_version; + bool available_system; }; struct ignored_constraint @@ -884,6 +888,9 @@ namespace bpkg vector<unsatisfied_constraint>&& ucs = {}, vector<package_key>&& dc = {}); + void + add (unsatisfied_dependent&&); + // Try to find the dependent entry and return NULL if not found. // unsatisfied_dependent* @@ -1683,7 +1690,7 @@ namespace bpkg // constraints for the same package twice, printing "..." instead. Noop if // there are no constraints for this package. // - // Optionally, only print constraints from the selected or being built + // Optionally, only print constraints from the existing or being built // dependents (see build_package::constraint_type for details). // void @@ -1691,14 +1698,14 @@ namespace bpkg const build_package&, string& indent, std::set<package_key>& printed, - optional<bool> selected_dependent = nullopt) const; + optional<bool> existing_dependent = nullopt) const; void print_constraints (diag_record&, const package_key&, string& indent, std::set<package_key>& printed, - optional<bool> selected_dependent = nullopt) const; + optional<bool> existing_dependent = nullopt) const; // Verify that builds ordering is consistent across all the data // structures and the ordering expectations are fulfilled (real build |