diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-04-19 22:09:44 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2023-04-20 13:03:47 +0300 |
commit | 38943a2ecd79d2af18491a6c994c983aa5a35b97 (patch) | |
tree | cfd2fc967b9d9f8f92ae95c4ecb14a962849f61b | |
parent | c9b16fd386f1e6c81852f1f76cf1baeb954b731d (diff) |
Add support for package-specific config vars in package build config in worker
-rw-r--r-- | bbot/worker/worker.cxx | 470 | ||||
-rw-r--r-- | doc/manual.cli | 39 | ||||
-rw-r--r-- | tests/integration/testscript | 16 |
3 files changed, 322 insertions, 203 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 9ca549c..0c159f6 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -1022,6 +1022,9 @@ build (size_t argc, const char* argv[]) using string_parser::unquote; + using std::map; + using std::multimap; + tracer trace ("build"); // Our overall plan is as follows: @@ -1238,7 +1241,7 @@ build (size_t argc, const char* argv[]) // Keep track of explicitly enabled/disabled steps. // - std::map<string, bool> step_statuses; + map<string, bool> step_statuses; // Return true if the step is explicitly enabled via a +<prefix>:[<value>] // environment/configuration argument. @@ -1285,8 +1288,8 @@ build (size_t argc, const char* argv[]) // Parse environment arguments. // - std::multimap<string, string> modules; - std::multimap<string, string> env_args; + multimap<string, string> modules; + multimap<string, string> env_args; for (size_t i (1); i != argc; ++i) { @@ -1325,7 +1328,7 @@ build (size_t argc, const char* argv[]) // Parse target configuration arguments. Report failures to the bbot // controller. // - std::multimap<string, string> tgt_args; + multimap<string, string> tgt_args; for (const string& c: tm.target_config) { @@ -1363,28 +1366,51 @@ build (size_t argc, const char* argv[]) // separated list of the following potentially quoted bpkg-pkg-build // command arguments: // - // <option>... <config-var>... ({ <config-var>... }+ (?[sys:]|sys:)<pkg-name>[<version-spec>])... + // <option>... + // <config-var>... + // ([{ <config-var>... }+] (?[sys:]|sys:)<pkg-name>[<version-spec>])... + // ( { <config-var>... }+ <pkg-name>)... // // 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, 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. + // following lists/maps: + // + // - The prefixed global options and configuration variables map + // (pkg_args). Added to the command lines at the corresponding steps + // after potential environment and target configuration arguments. + // + // - The unprefixed global options list (pkg_config_opts). Specified after + // all the prefixed global options on the bpkg-pkg-build command line at + // the bpkg.configure.build step. + // + // - The main package-specific configuration variables list + // (pkg_config_vars). Specified for the main package only on the + // bpkg-pkg-build command line at the bpkg.configure.build step, + // wherever it is configured. Also specified on the b-configure command + // line at the b.test-installed.configure step. + // + // - The main package-specific dependency packages list + // (pkg_config_main_deps), potentially with their own configuration + // variables (but not options). Only configured where the main package + // is configured with the bpkg-pkg-build command line at the + // bpkg.configure.build step. + // + // - The global system dependency packages list (pkg_config_glob_deps). + // Configured in all configurations with the bpkg-pkg-build command line + // at the bpkg.configure.build step. // - std::multimap<string, string> pkg_args; + // - The main and external test package-specific configuration variables + // map (pkg_config_pkgs). Specified on the bpkg-pkg-build command lines + // at the bpkg.configure.build and + // bpkg.test-separate-installed.configure.build steps. Package names + // other than the main and external test package names are silently + // ignored. + // + multimap<string, string> pkg_args; strings pkg_config_opts; strings pkg_config_vars; vector<pair<string, strings>> pkg_config_main_deps; // ?<pkg>, sys:<pkg> vector<pair<string, strings>> pkg_config_glob_deps; // ?sys:<pkg> + map<string, strings> pkg_config_pkgs; // <pkg> if (!tm.package_config.empty ()) { @@ -1423,6 +1449,10 @@ build (size_t argc, const char* argv[]) { optional<argument> v (parse_arg (a)); + // Note that we only assume an argument as prefixed if the prefix + // is a known step id. Otherwise, we interpret the argument as + // unprefixed global option, variable, or a package spec. + // if (v && !v->prefix.empty ()) { if (v->value && @@ -1475,78 +1505,94 @@ build (size_t argc, const char* argv[]) bool o (opt (a)); bool v (var (a)); - // Fail if this is not an option, configuration variable, nor - // dependency. - // - // Note that we always allow a system package regardless whether it - // is a dependency or not. - // - if (o || v || a[0] == '?' || a.compare (0, 4, "sys:") == 0) + cli::scanner& ag (args.group ()); + + if (o) // Option. { - cli::scanner& ag (args.group ()); + if (ag.more ()) + fail ("unexpected options group for option '" + a + '\''); - if (o) // Option. + pkg_config_opts.push_back (move (a)); + } + else if (v) // Configuration variable. + { + if (ag.more ()) + fail ("unexpected options group for configuration variable '" + + a + '\''); + + pkg_config_vars.push_back (move (a)); + } + else // Dependency or build-to-hold package. + { + // Note that we consider a system package as a dependency + // regardless whether it is prefixed with '?' or not. + // + strings vars; + while (ag.more ()) { - if (ag.more ()) - fail ("unexpected options group for option '" + a + '\''); + string da (unquote (ag.next ())); + if (!var (da)) + fail ("argument is not a configuration variable for " + "dependency " + a + ": '" + da + '\''); - pkg_config_opts.push_back (move (a)); + vars.push_back (move (da)); } - else if (v) // Configuration variable. - { - if (ag.more ()) - fail ("unexpected options group for configuration variable '" + - a + '\''); - pkg_config_vars.push_back (move (a)); + // 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 package-specific + // --config-uuid options to only configure such packages 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) // Global system dependency. + { + pkg_config_glob_deps.push_back (make_pair (move (a), + move (vars))); } - else // Dependency. + else if (a[0] == '?' || // Main package dependency. + a.compare (0, 4, "sys:") == 0) { - strings vars; - while (ag.more ()) - { - string da (unquote (ag.next ())); - if (!var (da)) - fail ("argument is not a configuration variable for " - "dependency " + a + ": '" + da + '\''); + pkg_config_main_deps.push_back (make_pair (move (a), + move (vars))); + } + else // Build-to-hold package. + { + if (vars.empty ()) + fail ("no configuration variables specified for package '" + + a + '\''); - vars.push_back (move (da)); - } + auto i (pkg_config_pkgs.find (a)); - // 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))); + if (i == pkg_config_pkgs.end ()) + { + pkg_config_pkgs.emplace (move (a), move (vars)); + } else - pkg_config_glob_deps.push_back (make_pair (move (a), - move (vars))); + { + strings& vs (i->second); + vs.insert (vs.end (), + make_move_iterator (vars.begin ()), + make_move_iterator (vars.end ())); + } } } - else - fail ("not an option, configuration variable, nor dependency: '" + - a + '\''); } } catch (const string_parser::invalid_string& e) @@ -1565,7 +1611,7 @@ build (size_t argc, const char* argv[]) // specified for the step then use the specified fallbacks, potentially // both. Arguments with more specific prefixes come last. // - auto step_args = [] (const std::multimap<string, string>& args, + auto step_args = [] (const multimap<string, string>& args, step_id step, optional<step_id> fallback1 = nullopt, optional<step_id> fallback2 = nullopt) -> cstrings @@ -2607,11 +2653,11 @@ build (size_t argc, const char* argv[]) // <pkg-config-args> // <pkg-config-opts> // -- - // { <pkg-config-vars>|config.<pkg-name>.develop=false }+ <pkg> - // { config.<runtime-test-name>.develop=false }+ <runtime-test>... - // { <dep-config-vars> }+ <main-dep>... - // <main-dep>... - // <glob-dep>... + // { <pkg-config-vars>|config.<pkg-name>.develop=false }+ <pkg> + // { <rtt-config-vars>|config.<runtime-test-name>.develop=false }+ <runtime-test>... + // { <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); @@ -2637,9 +2683,17 @@ build (size_t argc, const char* argv[]) // Only add the config.<pkg>.develop variable if there are no package // configuration variables specified. // - if (!pkg_config_vars.empty ()) - pkgs.insert (pkgs.end (), - pkg_config_vars.begin (), pkg_config_vars.end ()); + auto i (pkg_config_pkgs.find (tm.name.string ())); + + if (!pkg_config_vars.empty () || i != pkg_config_pkgs.end ()) + { + if (!pkg_config_vars.empty ()) + pkgs.insert (pkgs.end (), + pkg_config_vars.begin (), pkg_config_vars.end ()); + + if (i != pkg_config_pkgs.end ()) + pkgs.insert (pkgs.end (), i->second.begin (), i->second.end ()); + } #if 1 else pkgs.push_back ("config." + pkg_var + ".develop=false"); @@ -2653,14 +2707,24 @@ build (size_t argc, const char* argv[]) // for (const auto& t: runtime_tests) { + pkgs.push_back ("{"); + // @@ config.<pkg>.develop=false // + // Only add the config.<pkg>.develop variable if there are no + // package configuration variables specified. + // + auto i (pkg_config_pkgs.find (t.name.string ())); + + if (i != pkg_config_pkgs.end ()) + pkgs.insert (pkgs.end (), i->second.begin (), i->second.end ()); #if 1 - pkgs.push_back ("{"); - pkgs.push_back ("config." + t.name.variable () + ".develop=false"); - pkgs.push_back ("}+"); + else + pkgs.push_back ("config." + t.name.variable () + ".develop=false"); #endif + pkgs.push_back ("}+"); + // Add test dependency package constraints (for example // 'bar > 1.0.0'). // @@ -2693,26 +2757,26 @@ build (size_t argc, const char* argv[]) // { <build-config> <env-config-args> // <tgt-config-args> // <pkg-config-args> - // <pkg-config-vars>|config.<pkg-name>.develop=false }+ <pkg> + // <pkg-config-vars>|config.<pkg-name>.develop=false }+ <pkg> // // { <build-config> <env-config-args> // <tgt-config-args> // <pkg-config-args> - // config.<runtime-test-name>.develop=false }+ <runtime-test>... + // <rtt-config-vars>|config.<runtime-test-name>.develop=false }+ <runtime-test>... // // { <install-config> <env-config-args> // <tgt-config-args> // <pkg-config-args> - // <pkg-config-vars> }+ <pkg> + // <pkg-config-vars> }+ <pkg> // // { <target-config> <env-config-args> // <tgt-config-args> // <pkg-config-args> - // config.<buildtime-test-name>.develop=false }+ <buildtime-test>... + // <btt-config-vars>|config.<buildtime-test-name>.develop=false }+ <buildtime-test>... // - // { <build-config> <install-config> <dep-config-vars> }+ <main-dep>... - // { <build-config> <install-config> }+ { <main-dep>... } - // <glob-dep>... + // { <build-config> <install-config> <dep-config-vars> }+ <main-dep>... + // { <build-config> <install-config> }+ { <main-dep>... } + // <glob-dep>... // // Main package configuration name. @@ -2756,9 +2820,17 @@ build (size_t argc, const char* argv[]) // Only add the config.<pkg>.develop variable if there are no // package configuration variables specified. // - if (!pkg_config_vars.empty ()) - pkgs.insert (pkgs.end (), - pkg_config_vars.begin (), pkg_config_vars.end ()); + auto i (pkg_config_pkgs.find (tm.name.string ())); + + if (!pkg_config_vars.empty () || i != pkg_config_pkgs.end ()) + { + if (!pkg_config_vars.empty ()) + pkgs.insert (pkgs.end (), + pkg_config_vars.begin (), pkg_config_vars.end ()); + + if (i != pkg_config_pkgs.end ()) + pkgs.insert (pkgs.end (), i->second.begin (), i->second.end ()); + } #if 1 else pkgs.push_back ("config." + pkg_var + ".develop=false"); @@ -2771,9 +2843,6 @@ build (size_t argc, const char* argv[]) // Add the runtime test packages. // - // @@ config.<pkg>.develop=false - // -#if 1 for (const auto& t: runtime_tests) { pkgs.push_back ("{"); @@ -2788,42 +2857,24 @@ build (size_t argc, const char* argv[]) pkgs.insert (pkgs.end (), cas.begin (), cas.end ()); pkgs.insert (pkgs.end (), pas.begin (), pas.end ()); - pkgs.push_back ("config." + t.name.variable () + ".develop=false"); - - pkgs.push_back ("}+"); - - pkgs.push_back (t.string ()); - } -#else - if (has_runtime_tests) - { - pkgs.push_back ("{"); - - pkgs.push_back ("--config-uuid"); - pkgs.push_back (conf_uuid); - - pkgs.push_back ("--checkout-root"); - pkgs.push_back (dist_root.string ()); + // @@ config.<pkg>.develop=false + // + // Only add the config.<pkg>.develop variable if there are no + // package configuration variables specified. + // + auto i (pkg_config_pkgs.find (t.name.string ())); - pkgs.insert (pkgs.end (), eas.begin (), eas.end ()); - pkgs.insert (pkgs.end (), cas.begin (), cas.end ()); - pkgs.insert (pkgs.end (), pas.begin (), pas.end ()); + if (i != pkg_config_pkgs.end ()) + pkgs.insert (pkgs.end (), i->second.begin (), i->second.end ()); +#if 1 + else + pkgs.push_back ("config." + t.name.variable () + ".develop=false"); +#endif pkgs.push_back ("}+"); - // Add test dependency package constraints and group them if there - // are multiple of them. - // - if (runtime_tests.size () != 1) - pkgs.push_back ("{"); - - for (const auto& t: runtime_tests) - pkgs.push_back (t.string ()); - - if (runtime_tests.size () != 1) - pkgs.push_back ("}"); + pkgs.push_back (t.string ()); } -#endif } // Add the main package configured in the install configuration and @@ -2864,6 +2915,11 @@ build (size_t argc, const char* argv[]) pkgs.insert (pkgs.end (), pkg_config_vars.begin (), pkg_config_vars.end ()); + auto i (pkg_config_pkgs.find (tm.name.string ())); + + if (i != pkg_config_pkgs.end ()) + pkgs.insert (pkgs.end (), i->second.begin (), i->second.end ()); + pkgs.push_back ("}+"); pkgs.push_back (pkg_rev); @@ -2873,7 +2929,6 @@ build (size_t argc, const char* argv[]) // // @@ config.<pkg>.develop=false // -#if 1 for (const auto& t: buildtime_tests) { pkgs.push_back ("{"); @@ -2888,46 +2943,26 @@ build (size_t argc, const char* argv[]) pkgs.insert (pkgs.end (), cas.begin (), cas.end ()); pkgs.insert (pkgs.end (), pas.begin (), pas.end ()); - pkgs.push_back ("config." + t.name.variable () + ".develop=false"); - - pkgs.push_back ("}+"); - - // Strip the build-time mark. + // @@ config.<pkg>.develop=false // - pkgs.push_back (t.dependency::string ()); - } -#else - if (has_buildtime_tests) - { - pkgs.push_back ("{"); - - pkgs.push_back ("--config-uuid"); - pkgs.push_back (target_uuid); - - pkgs.push_back ("--checkout-root"); - pkgs.push_back (dist_root.string ()); + // Only add the config.<pkg>.develop variable if there are no + // package configuration variables specified. + // + auto i (pkg_config_pkgs.find (t.name.string ())); - pkgs.insert (pkgs.end (), eas.begin (), eas.end ()); - pkgs.insert (pkgs.end (), cas.begin (), cas.end ()); - pkgs.insert (pkgs.end (), pas.begin (), pas.end ()); + if (i != pkg_config_pkgs.end ()) + pkgs.insert (pkgs.end (), i->second.begin (), i->second.end ()); +#if 1 + else + pkgs.push_back ("config." + t.name.variable () + ".develop=false"); +#endif pkgs.push_back ("}+"); - // Add test dependency package constraints and group them if there - // are multiple of them. - // - if (buildtime_tests.size () != 1) - pkgs.push_back ("{"); - // Strip the build-time mark. // - for (const auto& t: buildtime_tests) - pkgs.push_back (t.dependency::string ()); - - if (buildtime_tests.size () != 1) - pkgs.push_back ("}"); + pkgs.push_back (t.dependency::string ()); } -#endif } // Add the main package dependencies to those configurations where @@ -4642,10 +4677,11 @@ build (size_t argc, const char* argv[]) // bpkg build --configure-only <env-config-args> // <tgt-config-args> // <pkg-config-args> - // { <config> }+ { <runtime-test>... } - // <buildtime-test>... - // ?sys:<pkg> - // <glob-dep>... + // { <config> <rtt-config-vars> }+ <runtime-test>... + // { <config> }+ { <runtime-test>... } + // { <btt-config-vars> }+ <buildtime-test>... + // ?sys:<pkg> + // <glob-dep>... // strings pkgs; @@ -4661,34 +4697,96 @@ build (size_t argc, const char* argv[]) ? "" : "host"); - bool og (!conf_name.empty ()); - - if (og) + // If there are any runtime tests with configuration variables, + // then add them to the command line as following: + // + // { --config-name <name> <config-var>... }+ <runtime-test>... + // + // Also count the number of runtime tests without configuration + // variables. + // + size_t no_vars (0); + for (const auto& t: runtime_tests) { - pkgs.push_back ("{"); + auto i (pkg_config_pkgs.find (t.name.string ())); + + if (i != pkg_config_pkgs.end ()) + { + pkgs.push_back ("{"); + + if (!conf_name.empty ()) + { + pkgs.push_back ("--config-name"); + pkgs.push_back (conf_name); + } - pkgs.push_back ("--config-name"); - pkgs.push_back (conf_name); + pkgs.insert (pkgs.end (), + i->second.begin (), i->second.end ()); - pkgs.push_back ("}+"); + pkgs.push_back ("}+"); + + pkgs.push_back (t.string ()); + } + else + ++no_vars; } - if (og && runtime_tests.size () != 1) - pkgs.push_back ("{"); + // If there are any runtime tests without configuration + // variables, then add them to the command line as following: + // + // { --config-name <name> }+ { <runtime-test>... } + // + if (no_vars != 0) + { + bool og (!conf_name.empty ()); + + if (og) + { + pkgs.push_back ("{"); - for (const auto& t: runtime_tests) - pkgs.push_back (t.string ()); + pkgs.push_back ("--config-name"); + pkgs.push_back (conf_name); + + pkgs.push_back ("}+"); + } - if (og && runtime_tests.size () != 1) - pkgs.push_back ("}"); + if (og && no_vars != 1) + pkgs.push_back ("{"); + + for (const auto& t: runtime_tests) + { + if (pkg_config_pkgs.find (t.name.string ()) == + pkg_config_pkgs.end ()) + { + pkgs.push_back (t.string ()); + } + } + + if (og && no_vars != 1) + pkgs.push_back ("}"); + } } if (has_buildtime_tests) { - // Strip the build-time mark. - // for (const auto& t: buildtime_tests) + { + auto i (pkg_config_pkgs.find (t.name.string ())); + + if (i != pkg_config_pkgs.end ()) + { + pkgs.push_back ("{"); + + pkgs.insert (pkgs.end (), + i->second.begin (), i->second.end ()); + + pkgs.push_back ("}+"); + } + + // Strip the build-time mark. + // pkgs.push_back (t.dependency::string ()); + } } pkgs.push_back ("?sys:" + pkg_rev); diff --git a/doc/manual.cli b/doc/manual.cli index 533ba0d..d9d19b5 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -1033,7 +1033,8 @@ bpkg -v build --configure-only \\ <env-config-args> <tgt-config-args> <pkg-config-args> \\ [<pkg-config-opts>] \\ [{ <pkg-config-vars> }+] <package-name>/<package-version> \\ - [<test-package-name>[ <test-version-constraint>]...] \\ + [([{ <test-config-vars> }+] \\ + <test-package-name>[ <test-version-constraint>])...] \\ [([{ <dep-config-vars> }+] \\ (?|sys:)<dependency-name> \\ [<dependency-version-constraint>])...] \\ @@ -1190,7 +1191,8 @@ bpkg -v update <package-name> # bpkg -v build --configure-only \\ <env-config-args> <tgt-config-args> <pkg-config-args> \\ - <test-package-name>[ <test-version-constraint>]... \\ + ([{ <test-config-vars> }+] \\ + <test-package-name>[ <test-version-constraint>])... \\ ?sys:<package-name>/<package-version> \\ [?sys:<dependency-name>[ <dependency-version-constraint>]...] @@ -1366,13 +1368,15 @@ bpkg -v build --configure-only \\ [<pkg-config-vars>] }+ \\ <package-name>/<package-version> \\ \\ -{ --config-uuid <host-uuid> \\ - <env-config-args> <tgt-config-args> <pkg-config-args> }+ \\ -{ <runtime-test-package-name>[ test-version-constraint>]... } \\ +({ --config-uuid <host-uuid> \\ + <env-config-args> <tgt-config-args> <pkg-config-args> \\ + [<test-config-vars>] }+ \\ + <runtime-test-package-name>[ <test-version-constraint>])... \\ \\ -{ --config-uuid <target-uuid> \\ - <env-config-args> <tgt-config-args> <pkg-config-args> }+ \\ -{ <buildtime-test-package-name>[ test-version-constraint>]... } \\ +({ --config-uuid <target-uuid> \\ + <env-config-args> <tgt-config-args> <pkg-config-args> \\ + [<test-config-vars>] }+ \\ + <buildtime-test-package-name>[ <test-version-constraint>])... \\ \\ ({ --config-uuid <host-uuid> [--config-uuid <install-uuid>] \\ [<dep-config-vars>] }+ \\ @@ -1587,11 +1591,11 @@ bpkg -v update -d <host-conf> <package-name> bpkg -v build --configure-only \\ <env-config-args> <tgt-config-args> <pkg-config-args> \\ \\ - { --config-name <host-conf> }+ \\ - { <runtime-test-package-name>[ <test-version-constraint>]... } \\ + ({ --config-name <host-conf> [<test-config-vars>] }+ \\ + <runtime-test-package-name>[ <test-version-constraint>])... \\ \\ - { --config-name <target-conf> }+ \\ - <buildtime-test-package-name>[ <test-version-constraint>]... \\ + ({ --config-name <target-conf> [<test-config-vars>] }+ \\ + <buildtime-test-package-name>[ <test-version-constraint>])... \\ \\ ?sys:<package-name>/<package-version> \\ \\ @@ -1759,9 +1763,10 @@ bpkg -v build --configure-only \\ [<pkg-config-vars>] }+ \\ <package-name>/<package-version> \\ \\ -{ --config-uuid <target-uuid> \\ - <env-config-args> <tgt-config-args> <pkg-config-args> }+ \\ -{ <buildtime-test-package-name>[ test-version-constraint>]... } \\ +({ --config-uuid <target-uuid> \\ + <env-config-args> <tgt-config-args> <pkg-config-args> \\ + [<test-config-vars>] }+ \\ + <buildtime-test-package-name>[ <test-version-constraint>])... \\ \\ ({ --config-uuid <host-uuid> [--config-uuid <install-uuid>] \\ [<dep-config-vars>] }+ \\ @@ -1918,8 +1923,8 @@ bpkg -v update -d <module-conf> <package-name> bpkg -v build --configure-only \\ <env-config-args> <tgt-config-args> <pkg-config-args> \\ \\ - { --config-name <target-conf> }+ \\ - <buildtime-test-package-name>[ <test-version-constraint>]... \\ + ({ --config-name <target-conf> [<test-config-vars>] }+ \\ + <buildtime-test-package-name>[ <test-version-constraint>])... \\ \\ ?sys:<package-name>/<package-version> \\ \\ diff --git a/tests/integration/testscript b/tests/integration/testscript index 2e3cc3d..87070a5 100644 --- a/tests/integration/testscript +++ b/tests/integration/testscript @@ -73,6 +73,7 @@ rfp = yes #host='host: true' #dependency_checksum = 'dependency-checksum: e6f10587696020674c260669f4e7000a0139df72467bff9770aea2f2b8b57ba0' +#package_config = 'package-config: { config.libhello.extras=true }+ libhello' #package_config = 'package-config: +bbot.install.ldconfig:' #package_config = 'package-config: -bpkg.install:' #\ @@ -163,6 +164,12 @@ tests = "tests: * libbuild2-kconfig-tests == $ver examples: * kconfig-hello == $ver" host = 'host: true' #\ +#\ +package_config = 'package-config: +\ +{ config.libbuild2-kconfig-tests.extras=true }+ libbuild2-kconfig-tests +\' +#\ #package_config = 'package-config: config.libbuild2-kconfig.develop=true' #package_config = 'package-config: -bpkg.install:' #\ @@ -236,6 +243,14 @@ host='host: true' #\ package_config = "package-config: \\ +{ config.cli.extras=true }+ cli +{ config.cli-tests.extras=true }+ cli-tests +{ config.cli-examples.extras=true }+ cli-examples +\\" +#\ +#\ +package_config = "package-config: +\\ +bpkg.bindist.archive:--archive-build-meta= bbot.sys-install.tar.extract:--directory=$~ bbot.sys-install.tar.extract:--strip-components=1 @@ -282,6 +297,7 @@ host='host: true' package_config = "package-config: \\ ?sys:libxerces-c --sys-install --sys-yes +{ config.xsd-tests.extras=true }+ xsd-tests +bpkg.bindist.archive:--archive-build-meta= bbot.sys-install.tar.extract:--directory=$~ bbot.sys-install.tar.extract:--strip-components=1 |