From 65ce598d17a662b4c8b9a8df02b619549c5824c3 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 16 Sep 2022 08:39:05 +0200 Subject: Register fallback dist meta-operation rule for out of project targets The problematic scenario this fixes is an ad hoc pattern rule (which we register for dist in order to inject any additional sources; see parser.cxx for details) that pulls a tool imported from the system (say /usr/bin/xxd). --- libbuild2/dist/init.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libbuild2/dist/init.cxx') diff --git a/libbuild2/dist/init.cxx b/libbuild2/dist/init.cxx index dd8e25b..5e371bf 100644 --- a/libbuild2/dist/init.cxx +++ b/libbuild2/dist/init.cxx @@ -3,8 +3,9 @@ #include -#include #include +#include +#include #include #include @@ -209,6 +210,15 @@ namespace build2 rs.insert_rule (dist_id, 0, "dist", rule_); rs.insert_rule (dist_id, 0, "dist.alias", rule_); + // We need this rule for out-of-any-project dependencies (for example, + // executables imported from /usr/bin, etc). We are registering it on + // the global scope similar to builtin rules. + // + // See a similar rule in the config module. + // + rs.global_scope ().insert_rule ( + dist_id, 0, "dist.file", file_rule::instance); + // Configuration. // // Adjust module priority so that the config.dist.* values are saved at -- cgit v1.1