From 5393589ec2d898a02c52adf9125a592d3d7ff829 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 26 May 2023 12:15:24 +0200 Subject: Disable counts verification if matched but not executed in resolve_members() --- libbuild2/operation.cxx | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'libbuild2/operation.cxx') diff --git a/libbuild2/operation.cxx b/libbuild2/operation.cxx index e57caa5..f199827 100644 --- a/libbuild2/operation.cxx +++ b/libbuild2/operation.cxx @@ -761,26 +761,42 @@ namespace build2 if (fail) throw failed (); - // We should have executed every target that we matched, provided we - // haven't failed (in which case we could have bailed out early). - // - assert (ctx.target_count.load (memory_order_relaxed) == 0); - #ifndef NDEBUG - if (ctx.dependency_count.load (memory_order_relaxed) != 0) + // For now we disable these checks if we've performed any group member + // resolutions that required a match (with apply()) but not execute. + // + if (ctx.resolve_count.load (memory_order_relaxed) == 0) { - diag_record dr; - dr << info << "detected unexecuted matched targets:"; + // We should have executed every target that we matched, provided we + // haven't failed (in which case we could have bailed out early). + // + assert (ctx.target_count.load (memory_order_relaxed) == 0); - for (const auto& pt: ctx.targets) + if (ctx.dependency_count.load (memory_order_relaxed) != 0) { - const target& t (*pt); - if (size_t n = t[a].dependents.load (memory_order_relaxed)) - dr << text << t << ' ' << n; + diag_record dr; + dr << info << "detected unexecuted matched targets:"; + + for (const auto& pt: ctx.targets) + { + const target& t (*pt); + + if (size_t n = t[a].dependents.load (memory_order_relaxed)) + dr << text << t << ' ' << n; + + if (a.outer ()) + { + action ia (a.inner_action ()); + + if (size_t n = t[ia].dependents.load (memory_order_relaxed)) + dr << text << t << ' ' << n; + } + } } + + assert (ctx.dependency_count.load (memory_order_relaxed) == 0); } #endif - assert (ctx.dependency_count.load (memory_order_relaxed) == 0); } const meta_operation_info mo_perform { -- cgit v1.1