From beeeb3ad5138de8dcc516dd11c2465a998fb8048 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 27 Jun 2022 13:14:56 +0300 Subject: Fix pkg-build to update re-evaluated dependents if requested --- bpkg/pkg-build.cxx | 21 +++++++++---- tests/pkg-build.testscript | 74 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 87 insertions(+), 8 deletions(-) diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index 331ab9d..17a4bcb 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -824,13 +824,17 @@ namespace bpkg // static const uint16_t build_repoint = 0x0004; + // Set if this build action is for re-evaluating of an existing dependent. + // + static const uint16_t build_reevaluate = 0x0008; + bool configure_only () const { assert (action); return configure_only_ || - (*action == build && (flags & build_repoint) != 0); + (*action == build && (flags & (build_repoint | build_reevaluate)) != 0); } // Return true if the resulting package will be configured as external. @@ -969,6 +973,11 @@ namespace bpkg assert ((flags & build_repoint) == 0 || (p.flags & build_repoint) == 0); + // We never merge two existing dependent re-evaluations. + // + assert ((flags & build_reevaluate) == 0 || + (p.flags & build_reevaluate) == 0); + // Copy the user-specified options/variables. // if (p.user_selection ()) @@ -1044,10 +1053,10 @@ namespace bpkg // flags |= p.flags; - // Upgrade repoint to the full build. + // Upgrade dependent repointments and re-evaluations to the full builds. // if (*action == build) - flags &= ~build_repoint; + flags &= ~(build_repoint | build_reevaluate); // Note that we don't copy the build_package::system flag. If it was // set from the command line ("strong system") then we will also have @@ -5802,7 +5811,8 @@ namespace bpkg set ( // Required by (dependency). ds.begin (), ds.end ()), false, // Required by dependents. - build_package::adjust_reconfigure}; + build_package::adjust_reconfigure | + build_package::build_reevaluate}; // Note: not recursive. // @@ -12157,7 +12167,8 @@ namespace bpkg if ((*p.action == build_package::adjust && p.reconfigure ()) || (*p.action == build_package::build && - (p.flags & build_package::build_repoint) != 0)) + (p.flags & (build_package::build_repoint | + build_package::build_reevaluate)) != 0)) upkgs.push_back (pkg_command_vars {db.config_orig, !multi_config () && db.main (), p.selected, diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index bf39949..0e9b2db 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -5603,7 +5603,23 @@ test.options += --no-progress build plan: downgrade libfoo/0.1.0 config.libfoo.extras=true (set by foo) - reconfigure/update foo/1.0.0 (dependent of libfoo) + reconfigure foo/1.0.0 (dependent of libfoo) + %.* + disfigured foo/1.0.0 + %.* + disfigured libfoo/1.0.0 + %.* + fetched libfoo/0.1.0 + %.* + unpacked libfoo/0.1.0 + %.* + configured libfoo/0.1.0 + %.* + configured foo/1.0.0 + %.* + updated libfoo/0.1.0 + %.* + updated foo/1.0.0 %.* EOE @@ -5650,7 +5666,19 @@ test.options += --no-progress build plan: reconfigure/update libfoo/0.1.0 config.libfoo.extras=true (user configuration) - reconfigure/update foo/1.0.0 (dependent of libfoo) + reconfigure foo/1.0.0 (dependent of libfoo) + %.* + disfigured foo/1.0.0 + %.* + disfigured libfoo/0.1.0 + %.* + configured libfoo/0.1.0 + %.* + configured foo/1.0.0 + %.* + updated libfoo/0.1.0 + %.* + updated foo/1.0.0 %.* EOE @@ -5717,6 +5745,20 @@ test.options += --no-progress upgrade libfoo/1.0.0 drop foo/1.0.0 (unused) %.* + disfigured foo/1.0.0 + %.* + disfigured libfoo/0.1.0 + %.* + fetched libfoo/1.0.0 + %.* + unpacked libfoo/1.0.0 + %.* + purged foo/1.0.0 + %.* + configured libfoo/1.0.0 + %.* + updated libfoo/1.0.0 + %.* EOE $pkg_status -r >>EOO; @@ -5915,7 +5957,33 @@ test.options += --no-progress config.libfoo.extras=true (set by tex) downgrade libbar/0.1.0 config.libbar.extras=true (set by tex) - reconfigure/update tex/1.0.0 (dependent of libbar) + reconfigure tex/1.0.0 (dependent of libbar) + %.* + disfigured tex/1.0.0 + %.* + disfigured libbar/1.0.0 + %.* + disfigured libfoo/1.0.0 + %.* + fetched libfoo/0.1.0 + %.* + unpacked libfoo/0.1.0 + %.* + fetched libbar/0.1.0 + %.* + unpacked libbar/0.1.0 + %.* + configured libfoo/0.1.0 + %.* + configured libbar/0.1.0 + %.* + configured tex/1.0.0 + %.* + updated libfoo/0.1.0 + %.* + updated libbar/0.1.0 + %.* + updated tex/1.0.0 %.* EOE -- cgit v1.1