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/algorithm.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libbuild2/algorithm.cxx') diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx index 4db3d72..ad4c406 100644 --- a/libbuild2/algorithm.cxx +++ b/libbuild2/algorithm.cxx @@ -1265,6 +1265,20 @@ namespace build2 return ct.try_matched_state (a, false); } + void + match_only_sync (action a, const target& t) + { + assert (t.ctx.phase == run_phase::match); + + target_lock l (lock_impl (a, t, scheduler::work_none)); + + if (l.target != nullptr && l.offset < target::offset_matched) + { + if (match_impl (l, true /* step */).second == target_state::failed) + throw failed (); + } + } + // Note: lock is a reference to avoid the stacking overhead. // static group_view -- cgit v1.1