diff options
author | Dmitry Lomov <dslomov@google.com> | 2017-03-07 18:33:08 +0000 |
---|---|---|
committer | Vladimir Moskva <vladmos@google.com> | 2017-03-08 10:49:03 +0000 |
commit | 31fab2940b4cca44bb74d903cd83bc74504e9f43 (patch) | |
tree | b28bd299e3d805a5a1c3018b4bd278949cac62b4 /scripts/bootstrap | |
parent | e9826b41239e106bf11283071d23f99ccd825310 (diff) |
Env.vars: server won't ignore the client env
Make the --ignore_client_env flag a no-op.
The client will pass --client_env flags to the
server even in --batch mode. This simplifies the
code as well as ensuring that the server always
uses the up-do-date client environment.
We'll gradually get rid of all System.getenv calls
in the server, because the server should always
respect the client env.
Roll forward of 149403129 with fixes.
--
PiperOrigin-RevId: 149435060
MOS_MIGRATED_REVID=149435060
Diffstat (limited to 'scripts/bootstrap')
-rwxr-xr-x | scripts/bootstrap/compile.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh index dee6ce2b5b..ab2bb22719 100755 --- a/scripts/bootstrap/compile.sh +++ b/scripts/bootstrap/compile.sh @@ -316,6 +316,15 @@ fi function run_bazel_jar() { local command=$1 shift + local client_env="" + # Propagate important environment variables to bootstrapped Bazel. + for varname in PATH CC BAZEL_VC BAZEL_VS BAZEL_PYTHON CPLUS_INCLUDEPATH; do + eval value=\$$varname + if [ ${value} ]; then + client_env="${client_env} --client_env=${varname}=${value}" + fi + done + "${JAVA_HOME}/bin/java" \ -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Dfile.encoding=ISO-8859-1 \ -XX:HeapDumpPath=${OUTPUT_DIR} \ @@ -334,7 +343,7 @@ function run_bazel_jar() { --ignore_unsupported_sandboxing \ --startup_time=329 --extract_data_time=523 \ --rc_source=/dev/null --isatty=1 \ - --ignore_client_env \ + ${client_env} \ --client_cwd=${PWD} \ "${@}" } |