aboutsummaryrefslogtreecommitdiff
path: root/bbot
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-06-28 17:55:03 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-06-29 12:43:00 +0300
commitef12ccd4a1ad02e9078f6ecd96a37706b85e5cc2 (patch)
tree8bf5412c01a3ce0d8be892b8ff068cb215c594c5 /bbot
parent6f020aaefacd43706f80829ee77ba2ee26dcbf4b (diff)
Add config.<pkg>.develop=false variable to configuration of main and external test packages in worker
Diffstat (limited to 'bbot')
-rw-r--r--bbot/worker/worker.cxx120
1 files changed, 107 insertions, 13 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx
index ce62ae9..234e804 100644
--- a/bbot/worker/worker.cxx
+++ b/bbot/worker/worker.cxx
@@ -789,7 +789,7 @@ upload_manifest (tracer& trace,
}
}
-static const string worker_checksum ("2"); // Logic version.
+static const string worker_checksum ("3"); // Logic version.
static int bbot::
build (size_t argc, const char* argv[])
@@ -1099,6 +1099,7 @@ build (size_t argc, const char* argv[])
const version& ver (tm.version);
const string repo (tm.repository.string ());
const dir_path pkg_dir (pkg + '-' + ver.string ());
+ const string pkg_var (tm.name.variable ());
// Specify the revision explicitly for the bpkg-build command not to end
// up with a race condition building the latest revision rather than the
@@ -1427,7 +1428,7 @@ build (size_t argc, const char* argv[])
optional<string> bootstrap_import;
if (bootstrap)
- bootstrap_import = "!config.import." + tm.name.variable () + "=" +
+ bootstrap_import = "!config.import." + pkg_var + "=" +
(rwd / main_pkg_conf).string ();
// Configure.
@@ -1934,6 +1935,11 @@ build (size_t argc, const char* argv[])
//
// First, prepare the common and package arguments.
//
+ // Add the config.<pkg>.develop=false variables for the main and
+ // external test packages to trigger their package skeleton creation and
+ // loading. This way we make sure that these packages can be used as
+ // dependencies of dependents with configuration clauses.
+ //
strings common_args;
strings pkg_args;
@@ -1942,7 +1948,8 @@ build (size_t argc, const char* argv[])
// The overall command looks like this:
//
// bpkg build --configure-only <env-config-args> <config-args> --
- // <pkg> <runtime-test>...
+ // { config.<pkg-name>.develop=false }+ <pkg>
+ // { config.<runtime-test-name>.develop=false }+ <runtime-test>...
//
step_id s (step_id::bpkg_target_configure_build);
step_id f1 (step_id::b_configure);
@@ -1957,22 +1964,43 @@ build (size_t argc, const char* argv[])
common_args.insert (common_args.end (), eas.begin (), eas.end ());
common_args.insert (common_args.end (), cas.begin (), cas.end ());
+ // @@ config.<pkg>.develop=false
+ //
+#if 1
+ pkg_args.push_back ("{");
+ pkg_args.push_back ("config." + pkg_var + ".develop=false");
+ pkg_args.push_back ("}+");
+#endif
+
pkg_args.push_back (pkg_rev);
- // Add test dependency package constraints (for example 'bar > 1.0.0').
- //
- for (auto t: runtime_tests)
+ for (const auto& t: runtime_tests)
+ {
+ // @@ config.<pkg>.develop=false
+ //
+#if 1
+ pkg_args.push_back ("{");
+ pkg_args.push_back ("config." +
+ t.name.variable () +
+ ".develop=false");
+ pkg_args.push_back ("}+");
+#endif
+
+ // Add test dependency package constraints (for example
+ // 'bar > 1.0.0').
+ //
pkg_args.push_back (t.string ());
+ }
}
else
{
// The overall command looks like this (but some parts may be omitted):
//
// bpkg build --configure-only <env-config-args> <config-args> --
- // { <build-config> <env-config-args> <config-args> }+ <pkg>
- // { <build-config> <env-config-args> <config-args> }+ { <runtime-test>... }
+ // { <build-config> <env-config-args> <config-args> config.<pkg-name>.develop=false }+ <pkg>
+ // { <build-config> <env-config-args> <config-args> config.<runtime-test-name>.develop=false }+ <runtime-test>...
// { <install-config> <env-config-args> <config-args> }+ <pkg>
- // { <target-config> <env-config-args> <config-args> }+ { <buildtime-test>... }
+ // { <target-config> <env-config-args> <config-args> config.<buildtime-test-name>.develop=false }+ <buildtime-test>...
//
// Add the main package args.
@@ -2011,6 +2039,12 @@ build (size_t argc, const char* argv[])
pkg_args.insert (pkg_args.end (), eas.begin (), eas.end ());
pkg_args.insert (pkg_args.end (), cas.begin (), cas.end ());
+ // @@ config.<pkg>.develop=false
+ //
+#if 1
+ pkg_args.push_back ("config." + pkg_var + ".develop=false");
+#endif
+
pkg_args.push_back ("}+");
pkg_args.push_back (pkg_rev);
@@ -2018,6 +2052,34 @@ build (size_t argc, const char* argv[])
// Add the runtime test packages.
//
+ // @@ config.<pkg>.develop=false
+ //
+#if 1
+ for (const auto& t: runtime_tests)
+ {
+ pkg_args.push_back ("{");
+
+ pkg_args.push_back ("--config-uuid");
+ pkg_args.push_back (conf_uuid);
+
+ pkg_args.push_back ("--checkout-root");
+ pkg_args.push_back (dist_root.string ());
+
+ if (bootstrap_import)
+ pkg_args.push_back (*bootstrap_import);
+
+ pkg_args.insert (pkg_args.end (), eas.begin (), eas.end ());
+ pkg_args.insert (pkg_args.end (), cas.begin (), cas.end ());
+
+ pkg_args.push_back ("config." +
+ t.name.variable () +
+ ".develop=false");
+
+ pkg_args.push_back ("}+");
+
+ pkg_args.push_back (t.string ());
+ }
+#else
if (has_runtime_tests)
{
pkg_args.push_back ("{");
@@ -2042,12 +2104,13 @@ build (size_t argc, const char* argv[])
if (runtime_tests.size () != 1)
pkg_args.push_back ("{");
- for (auto t: runtime_tests)
+ for (const auto& t: runtime_tests)
pkg_args.push_back (t.string ());
if (runtime_tests.size () != 1)
pkg_args.push_back ("}");
}
+#endif
}
// Add the main package configured in the install configuration and
@@ -2090,6 +2153,36 @@ build (size_t argc, const char* argv[])
// Add the build-time test packages.
//
+ // @@ config.<pkg>.develop=false
+ //
+#if 1
+ for (const auto& t: buildtime_tests)
+ {
+ pkg_args.push_back ("{");
+
+ pkg_args.push_back ("--config-uuid");
+ pkg_args.push_back (target_uuid);
+
+ pkg_args.push_back ("--checkout-root");
+ pkg_args.push_back (dist_root.string ());
+
+ if (bootstrap_import)
+ pkg_args.push_back (*bootstrap_import);
+
+ pkg_args.insert (pkg_args.end (), eas.begin (), eas.end ());
+ pkg_args.insert (pkg_args.end (), cas.begin (), cas.end ());
+
+ pkg_args.push_back ("config." +
+ t.name.variable () +
+ ".develop=false");
+
+ pkg_args.push_back ("}+");
+
+ // Strip the build-time mark.
+ //
+ pkg_args.push_back (t.dependency::string ());
+ }
+#else
if (has_buildtime_tests)
{
pkg_args.push_back ("{");
@@ -2116,12 +2209,13 @@ build (size_t argc, const char* argv[])
// Strip the build-time mark.
//
- for (auto t: buildtime_tests)
+ for (const auto& t: buildtime_tests)
pkg_args.push_back (t.dependency::string ());
if (buildtime_tests.size () != 1)
pkg_args.push_back ("}");
}
+#endif
}
}
@@ -3056,7 +3150,7 @@ build (size_t argc, const char* argv[])
if (og && runtime_tests.size () != 1)
pkg_args.push_back ("{");
- for (auto t: runtime_tests)
+ for (const auto& t: runtime_tests)
pkg_args.push_back (t.string ());
if (og && runtime_tests.size () != 1)
@@ -3067,7 +3161,7 @@ build (size_t argc, const char* argv[])
{
// Strip the build-time mark.
//
- for (auto t: buildtime_tests)
+ for (const auto& t: buildtime_tests)
pkg_args.push_back (t.dependency::string ());
}