From 9ff442fc32887d2b8f2d19329fb9f12e723b9de7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Jun 2022 10:05:18 +0200 Subject: Redo outdated src-root.build handling by suppressing subprojects discovery --- bpkg/package-skeleton.cxx | 20 ++++++++++---------- bpkg/utility.cxx | 4 ---- bpkg/utility.hxx | 4 ---- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/bpkg/package-skeleton.cxx b/bpkg/package-skeleton.cxx index f202a5f..36fd82b 100644 --- a/bpkg/package-skeleton.cxx +++ b/bpkg/package-skeleton.cxx @@ -2982,19 +2982,14 @@ namespace bpkg else { // If the package directory was moved, then it's possible we will have - // bootstrap.build with an old src_root value. Presumably this will + // src-root.build with an old src_root value. Presumably this will // cause the package to be re-configured and so ignoring the old value - // here should be ok. Also let's remove the outdated bootstrap.build - // in this case, so it doesn't affect us down the road. + // here should be ok. Note that the outdated src-root.build can also + // mess up subproject discovery in create_bootstrap_outer() but we + // omit that part. // if (cast (v) != src_root) - { v = src_root; - - assert (altn); // Since bootstrap.build has been found. - - rm (out_root / (*altn ? alt_src_root_file : std_src_root_file)); - } } setup_root (rs, false /* forwarded */); @@ -3004,7 +2999,12 @@ namespace bpkg skl.db_->config.relative (out_root) /* amalgamation */, false /* subprojects */); - create_bootstrap_outer (rs); + + // Omit discovering amalgamation's subprojects (i.e., all the packages + // in the configuration). Besides being a performance optimization, this + // also sidesteps the issue of outdated src-root.build (see above). + // + create_bootstrap_outer (rs, false /* subprojects */); bootstrap_post (rs); assert (mif.meta_operation_pre == nullptr); diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx index 651b5c0..d229205 100644 --- a/bpkg/utility.cxx +++ b/bpkg/utility.cxx @@ -29,14 +29,10 @@ namespace bpkg const dir_path std_build_dir ("build"); const path std_bootstrap_file (dir_path (std_build_dir) /= "bootstrap.build"); const path std_root_file (dir_path (std_build_dir) /= "root.build"); - const dir_path std_bootstrap_dir (dir_path (std_build_dir) /= "bootstrap"); - const path std_src_root_file (std_bootstrap_dir / "src-root.build"); const dir_path alt_build_dir ("build2"); const path alt_bootstrap_file (dir_path (alt_build_dir) /= "bootstrap.build2"); const path alt_root_file (dir_path (alt_build_dir) /= "root.build2"); - const dir_path alt_bootstrap_dir (dir_path (alt_build_dir) /= "bootstrap"); - const path alt_src_root_file (alt_bootstrap_dir / "src-root.build2"); const dir_path current_dir ("."); diff --git a/bpkg/utility.hxx b/bpkg/utility.hxx index 34bda27..597800c 100644 --- a/bpkg/utility.hxx +++ b/bpkg/utility.hxx @@ -88,14 +88,10 @@ namespace bpkg extern const dir_path std_build_dir; // build/ extern const path std_bootstrap_file; // build/bootstrap.build extern const path std_root_file; // build/root.build - extern const dir_path std_bootstrap_dir; // build/bootstrap - extern const path std_src_root_file; // build/bootstrap/src-root.build extern const dir_path alt_build_dir; // build2/ extern const path alt_bootstrap_file; // build2/bootstrap.build2 extern const path alt_root_file; // build2/root.build2 - extern const dir_path alt_bootstrap_dir; // build2/bootstrap - extern const path alt_src_root_file; // build2/bootstrap/src-root.build2 extern const dir_path current_dir; // ./ -- cgit v1.1