From 549d8783022f31c4792fa2d2071a75910a41cc8e Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 26 Aug 2023 20:53:31 +0300 Subject: Disable in-place version replacement in pkg-build since sometimes it is applied erroneously --- bpkg/pkg-build-collect.cxx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'bpkg') diff --git a/bpkg/pkg-build-collect.cxx b/bpkg/pkg-build-collect.cxx index 30a9e90..2c89a1c 100644 --- a/bpkg/pkg-build-collect.cxx +++ b/bpkg/pkg-build-collect.cxx @@ -1384,9 +1384,21 @@ namespace bpkg // toolchain build-time dependencies since they should be quite // common. // + // An update: it turned out that just the absence of dependencies + // is not the only condition that causes a package to be replaced + // in place. It must also not participate in any configuration + // negotiation on the dependency side (otherwise we could have + // missed collecting its existing dependents). Also, we need to + // make sure that the package up/downgrade doesn't cause the + // selection of a different dependency alternative for any of its + // dependents (see postponed_packages for possible outcomes). This + // all sounds quite hairy at the moment, so we won't be replacing + // in place for now (which is an optimization). + // +#if 0 if (!has_dependencies (options, p2->available->dependencies)) scratch = false; - +#endif l5 ([&]{trace << p2->available_name_version_db () << " package version needs to be replaced " << (!scratch ? "in-place " : "") << "with " @@ -4456,7 +4468,7 @@ namespace bpkg } void build_packages:: - collect_drop (const pkg_build_options& options, + collect_drop (const pkg_build_options&, database& db, shared_ptr sp, replaced_versions& replaced_vers) @@ -4538,8 +4550,17 @@ namespace bpkg // toolchain build-time dependencies since they should be quite // common. // + // An update: it turned out that just absence of dependencies is not + // the only condition that causes a package to be dropped in place. It + // must also not participate in any configuration negotiation on the + // dependency side (otherwise it could have been added to a cluster as + // a dependency). This feels quite hairy at the moment, so we won't be + // dropping in place for now. + // +#if 0 if (!has_dependencies (options, bp.available->dependencies)) scratch = false; +#endif l5 ([&]{trace << bp.available_name_version_db () << " package version needs to be replaced " -- cgit v1.1