From ff07b9a24212fd8cb92504f51b650afd52d7d408 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 21 Jun 2024 14:23:42 +0300 Subject: Fail instead of aborting on src and out directories naming scheme mismatch (GH issue #394) --- build2/b.cxx | 5 +++-- libbuild2/file.cxx | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build2/b.cxx b/build2/b.cxx index 8decadf..9ffb6d1 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -1096,8 +1096,9 @@ main (int argc, char* argv[]) if (!altn) altn = rs.root_extra->altn; - else - assert (*altn == rs.root_extra->altn); + else if (*altn != rs.root_extra->altn) + fail << "naming scheme mismatch for " << out_root << " and " + << rs.src_path (); } // At this stage we should have both roots and out_base figured diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx index 18147a2..ecb5f80 100644 --- a/libbuild2/file.cxx +++ b/libbuild2/file.cxx @@ -759,8 +759,9 @@ namespace build2 { if (!altn) altn = s.root_extra->altn; - else - assert (*altn == s.root_extra->altn); + else if (*altn != s.root_extra->altn) + fail << "naming scheme mismatch for " << out_root << " and " + << s.src_path (); if (s.root_extra->project) { -- cgit v1.1