aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-11-23 13:42:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-11-23 13:42:52 +0200
commitfbb1fc469da566dd21be47a7998dfad11d3085b7 (patch)
treea648f79125af89c86c9d9efa411624c816904baf /libbuild2/rule.hxx
parentc6b1d1dd870b3370d0a09fb4600e3a6b03326f35 (diff)
Take into account ad hoc recipes in rule::sub_match() (fixed GH issue #227)
Diffstat (limited to 'libbuild2/rule.hxx')
-rw-r--r--libbuild2/rule.hxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx
index da069ef..913c597 100644
--- a/libbuild2/rule.hxx
+++ b/libbuild2/rule.hxx
@@ -22,7 +22,8 @@ namespace build2
// you need to modify some state (e.g., counters or some such), then make
// sure things are MT-safe.
//
- // Note: match() is only called once but may not be followed by apply().
+ // Note: match() could be called multiple times (so should be idempotent)
+ // and it may not be followed by apply().
//
// The hint argument is the rule hint, if any, that was used to select this
// rule. While normally not factored into the match decision, a rule may
@@ -72,10 +73,11 @@ namespace build2
// only if our update rule also matches.
//
// Arranging this, however, is not a simple matter of calling the other
- // rule's match(): we also have to take into account the rule hints for
- // that operation. This helper performs all the necessary steps. Note:
- // should only be called from match() (see target::find_hint() for
- // details).
+ // rule's match(): we also have to take into account ad hoc recipes and
+ // rule hints for that operation. This helper performs all the necessary
+ // checks. Note: should only be called from match() (see
+ // target::find_hint() for details). Note also that ad hoc recipes are
+ // checked for hint_op, not action's operation.
//
bool
sub_match (const string& rule_name, operation_id hint_op,