From b61e0de250d522ec9a8e16146ef979a65c181db1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 20 Jul 2023 07:44:36 +0200 Subject: Change inner rule/prerequisites match order in install::file_rule The old order messed up the for-install signaling logic. See the long comment in install::file_rule::apply_impl() for background and details. --- libbuild2/bash/rule.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libbuild2/bash/rule.cxx') diff --git a/libbuild2/bash/rule.cxx b/libbuild2/bash/rule.cxx index 29c6a2a..502a206 100644 --- a/libbuild2/bash/rule.cxx +++ b/libbuild2/bash/rule.cxx @@ -63,10 +63,12 @@ namespace build2 // in_rule // bool in_rule:: - match (action a, target& t, const string& hint, match_extra&) const + match (action a, target& xt, const string& hint, match_extra&) const { tracer trace ("bash::in_rule::match"); + file& t (xt.as ()); // Only registered for exe{} and bash{}. + // Note that for bash{} and for exe{} with hint we match even if the // target does not depend on any modules (while it could have been // handled by the in module, that would require loading it). @@ -89,6 +91,12 @@ namespace build2 l4 ([&]{trace << "no bash module prerequisite or hint for target " << t;}); + // If we match, derive the file name early as recommended by the in + // rule. + // + if (fi && fm) + t.derive_path (); + return fi && fm; } -- cgit v1.1