From 7b7732096c0c4cb6f9f1c8e31a48417973748ff8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 11 Feb 2020 14:20:50 +0200 Subject: Instrument unassigned source path case in cc::compile_rule --- libbuild2/cc/compile-rule.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libbuild2/cc/compile-rule.cxx b/libbuild2/cc/compile-rule.cxx index b0fc40c..3b79b39 100644 --- a/libbuild2/cc/compile-rule.cxx +++ b/libbuild2/cc/compile-rule.cxx @@ -900,7 +900,18 @@ namespace build2 // { const path& p (src.path ()); - assert (!p.empty ()); // Sanity check. + + // We seem to have a race condition here but can't quite put our + // finger on it. + // + // assert (!p.empty ()); // Sanity check. + if (p.empty ()) + { + info << "unassigned path for target " << src << + info << "target state: " << src.matched_state (a, false) << + info << "is empty_path: " << (&p == &empty_path); + assert (false); + } if (dd.expect (p) != nullptr) l4 ([&]{trace << "source file mismatch forcing update of " << t;}); -- cgit v1.1