diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-08 08:41:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-06-08 08:41:18 +0200 |
commit | e0ae9b1bebe4cab2e5d8e8e7a61b93632bd083cd (patch) | |
tree | 04f3d88f3216fd4f2d6028710a6851c21387886e /libbuild2/build | |
parent | 8e42d1ec329ac16ec5ae9692f18cdb0f2444d2fb (diff) |
Add note on why not using rule-specific variables for ad hoc recipes
Diffstat (limited to 'libbuild2/build')
-rw-r--r-- | libbuild2/build/script/script.hxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libbuild2/build/script/script.hxx b/libbuild2/build/script/script.hxx index fafc87e..f4d70ac 100644 --- a/libbuild2/build/script/script.hxx +++ b/libbuild2/build/script/script.hxx @@ -97,8 +97,13 @@ namespace build2 // Script-local variable pool and map. // - // Note that if we lookup the variable by passing name as a string, - // then it will be looked up in the wrong pool. + // Note that it may be tempting to reuse the rule-specific variables + // for this but they should no be modified during execution (i.e., + // they are for intra-rule communication; perhaps we could have a + // special builtin that sets such variables during match). + // + // Note also that if we lookup the variable by passing name as a + // string, then it will be looked up in the wrong pool. // variable_pool var_pool; variable_map vars; @@ -135,6 +140,9 @@ namespace build2 // Lookup the variable starting from this environment, then the // primary target, and then outer buildfile scopes. // + // Note that we currently skip rule-specific variables since the rule + // that runs this script doesn't set any. + // using lookup_type = build2::lookup; lookup_type |