aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-05-26 12:15:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-05-29 10:21:12 +0200
commit5393589ec2d898a02c52adf9125a592d3d7ff829 (patch)
treeff12d99d83f17b3c03332664c28d04527da412ec /libbuild2/operation.cxx
parentab91d32c1b23ea92b988d5618db2938a8c5dc63f (diff)
Disable counts verification if matched but not executed in resolve_members()
Diffstat (limited to 'libbuild2/operation.cxx')
-rw-r--r--libbuild2/operation.cxx42
1 files changed, 29 insertions, 13 deletions
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 {