aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-01-22 22:39:11 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-01-23 17:51:10 +0300
commit2c39ac617baeef96882efc3c4d0babeb5d74a7d2 (patch)
tree6853e9c67761eef99f8816d777a354108524e17f
parent74f12cfbef994af3609b2ff4131997ffee02ce4a (diff)
Fix bbot worker not to perform pkg.install, bpkg.bindist.*, etc steps for non-installable packages (GH issue #334)
-rw-r--r--bbot/worker/worker.cxx29
-rw-r--r--doc/manual.cli44
-rw-r--r--tests/integration/testscript15
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<dir_path> 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 <package-name>
bpkg -v test <package-name>
}
-# 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 <package-name>
}
}
-# 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 <package-name>
<package-name>
}
-# If bbot.sys-install step is enabled:
+# If the install operation is supported by the package and
+# bbot.sys-install step is enabled:
#
{
# If <distribution> is 'debian':
@@ -1274,7 +1277,8 @@ bpkg -v update <package-name>
bpkg -v uninstall <package-name>
}
-# 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 <host-conf> <package-name>
bpkg -v test -d <target-conf> <package-name>
}
-# 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 <host-conf> <package-name>
}
}
-# 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 <host-conf> <package-name>
<package-name>
}
-# If bbot.sys-install step is enabled:
+# If the install operation is supported by the package and
+# bbot.sys-install step is enabled:
#
{
# If <distribution> is 'debian':
@@ -1698,7 +1705,8 @@ bpkg -v update -d <host-conf> <package-name>
bpkg -v uninstall -d <install-conf> <package-name>
}
-# 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 <module-conf> <package-name>
bpkg -v test -d <target-conf> <package-name>
}
-# 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 <module-conf> <package-name>
}
}
-# 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 <module-conf> <package-name>
<package-name>
}
-# If bbot.sys-install step is enabled:
+# If the install operation is supported by the package and
+# bbot.sys-install step is enabled:
#
{
# If <distribution> is 'debian':
@@ -2046,7 +2057,8 @@ bpkg -v update -d <module-conf> <package-name>
bpkg -v uninstall -d <install-conf> <package-name>
}
-# 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"