From 77bef9b64857b1d2ae96dafc2f531cadb374f561 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Sep 2023 09:03:44 +0200 Subject: Fix issue with fallback rule priority in dist module While at it, also remove workarounds for the same issue in the config and test modules. --- libbuild2/test/init.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'libbuild2/test') diff --git a/libbuild2/test/init.cxx b/libbuild2/test/init.cxx index b7cf25f..32548f4 100644 --- a/libbuild2/test/init.cxx +++ b/libbuild2/test/init.cxx @@ -23,6 +23,8 @@ namespace build2 { namespace test { + static const file_rule file_rule_ (true /* check_type */); + void boot (scope& rs, const location&, module_boot_extra& extra) { @@ -300,18 +302,18 @@ namespace build2 { default_rule& dr (m); - // Note: register for mtime_target to take priority over the fallback - // rule below. - // - rs.insert_rule (perform_test_id, "test", dr); - rs.insert_rule (perform_test_id, "test", dr); - rs.insert_rule (perform_test_id, "test", dr); + rs.insert_rule (perform_test_id, "test", dr); + rs.insert_rule (perform_test_id, "test", dr); // Register the fallback file rule for the update-for-test operation, // similar to update. // - rs.global_scope ().insert_rule ( - perform_test_id, "test.file", file_rule::instance); + // Note: use target instead of anything more specific (such as + // mtime_target) in order not to take precedence over the "test" rule + // above. + // + rs.global_scope ().insert_rule ( + perform_test_id, "test.file", file_rule_); } return true; -- cgit v1.1