From e0ae9b1bebe4cab2e5d8e8e7a61b93632bd083cd Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Jun 2020 08:41:18 +0200 Subject: Add note on why not using rule-specific variables for ad hoc recipes --- libbuild2/build/script/script.hxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libbuild2/build') 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 -- cgit v1.1