From b149a1a4b7bc404ddad53b9aad5f817b9b72bc8c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 14 Jun 2022 13:38:03 +0300 Subject: Always reconfigure dependencies in negotiated configuration clusters --- bpkg/pkg-build.cxx | 21 +++++++++++++++++++++ tests/pkg-build.testscript | 3 +++ 2 files changed, 24 insertions(+) diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index ffeeaf4..7a3c2f4 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -4646,6 +4646,13 @@ namespace bpkg build_package* b (entered_build (p)); assert (b != nullptr); + // Reconfigure the configured dependencies (see + // collect_build_postponed() for details). + // + if (b->selected != nullptr && + b->selected->state == package_state::configured) + b->flags |= build_package::adjust_reconfigure; + if (!b->recursive_collection) { l5 ([&]{trace << "collecting cfg-postponed dependency " @@ -6173,6 +6180,20 @@ namespace bpkg build_package* b (entered_build (p)); assert (b != nullptr); + // Reconfigure the configured dependencies. + // + // Note that potentially this can be an overkill if the dependency + // configuration doesn't really change. Later we can implement some + // precise detection for that using configuration checksum or + // similar. + // + // Also note that for configured dependents which belong to the + // configuration cluster this flag is already set (see above). + // + if (b->selected != nullptr && + b->selected->state == package_state::configured) + b->flags |= build_package::adjust_reconfigure; + // Skip the dependencies which are already collected recursively. // if (!b->recursive_collection) diff --git a/tests/pkg-build.testscript b/tests/pkg-build.testscript index a220ed1..81179a9 100644 --- a/tests/pkg-build.testscript +++ b/tests/pkg-build.testscript @@ -5283,6 +5283,7 @@ test.options += --no-progress trace: collect_build_postponed (1): cfg-negotiate end {foo | libfoo->{foo/1,1}}! trace: collect_build_postponed (1): end {foo | libfoo->{foo/1,1}} trace: collect_build_postponed (0): end + %.* trace: execute_plan: simulate: yes %.* EOE @@ -8783,6 +8784,7 @@ test.options += --no-progress trace: collect_build_postponed (2): end {tix | tex->{tix/2,1}} trace: collect_build_postponed (1): end {tix | libbar->{tix/1,1}} trace: collect_build_postponed (0): end + %.* trace: execute_plan: simulate: yes %.* EOE @@ -10877,6 +10879,7 @@ test.options += --no-progress trace: collect_build_postponed (2): end {dix | libbox->{dix/2,1}} trace: collect_build_postponed (1): end {dix | libbar->{dix/1,1}} trace: collect_build_postponed (0): end + %.* trace: execute_plan: simulate: yes %.* EOE -- cgit v1.1