Fix bazel_bootstrap_distfile_test on Windows
Spaces might appear in env values, adding quote around it.
MOS_MIGRATED_REVID=149642783
@@ -316,12 +316,12 @@ fi
function run_bazel_jar() {
local command=$1
shift
- local client_env=""
+ local client_env=()
# Propagate important environment variables to bootstrapped Bazel.
- for varname in PATH CC BAZEL_VC BAZEL_VS BAZEL_PYTHON CPLUS_INCLUDEPATH; do
+ for varname in PATH CC BAZEL_SH BAZEL_VC BAZEL_VS BAZEL_PYTHON CPLUS_INCLUDEPATH; do
eval value=\$$varname
- if [ ${value} ]; then
- client_env="${client_env} --client_env=${varname}=${value}"
+ if [ "${value}" ]; then
+ client_env=("${client_env[@]}" --client_env="${varname}=${value}")
fi
done
@@ -343,7 +343,7 @@ function run_bazel_jar() {
--ignore_unsupported_sandboxing \
--startup_time=329 --extract_data_time=523 \
--rc_source=/dev/null --isatty=1 \
- ${client_env} \
+ "${client_env[@]}" \
--client_cwd=${PWD} \
"${@}"
}
