aboutsummaryrefslogtreecommitdiff
path: root/bbot
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 /bbot
parent74f12cfbef994af3609b2ff4131997ffee02ce4a (diff)
Fix bbot worker not to perform pkg.install, bpkg.bindist.*, etc steps for non-installable packages (GH issue #334)
Diffstat (limited to 'bbot')
-rw-r--r--bbot/worker/worker.cxx29
1 files changed, 24 insertions, 5 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.