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 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'bbot') 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. -- cgit v1.1