aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/in/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-07-20 07:44:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-07-20 07:44:36 +0200
commitb61e0de250d522ec9a8e16146ef979a65c181db1 (patch)
tree93cf8e451a5c605f9d0159c6474e77d47b6f2de4 /libbuild2/in/rule.cxx
parent7aabdc2ccfea23c93e3b94290df59708aa179104 (diff)
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.
Diffstat (limited to 'libbuild2/in/rule.cxx')
-rw-r--r--libbuild2/in/rule.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/libbuild2/in/rule.cxx b/libbuild2/in/rule.cxx
index 74bc2a7..31a9d94 100644
--- a/libbuild2/in/rule.cxx
+++ b/libbuild2/in/rule.cxx
@@ -47,6 +47,13 @@ namespace build2
if (!fi)
l5 ([&]{trace << "no in file prerequisite for target " << t;});
+ // If we match, derive the file name here instead of in apply() to make
+ // it available early for the in{} prerequisite search (see
+ // install::file_rule::apply_impl() for background).
+ //
+ if (fi)
+ t.derive_path ();
+
return fi;
}
@@ -55,9 +62,9 @@ namespace build2
{
file& t (xt.as<file> ());
- // Derive the file name.
+ // Make sure derived rules assign the path in match().
//
- t.derive_path ();
+ assert (!t.path ().empty ());
// Inject dependency on the output directory.
//