aboutsummaryrefslogtreecommitdiff
path: root/bbot/worker/worker.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-10-11 21:12:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-10-22 11:02:04 +0300
commit642956288d5a6f59ebc45a7d1e6e47e1be131778 (patch)
tree6a98572e1fc480a08c65c9b36c55c2fa6d0a8a89 /bbot/worker/worker.cxx
parentd25db3fcd4e80045fcbd85f1ca529ec695fda45d (diff)
Reuse initial build target config's private host/build2 configs at test installed stage
Diffstat (limited to 'bbot/worker/worker.cxx')
-rw-r--r--bbot/worker/worker.cxx58
1 files changed, 56 insertions, 2 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx
index 7ad9e30..69a0f28 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -61,8 +61,10 @@ namespace bbot
const size_t tftp_get_timeout (10); // 10 seconds.
const size_t tftp_get_retries (3); // Task request retries (see startup()).
- const dir_path bpkg_dir (".bpkg");
- const dir_path repos_dir (dir_path (bpkg_dir) /= "repos");
+ const dir_path bpkg_dir (".bpkg");
+ const dir_path repos_dir (dir_path (bpkg_dir) /= "repos");
+ const dir_path host_dir (dir_path (bpkg_dir) /= "host");
+ const dir_path build2_dir (dir_path (bpkg_dir) /= "build2");
}
static bool
@@ -4962,6 +4964,11 @@ build (size_t argc, const char* argv[])
//
if (has_runtime_tests || has_buildtime_tests)
{
+ // Stash the absolute path of the initial build target
+ // configuration.
+ //
+ const dir_path& init_target_conf (target_conf);
+
// Create the required build configurations.
//
dir_path target_conf ("build-installed-bpkg");
@@ -5165,6 +5172,53 @@ build (size_t argc, const char* argv[])
if (!r.status)
break;
}
+
+ // If for the target package the initial build target
+ // configuration contains the private host and/or module
+ // configurations, then it may mean that the external
+ // (runtime) tests for this package use some tools and/or
+ // modules. Not to rebuild them again for the test install
+ // case, we will just link these private configurations to the
+ // installed test target configuration. This way the external
+ // tests, built and executed against the installed main
+ // package, can reuse the already built tools and/or modules.
+ //
+ if (target_pkg)
+ {
+ dir_path hc (init_target_conf / host_dir);
+
+ if (exists (hc))
+ {
+ r.status |= run_bpkg (
+ b,
+ trace, r.log, wre,
+ bkp_step, bkp_status, aux_env, last_cmd,
+ "-v",
+ "link",
+ "-d", target_conf,
+ hc);
+
+ if (!r.status)
+ break;
+ }
+
+ dir_path mc (init_target_conf / build2_dir);
+
+ if (exists (mc))
+ {
+ r.status |= run_bpkg (
+ b,
+ trace, r.log, wre,
+ bkp_step, bkp_status, aux_env, last_cmd,
+ "-v",
+ "link",
+ "-d", target_conf,
+ mc);
+
+ if (!r.status)
+ break;
+ }
+ }
}
if (create_host)