diff options
-rw-r--r-- | bbot/worker/worker.cxx | 218 | ||||
-rw-r--r-- | tests/integration/testscript | 15 |
2 files changed, 141 insertions, 92 deletions
diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 793b387..8fb7796 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -575,6 +575,7 @@ run_cmd (step_id step, const string& name, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const process_env& pe, A&&... a) @@ -588,22 +589,32 @@ run_cmd (step_id step, // struct abort {}; - auto prompt = [&last_cmd, &next_cmd, &t, &log] (const string& what) + auto prompt = [&aux_env, &last_cmd, &next_cmd, &t, &log] (const string& what) { diag_record dr (text); dr << '\n' << what << '\n' - << " current dir: " << current_directory () << '\n' - << " environment: " << ops.env_script () << ' ' << ops.env_target (); + << " current dir: " << current_directory () << '\n' + << " environment: " << ops.env_script () << ' ' << ops.env_target (); + + if (!aux_env.empty ()) + { + dr << '\n' + << " auxiliary environment:"; + + for (const string& e: aux_env) + dr << '\n' + << " " << e; + } if (!last_cmd.empty ()) dr << '\n' - << " last command: " << last_cmd; + << " last command: " << last_cmd; if (!next_cmd.empty ()) dr << '\n' - << " next command: " << next_cmd; + << " next command: " << next_cmd; dr.flush (); @@ -782,6 +793,7 @@ run_cmd (step_id step, const string& name, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const process_env& pe, A&&... a) @@ -793,9 +805,7 @@ run_cmd (step_id step, out_str, out_file, warn_detect, name, - bkp_step, - bkp_status, - last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, pe, forward<A> (a)...); } @@ -811,6 +821,7 @@ run_bpkg (step_id step, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& cmd, A&&... a) @@ -822,7 +833,7 @@ run_bpkg (step_id step, &out, path () /* out_file */, warn_detect, "bpkg " + cmd, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("bpkg", envvars), verbosity, cmd, forward<A> (a)...); } @@ -835,6 +846,7 @@ run_bpkg (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& cmd, A&&... a) @@ -845,7 +857,7 @@ run_bpkg (step_id step, nullptr /* out_str */, path () /* out_file */, warn_detect, "bpkg " + cmd, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("bpkg", envvars), verbosity, cmd, forward<A> (a)...); } @@ -860,6 +872,7 @@ run_bpkg (step_id step, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& cmd, A&&... a) @@ -873,7 +886,7 @@ run_bpkg (step_id step, pre_run, out, warn_detect, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, verbosity, cmd, forward<A> (a)...); } @@ -885,6 +898,7 @@ run_bpkg (step_id step, string& log, const path& out, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& cmd, A&&... a) @@ -893,7 +907,7 @@ run_bpkg (step_id step, t, log, nullptr /* out_str */, out, warn_detect, "bpkg " + cmd, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("bpkg", envvars), verbosity, cmd, forward<A> (a)...); } @@ -905,6 +919,7 @@ run_bpkg (step_id step, string& log, const path& out, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& cmd, A&&... a) @@ -915,7 +930,7 @@ run_bpkg (step_id step, envvars, t, log, out, warn_detect, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, verbosity, cmd, forward<A> (a)...); } @@ -926,6 +941,7 @@ run_bpkg (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& cmd, A&&... a) @@ -936,7 +952,7 @@ run_bpkg (step_id step, envvars, t, log, warn_detect, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, verbosity, cmd, forward<A> (a)...); } @@ -948,6 +964,7 @@ run_b (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const strings& buildspecs, A&&... a) @@ -966,7 +983,7 @@ run_b (step_id step, nullptr /* out_str */, path () /* out_file */, warn_detect, name, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("b", envvars), verbosity, buildspecs, forward<A> (a)...); } @@ -979,6 +996,7 @@ run_b (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& buildspec, A&&... a) @@ -988,7 +1006,7 @@ run_b (step_id step, nullptr /* out_str */, path () /* out_file */, warn_detect, "b " + buildspec, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("b", envvars), verbosity, buildspec, forward<A> (a)...); } @@ -1000,6 +1018,7 @@ run_b (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const char* verbosity, const string& buildspec, A&&... a) @@ -1009,7 +1028,7 @@ run_b (step_id step, envvars, t, log, warn_detect, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, verbosity, buildspec, forward<A> (a)...); } @@ -1020,6 +1039,7 @@ run_ldconfig (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, A&&... a) { @@ -1029,7 +1049,7 @@ run_ldconfig (step_id step, nullptr /* out_str */, path () /* out_file*/, warn_detect, "sudo ldconfig", - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("sudo"), "ldconfig", forward<A> (a)...); } @@ -1041,6 +1061,7 @@ run_apt_get (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const string& cmd, A&&... a) { @@ -1052,7 +1073,7 @@ run_apt_get (step_id step, nullptr /* out_str */, path () /* out_file*/, warn_detect, "sudo apt-get " + cmd, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("sudo"), "apt-get", cmd, forward<A> (a)...); } @@ -1064,6 +1085,7 @@ run_dnf (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, const string& cmd, A&&... a) { @@ -1075,7 +1097,7 @@ run_dnf (step_id step, nullptr /* out_str */, path () /* out_file*/, warn_detect, "sudo dnf " + cmd, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("sudo"), "dnf", cmd, forward<A> (a)...); } @@ -1088,6 +1110,7 @@ run_tar (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, bool sudo, A&&... a) @@ -1098,7 +1121,7 @@ run_tar (step_id step, nullptr /* out_str */, path () /* out_file*/, warn_detect, sudo ? "sudo tar" : "tar", - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env (sudo ? "sudo" : "tar"), sudo ? "tar" : nullptr, forward<A> (a)...); } @@ -1110,6 +1133,7 @@ run_tar (step_id step, string& log, const regexes& warn_detect, const optional<step_id>& bkp_step, const optional<result_status>& bkp_status, + const strings& aux_env, string& last_cmd, bool /* sudo */, A&&... a) @@ -1123,7 +1147,7 @@ run_tar (step_id step, nullptr /* out_str */, path () /* out_file*/, warn_detect, "bsdtar", - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ("bsdtar"), forward<A> (a)...); } @@ -1299,6 +1323,12 @@ build (size_t argc, const char* argv[]) optional<result_status> bkp_status; string last_cmd; // Used in the user prompt. + // Parse the auxiliary environment, if present, to dump it into the + // configure operation log and to use it in the interactive build user + // prompt. Note that this environment is already set by the parent process. + // + strings aux_env; + for (;;) // The "breakout" loop. { auto fail_operation = [&trace] (operation_result& r, @@ -1383,6 +1413,17 @@ build (size_t argc, const char* argv[]) } } + // Parse the auxiliary environment, if present. + // + if (tm.auxiliary_environment) + { + // Note: cannot throw since has already been called successfully by the + // parent process. + // + aux_env = parse_auxiliary_environment (*tm.auxiliary_environment, + comment_begin); + } + // Split the argument into prefix (empty if not present) and unquoted // value (absent if not present) and determine the step status. If the // prefix is present and is prepended with the '+'/'-' character, then the @@ -2025,7 +2066,7 @@ build (size_t argc, const char* argv[]) // for the build2 process. Return true if the dist meta-operation // succeeds. // - auto redist = [&trace, &wre, &bkp_step, &bkp_status, &last_cmd] + auto redist = [&trace, &wre, &bkp_step, &bkp_status, &aux_env, &last_cmd] (step_id step, operation_result& r, const dir_path& dist_root, @@ -2055,7 +2096,7 @@ build (size_t argc, const char* argv[]) step, envvars, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "config.dist.root=" + redist_root.string (), import, @@ -2366,22 +2407,17 @@ build (size_t argc, const char* argv[]) // If we have auxiliary environment, show it in the logs. // - if (tm.auxiliary_environment) + if (!aux_env.empty ()) { - strings es (parse_auxiliary_environment (*tm.auxiliary_environment, - comment_begin)); - if (!es.empty ()) + for (const string& e: aux_env) { - for (const string& e: es) - { - r.log += e; - r.log += '\n'; - } - - // Add a trailing blank line to separate this from the rest. - // + r.log += e; r.log += '\n'; } + + // Add a trailing blank line to separate this from the rest. + // + r.log += '\n'; } // Noop, just for the log record. @@ -2431,7 +2467,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create", "-d", target_conf, @@ -2467,7 +2503,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create", "-d", host_conf, @@ -2497,7 +2533,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create", "-d", install_conf, @@ -2520,7 +2556,7 @@ build (size_t argc, const char* argv[]) r.status |= run_b ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create(" + host_conf.representation () + ",cc)", "config.config.load=~host", @@ -2534,7 +2570,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "create", "--existing", @@ -2595,7 +2631,7 @@ build (size_t argc, const char* argv[]) r.status |= run_b ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create(" + module_conf.representation () + ',' + mods + ')', "config.config.load=~build2", @@ -2612,7 +2648,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "create", "--existing", @@ -2646,7 +2682,7 @@ build (size_t argc, const char* argv[]) r.status |= run_b ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create(" + install_conf.representation () + ',' + mods + ')', "config.config.load=~build2", @@ -2663,7 +2699,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "create", "--existing", @@ -2689,7 +2725,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", target_conf, @@ -2704,7 +2740,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", target_conf, @@ -2722,7 +2758,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", host_conf, @@ -2742,7 +2778,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", install_conf, @@ -2756,7 +2792,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", install_conf, @@ -2782,7 +2818,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "add", "-d", main_pkg_conf, @@ -2805,7 +2841,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "fetch", "-d", main_pkg_conf, @@ -2830,7 +2866,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "add", "-d", install_conf, @@ -2853,7 +2889,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "fetch", "-d", install_conf, @@ -2879,7 +2915,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "add", "-d", target_conf, @@ -2902,7 +2938,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "fetch", "-d", target_conf, @@ -3384,7 +3420,7 @@ build (size_t argc, const char* argv[]) log_uuids, dependency_checksum, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "build", "--configure-only", @@ -3529,7 +3565,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "update", step_args (env_args, s), @@ -3574,7 +3610,7 @@ build (size_t argc, const char* argv[]) // configuration arguments are specified for them. // auto test = [&trace, &wre, - &bkp_step, &bkp_status, &last_cmd, + &bkp_step, &bkp_status, &aux_env, &last_cmd, &step_args, &env_args, &tgt_args, &pkg_args, &bootstrap_import, &redist] @@ -3657,7 +3693,7 @@ build (size_t argc, const char* argv[]) b, envvars, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "update", step_args (env_args, s, f), @@ -3692,7 +3728,7 @@ build (size_t argc, const char* argv[]) b, envvars, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "test", "--package-cwd", // See above for details. @@ -3746,7 +3782,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "test", "--package-cwd", @@ -3875,7 +3911,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "install", step_args (env_args, s), @@ -3900,7 +3936,7 @@ build (size_t argc, const char* argv[]) r.status |= run_ldconfig ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, step_args (env_args, s, nullopt, nullopt, ss), step_args (tgt_args, s, nullopt, nullopt, ss), step_args (pkg_args, s, nullopt, nullopt, ss)); @@ -4052,7 +4088,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, bindist_result_file, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "bindist", "--distribution", distribution, @@ -4354,7 +4390,7 @@ build (size_t argc, const char* argv[]) r.status |= run_apt_get ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "update", "--assume-yes", step_args (env_args, s, nullopt, nullopt, ss), @@ -4384,7 +4420,7 @@ build (size_t argc, const char* argv[]) r.status |= run_apt_get ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "install", "--assume-yes", step_args (env_args, s, nullopt, nullopt, ss), @@ -4424,7 +4460,7 @@ build (size_t argc, const char* argv[]) r.status |= run_dnf ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "install", "--refresh", "--assumeyes", @@ -4496,7 +4532,7 @@ build (size_t argc, const char* argv[]) r.status |= run_tar ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, true /* sudo */, "-xf", f, @@ -4526,7 +4562,7 @@ build (size_t argc, const char* argv[]) r.status |= run_ldconfig ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, step_args (env_args, s, nullopt, nullopt, ss), step_args (tgt_args, s, nullopt, nullopt, ss), step_args (pkg_args, s, nullopt, nullopt, ss)); @@ -4689,7 +4725,7 @@ build (size_t argc, const char* argv[]) r.status |= run_b ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create('" + out_dir.representation () + '\'' + mods + ')', step_args (env_args, s, f), @@ -4730,7 +4766,7 @@ build (size_t argc, const char* argv[]) b, envvars, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "configure('" + subprj_src_dir.representation () + "'@'" + @@ -4765,7 +4801,7 @@ build (size_t argc, const char* argv[]) b, envvars, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", test_specs, step_args (env_args, s), @@ -4877,7 +4913,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create", "-d", target_conf, @@ -4913,7 +4949,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create", "-d", host_conf, @@ -4943,7 +4979,7 @@ build (size_t argc, const char* argv[]) r.status |= run_b ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-V", "create(" + module_conf.representation () + ",cc)", "config.config.load=~build2", @@ -4957,7 +4993,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "create", "--existing", @@ -4983,7 +5019,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", target_conf, @@ -4998,7 +5034,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", target_conf, @@ -5016,7 +5052,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "link", "-d", host_conf, @@ -5043,7 +5079,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "add", "-d", runtime_tests_conf, @@ -5067,7 +5103,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "fetch", "-d", runtime_tests_conf, @@ -5094,7 +5130,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "add", "-d", target_conf, @@ -5118,7 +5154,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "fetch", "-d", target_conf, @@ -5281,7 +5317,7 @@ build (size_t argc, const char* argv[]) b, envvars, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "build", "--configure-only", @@ -5461,7 +5497,7 @@ build (size_t argc, const char* argv[]) r.status |= run_apt_get ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "remove", "--assume-yes", step_args (env_args, s, nullopt, nullopt, ss), @@ -5500,7 +5536,7 @@ build (size_t argc, const char* argv[]) r.status |= run_dnf ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "remove", "--assumeyes", step_args (env_args, s, nullopt, nullopt, ss), @@ -5556,7 +5592,7 @@ build (size_t argc, const char* argv[]) r.status |= run_bpkg ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, "-v", "uninstall", step_args (env_args, s), @@ -5758,7 +5794,7 @@ build (size_t argc, const char* argv[]) r.status |= run_tar ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, false /* sudo */, #ifndef __OpenBSD__ "--format", "ustar", @@ -5788,7 +5824,7 @@ build (size_t argc, const char* argv[]) r.status |= run_tar ( b, trace, r.log, wre, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, false /* sudo */, "-tf", upload_archive, @@ -5860,7 +5896,7 @@ build (size_t argc, const char* argv[]) nullptr /* out_str */, path () /* out_file */, regexes (), "" /* name */, - bkp_step, bkp_status, last_cmd, + bkp_step, bkp_status, aux_env, last_cmd, process_env ()); rm.status |= r.status; diff --git a/tests/integration/testscript b/tests/integration/testscript index 93a6807..988859f 100644 --- a/tests/integration/testscript +++ b/tests/integration/testscript @@ -472,6 +472,18 @@ rfp = yes #interactive="interactive: b.test-installed.configure" #interactive="interactive: warning" +#\ +aux_env = 'auxiliary-environment: +\ +# x86_64-linux_debian_12-postgresql_15 +# +DATABASE_HOST=10.0.213.126 +DATABASE_PORT=5432 +DATABASE_USER=test +DATABASE_NAME=test +\ +' +#\ +cat <<"EOI" >=task : 1 @@ -484,7 +496,8 @@ rfp = yes $tests machine: $machine target: $target - config: $config + $aux_env + target-config: $config $package_config $interactive $host |