diff options
author | Laszlo Csomor <laszlocsomor@google.com> | 2017-05-31 09:47:43 +0200 |
---|---|---|
committer | László Csomor <laszlocsomor@google.com> | 2017-05-31 13:44:26 +0200 |
commit | 0a936d104922065fdfde80a6c9a328086d3dcad3 (patch) | |
tree | 6478a270235113f0087c8e2e2aecfacc75bd8aaa /scripts | |
parent | 74cea8368d00ed222b5afee4022208022918eb8f (diff) |
Windows: ignore envvars with degenerate names
Fixes https://github.com/bazelbuild/bazel/issues/3077
Change-Id: I5f29fdec1f69bdda51fa62be695b8791a45240e9
PiperOrigin-RevId: 157559455
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bootstrap/compile.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh index 2a769c3d51..3571486091 100755 --- a/scripts/bootstrap/compile.sh +++ b/scripts/bootstrap/compile.sh @@ -18,7 +18,7 @@ PROTO_FILES=$(ls src/main/protobuf/*.proto src/main/java/com/google/devtools/build/lib/buildeventstream/proto/*.proto) LIBRARY_JARS=$(find third_party -name '*.jar' | grep -Fv /javac-9-dev-r3297-4.jar | grep -Fv /javac-9-dev-4023-2.jar | grep -Fv /javac7.jar | grep -Fv JavaBuilder | grep -Fv third_party/guava | grep -Fv third_party/guava | grep -ve third_party/grpc/grpc.*jar | tr "\n" " ") -GRPC_JAVA_VERSION=1.3.0 +GRPC_JAVA_VERSION=0.15.0 GRPC_LIBRARY_JARS=$(find third_party/grpc -name '*.jar' | grep -e .*${GRPC_JAVA_VERSION}.*jar | tr "\n" " ") # Guava jars are different for JDK 7 build and JDK 8 build, we select the good # one based on the name (21.0-{date} for JDK7). @@ -327,9 +327,12 @@ function run_bazel_jar() { local client_env=() # Propagate all environment variables to bootstrapped Bazel. # See https://stackoverflow.com/questions/41898503/loop-over-environment-variables-in-posix-sh - local env_vars="$(awk 'END { for (name in ENVIRON) { if(name != "_") print name; } }' </dev/null)" + local env_vars="$(awk 'END { for (name in ENVIRON) { if(name != "_" && name ~ /^[A-Za-z0-9_]*$/) print name; } }' </dev/null)" for varname in $env_vars; do eval value=\$$varname + if [ "${PLATFORM}" = "windows" ] && echo "$varname" | grep -q -i "^\(path\|tmp\|temp\|tempdir\|systemroot\)$" ; then + varname="$(echo "$varname" | tr [:lower:] [:upper:])" + fi if [ "${value}" ]; then client_env=("${client_env[@]}" --client_env="${varname}=${value}") fi |