From 60c5bf36100ccc15421a87f4b566849d2468d396 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 28 Sep 2020 21:40:59 +0300 Subject: Run build2 dist meta-operation in pkg-checkout with '--no-external-modules !config.dist.bootstrap=true' --- bpkg/pkg-build.cxx | 10 ++++++---- bpkg/pkg-checkout.cxx | 22 ++++++++-------------- tests/pkg-checkout.testscript | 20 ++++++++++---------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index 3ef513a..111c226 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -4389,10 +4389,12 @@ namespace bpkg // // We are also going to combine purge and fetch/unpack|checkout into a // single step and use the replace mode so it will become just - // fetch/unpack|checkout. Configure will also be combined with the above - // operations to guarantee that prerequisite packages are configured by - // the time its dependents need to be checked out (see the pkg_checkout() - // function implementation for details). + // fetch/unpack|checkout. Configure is also combined with the above + // operations, since previously we had to guarantee that prerequisite + // packages are configured by the time its dependents need to be checked + // out. Now, when we start using the bootstrap dist for pkg-checkout + // that's not a requirement anymore. We, however, still keep it this way + // since there is no reason why not to. // // We also have the dependent packages that we reconfigure because their // prerequsites got upgraded/downgraded and that the user may want to in diff --git a/bpkg/pkg-checkout.cxx b/bpkg/pkg-checkout.cxx index 05875a4..9be09c8 100644 --- a/bpkg/pkg-checkout.cxx +++ b/bpkg/pkg-checkout.cxx @@ -219,18 +219,6 @@ namespace bpkg // dir_path pd (td / path_cast (pl->location)); - // Verify the package prerequisites are all configured since the dist - // meta-operation generally requires all imports to be resolvable. - // - package_manifest m (pkg_verify (pd, - true /* ignore_unknown */, - [&ap] (version& v) {v = ap->version;})); - - pkg_configure_prerequisites (o, - t, - convert (move (m.dependencies)), - m.name); - // Form the buildspec. // string bspec ("dist('"); @@ -245,7 +233,11 @@ namespace bpkg // Distribute. // - // Note that on failure the package stays in the existing (working) + // Note that we are using the bootstrap distribution mode (and also skip + // bootstrapping external modules) to make sure a package can be checked + // out without its dependencies being present. + // + // Note also that on failure the package stays in the existing (working) // state. // // At first it may seem we have a problem: an existing package with the @@ -264,7 +256,9 @@ namespace bpkg run_b (o, verb_b::progress, - strings ({"config.dist.root='" + c.representation () + "'"}), + "--no-external-modules", + "!config.dist.bootstrap=true", + "config.dist.root='" + c.representation () + "'", bspec); // Revert the fix-ups. diff --git a/tests/pkg-checkout.testscript b/tests/pkg-checkout.testscript index 398080e..9fc1e64 100644 --- a/tests/pkg-checkout.testscript +++ b/tests/pkg-checkout.testscript @@ -54,12 +54,14 @@ else $rep_add "$rep/libbar.git#master"; $rep_fetch; - $* libmbar/1.0.0 2>>~%EOE% != 0 + $* libmbar/1.0.0 2>>~%EOE%; + checking out libmbar/1.0.0 %.+ - error: no configured package satisfies dependency on style-basic >= 1.0.0 - warning: repository state is now broken - info: run 'bpkg rep-fetch' to repair + distributing libmbar/1.0.0 + checked out libmbar/1.0.0 EOE + + $pkg_purge libmbar } : configured-dependency @@ -177,13 +179,13 @@ else $rep_fetch "$rep/links.git#v1.0.1"; if $posix - $* links/1.0.1 2>>~%EOE% + $* links/1.0.1 2>>~%EOE% != 0 checking out links/1.0.1 distributing links/1.0.1 - checked out links/1.0.1 + %error: unable to stat .+% + warning: repository state is now broken + info: run 'bpkg rep-fetch' to repair EOE - - $pkg_purge links else $* links/1.0.1 2>>~%EOE% != 0 checking out links/1.0.1 @@ -200,8 +202,6 @@ else $rep_fetch "$rep/links.git#v1.0.2" 2>>~%EOE% != 0 %.* %error: unable to iterate over .+% - warning: repository state is now broken and will be cleaned up - info: run 'bpkg rep-fetch' to update EOE else $rep_fetch "$rep/links.git#v1.0.2" -- cgit v1.1