From 2c39ac617baeef96882efc3c4d0babeb5d74a7d2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 22 Jan 2024 22:39:11 +0300 Subject: Fix bbot worker not to perform pkg.install, bpkg.bindist.*, etc steps for non-installable packages (GH issue #334) --- bbot/worker/worker.cxx | 29 ++++++++++++++++++++++++----- doc/manual.cli | 44 ++++++++++++++++++++++++++++---------------- tests/integration/testscript | 15 ++++++++++++++- 3 files changed, 66 insertions(+), 22 deletions(-) diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 8c22796..70c0f0b 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -2150,6 +2150,12 @@ build (size_t argc, const char* argv[]) // If present, indicates that the install, test installed, and uninstall // operations need to be tested. // + // Note that the main package may not support the install operation. We, + // however, can only detect that after the package is configured. If + // that's the case, we will disable the steps which may not be performed + // for such a package (bpkg.install, bpkg.bindist.*, etc) later, after the + // package is configured. + // optional install_root; // While building and running tests against the installation created @@ -3506,6 +3512,24 @@ build (size_t argc, const char* argv[]) rm.status |= r.status; } + b_project_info prj ( + prj_info (pkg_dir, + b_info_flags::ext_mods | b_info_flags::subprojects, + "project")); + + // If the package turned out to be non-installable, then disable all the + // steps which may not be performed for such a package. + // + if (find (prj.operations.begin (), + prj.operations.end (), + "install") == prj.operations.end ()) + { + install_root = nullopt; + bindist = nullopt; + sys_install = false; + bindist_upload = false; + } + // Re-distribute if comes from a version control-based repository, // update, and test external test packages in the bpkg configuration in // the current working directory. Optionally pass the config.import.* @@ -3657,11 +3681,6 @@ build (size_t argc, const char* argv[]) // Test the main package. // - b_project_info prj ( - prj_info (pkg_dir, - b_info_flags::ext_mods | b_info_flags::subprojects, - "project")); - // Run the internal tests if the test operation is supported by the // project but only for the target package or if the configuration is // self-hosted. diff --git a/doc/manual.cli b/doc/manual.cli index c584b2c..41f0eeb 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -1094,7 +1094,8 @@ bpkg -v update bpkg -v test } -# If config.install.root is specified and no +# If the install operation is supported by the package, +# config.install.root is specified, and no # bpkg.bindist.{debian,fedora,archive} step is enabled: # { @@ -1111,7 +1112,8 @@ bpkg -v update } } -# If bpkg.bindist.{debian,fedora,archive} step is enabled: +# If the install operation is supported by the package and +# bpkg.bindist.{debian,fedora,archive} step is enabled: # { # bpkg.bindist.{debian,fedora,archive} @@ -1121,7 +1123,8 @@ bpkg -v update } -# If bbot.sys-install step is enabled: +# If the install operation is supported by the package and +# bbot.sys-install step is enabled: # { # If is 'debian': @@ -1274,7 +1277,8 @@ bpkg -v update bpkg -v uninstall } -# If bbot.bindist.upload step is enabled: +# If the install operation is supported by the package and +# bbot.bindist.upload step is enabled: # { # Move the generated binary distribution files to the @@ -1470,8 +1474,9 @@ bpkg -v update -d bpkg -v test -d } -# If configuration is self-hosted, config.install.root is specified, -# and no bpkg.bindist.{debian,fedora,archive} step is enabled: +# If configuration is self-hosted, the install operation is supported +# by the package, config.install.root is specified, and no +# bpkg.bindist.{debian,fedora,archive} step is enabled: # { # bpkg.install @@ -1487,8 +1492,9 @@ bpkg -v update -d } } -# If configuration is self-hosted and -# bpkg.bindist.{debian,fedora,archive} step is enabled: +# If configuration is self-hosted, the install operation is supported +# by the package, and bpkg.bindist.{debian,fedora,archive} step is +# enabled: # { # bpkg.bindist.{debian,fedora,archive} @@ -1498,7 +1504,8 @@ bpkg -v update -d } -# If bbot.sys-install step is enabled: +# If the install operation is supported by the package and +# bbot.sys-install step is enabled: # { # If is 'debian': @@ -1698,7 +1705,8 @@ bpkg -v update -d bpkg -v uninstall -d } -# If bbot.bindist.upload step is enabled: +# If the install operation is supported by the package and +# bbot.bindist.upload step is enabled: # { # Move the generated binary distribution files to the @@ -1866,8 +1874,9 @@ bpkg -v update -d bpkg -v test -d } -# If configuration is self-hosted, config.install.root is specified, -# and no bpkg.bindist.{debian,fedora,archive} step is enabled: +# If configuration is self-hosted, the install operation is supported +# by the package, config.install.root is specified, and no +# bpkg.bindist.{debian,fedora,archive} step is enabled: # { # bpkg.install @@ -1883,8 +1892,9 @@ bpkg -v update -d } } -# If configuration is self-hosted and -# bpkg.bindist.{debian,fedora,archive} step is enabled: +# If configuration is self-hosted, the install operation is supported +# by the package, and bpkg.bindist.{debian,fedora,archive} step is +# enabled: # { # bpkg.bindist.{debian,fedora,archive} @@ -1894,7 +1904,8 @@ bpkg -v update -d } -# If bbot.sys-install step is enabled: +# If the install operation is supported by the package and +# bbot.sys-install step is enabled: # { # If is 'debian': @@ -2046,7 +2057,8 @@ bpkg -v update -d bpkg -v uninstall -d } -# If bbot.bindist.upload step is enabled: +# If the install operation is supported by the package and +# bbot.bindist.upload step is enabled: # { # Move the generated binary distribution files to the diff --git a/tests/integration/testscript b/tests/integration/testscript index a8932ec..8af2174 100644 --- a/tests/integration/testscript +++ b/tests/integration/testscript @@ -255,7 +255,7 @@ config.bpkg.tests.remote=true #\ pkg = cli -ver = 1.2.0-b.10.20230822134113.24d21424af96 +ver = 1.2.0 rep_url = "https://git.codesynthesis.com/cli/cli.git#master" rep_type = git #rep_url = https://stage.build2.org/1 @@ -406,6 +406,19 @@ rep_type = git rfp = yes #\ +#\ +pkg = odb-tests +ver = 2.5.0-b.26.20240122073830.3e1714e9aa78 +rep_url = "https://git.codesynthesis.com/var/scm/odb/odb-tests.git#master" +rep_type = git +rfp = yes + +package_config = 'package-config: +\ +config.odb_tests.database=sqlite +\' +#\ + #interactive="interactive: b.test-installed.configure" #interactive="interactive: warning" -- cgit v1.1