diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-04-04 14:46:54 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2023-04-04 14:46:54 +0300 |
commit | ab8a3a6c226e047afeda08423ff5d8873631314d (patch) | |
tree | 58612bfbfbb0aafabfcc39af3f21e34b905e6910 /bbot | |
parent | 8c54405d78b87b8756106eceec0a53ef0225d05e (diff) |
Configure system dependencies from build package configuration globally in worker
Diffstat (limited to 'bbot')
-rw-r--r-- | bbot/worker/worker.cxx | 80 |
1 files changed, 62 insertions, 18 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index f1e5e8c..3367aaa 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -1109,20 +1109,23 @@ build (size_t argc, const char* argv[]) // If the package configuration is specified, then parse it into the // prefixed global options and configuration variables map, unprefixed // global options list, the main package-specific configuration variables - // list, and the dependency packages list, potentially with their own - // configuration variables (but not options). The prefixed arguments are - // added to the command lines at the corresponding steps after potential - // environment and target configuration arguments. Unprefixed arguments - // are added to the bpkg-pkg-build command line at the - // bpkg.configure.build step. Specifically, the unprefixed global options - // are specified after all the prefixed global options and the unprefixed - // variables are specified for the main package only, wherever it is - // configured. + // list, the main package-specific dependency packages list (only + // configured where the main package is configured), potentially with + // their own configuration variables (but not options), and the global + // system dependency packages list (configured in all configurations). The + // prefixed arguments are added to the command lines at the corresponding + // steps after potential environment and target configuration arguments. + // Unprefixed arguments are added to the bpkg-pkg-build command line at + // the bpkg.configure.build step. Specifically, the unprefixed global + // options are specified after all the prefixed global options and the + // unprefixed variables are specified for the main package only, wherever + // it is configured. // std::multimap<string, string> pkg_args; strings pkg_config_opts; strings pkg_config_vars; - vector<pair<string, strings>> pkg_config_deps; + vector<pair<string, strings>> pkg_config_main_deps; // ?<pkg>, sys:<pkg> + vector<pair<string, strings>> pkg_config_glob_deps; // ?sys:<pkg> if (!tm.package_config.empty ()) { @@ -1251,7 +1254,35 @@ build (size_t argc, const char* argv[]) vars.push_back (move (da)); } - pkg_config_deps.push_back (make_pair (move (a), move (vars))); + // Add the system dependency packages (prefixed with `?sys:`) to + // a separate list, to specify them globally on the + // bpkg-pkg-build command line for configuring them in all the + // (being) created configurations. + // + // Note, though, that we will handle the build-to-hold system + // packages (prefixed with `sys:`) in the same way as non system + // dependencies, since such an auto-configuration is only + // supported by bpkg-pkg-build for system dependencies. In the + // future, we may support that on the bbot worker level by, for + // example, specifying all the configurations manually for the + // build-to-hold system packages and also specifying them as a + // system dependencies globally. We need to be careful to make + // sure that these dependencies are also auto-configured for the + // private configurations potentially created by bpkg-pkg-build. + // + // Also note that in the future we may allow dependency-specific + // --config-uuid options to only configure such dependencies in + // the specified configurations. We may also invent the special + // 00000000-0000-0000-0000-000000000005 configuration id to, for + // example, only configure them at the + // bpkg.test-separate-installed.configure.build step. + // + if (a.compare (0, 5, "?sys:") != 0) + pkg_config_main_deps.push_back (make_pair (move (a), + move (vars))); + else + pkg_config_glob_deps.push_back (make_pair (move (a), + move (vars))); } } else @@ -2276,8 +2307,9 @@ build (size_t argc, const char* argv[]) // -- // { <pkg-config-vars>|config.<pkg-name>.develop=false }+ <pkg> // { config.<runtime-test-name>.develop=false }+ <runtime-test>... - // { <dep-config-vars> }+ <dep>... - // <dep>... + // { <dep-config-vars> }+ <main-dep>... + // <main-dep>... + // <glob-dep>... // step_id s (step_id::bpkg_target_configure_build); step_id f1 (step_id::b_configure); @@ -2335,7 +2367,7 @@ build (size_t argc, const char* argv[]) // Add the main package dependencies. // - for (const pair<string, strings>& d: pkg_config_deps) + for (const pair<string, strings>& d: pkg_config_main_deps) { if (!d.second.empty ()) { @@ -2376,8 +2408,9 @@ build (size_t argc, const char* argv[]) // <pkg-config-args> // config.<buildtime-test-name>.develop=false }+ <buildtime-test>... // - // { <build-config> <install-config> <dep-config-vars> }+ <dep>... - // { <build-config> <install-config> }+ { <dep>... } + // { <build-config> <install-config> <dep-config-vars> }+ <main-dep>... + // { <build-config> <install-config> }+ { <main-dep>... } + // <glob-dep>... // // Main package configuration name. @@ -2615,7 +2648,7 @@ build (size_t argc, const char* argv[]) // specified and count the number of others. // size_t no_vars (0); - for (const pair<string, strings>& d: pkg_config_deps) + for (const pair<string, strings>& d: pkg_config_main_deps) { if (!d.second.empty ()) { @@ -2660,7 +2693,7 @@ build (size_t argc, const char* argv[]) if (no_vars != 1) pkgs.push_back ("{"); - for (const pair<string, strings>& d: pkg_config_deps) + for (const pair<string, strings>& d: pkg_config_main_deps) { if (d.second.empty ()) pkgs.push_back (d.first); @@ -2672,6 +2705,11 @@ build (size_t argc, const char* argv[]) } } + // Add the global system dependencies. + // + for (const pair<string, strings>& d: pkg_config_glob_deps) + pkgs.push_back (d.first); + // Finally, configure all the packages. // { @@ -3729,6 +3767,7 @@ build (size_t argc, const char* argv[]) // { <config> }+ { <runtime-test>... } // <buildtime-test>... // ?sys:<pkg> + // <glob-dep>... // strings pkgs; @@ -3776,6 +3815,11 @@ build (size_t argc, const char* argv[]) pkgs.push_back ("?sys:" + pkg_rev); + // Add the global system dependencies. + // + for (const pair<string, strings>& d: pkg_config_glob_deps) + pkgs.push_back (d.first); + // Finally, configure all the test packages. // { |