aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap
diff options
context:
space:
mode:
authorGravatar Dmitry Lomov <dslomov@google.com>2017-03-07 18:33:08 +0000
committerGravatar Vladimir Moskva <vladmos@google.com>2017-03-08 10:49:03 +0000
commit31fab2940b4cca44bb74d903cd83bc74504e9f43 (patch)
treeb28bd299e3d805a5a1c3018b4bd278949cac62b4 /scripts/bootstrap
parente9826b41239e106bf11283071d23f99ccd825310 (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-xscripts/bootstrap/compile.sh11
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} \
"${@}"
}