Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Pass all the environment variable to Bazel during bootstrapping
Browse files Browse the repository at this point in the history
We might be using more environment variables that the actual list.

To be cherry-picked for bazelbuild#2692.

Fixes bazelbuild#2953.

Change-Id: I9b926d48e14b2c65822770ab46f6507a5303c3d3
PiperOrigin-RevId: 155387369
  • Loading branch information
damienmg authored and kchodorow committed May 9, 2017
1 parent c32ad5e commit 755669f
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions scripts/bootstrap/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,35 +325,9 @@ function run_bazel_jar() {
local command=$1
shift
local client_env=()
# Propagate important environment variables to bootstrapped Bazel.
local env_vars="ABI_LIBC_VERSION"
env_vars="$env_vars ABI_VERSION"
env_vars="$env_vars BAZEL_COMPILER "
env_vars="$env_vars BAZEL_HOST_SYSTEM"
env_vars="$env_vars BAZEL_PYTHON"
env_vars="$env_vars BAZEL_SH"
env_vars="$env_vars BAZEL_TARGET_CPU"
env_vars="$env_vars BAZEL_TARGET_LIBC"
env_vars="$env_vars BAZEL_TARGET_SYSTEM"
env_vars="$env_vars BAZEL_VC"
env_vars="$env_vars BAZEL_VS"
env_vars="$env_vars CC"
env_vars="$env_vars CC_TOOLCHAIN_NAME"
env_vars="$env_vars CPLUS_INCLUDE_PATH"
env_vars="$env_vars CUDA_COMPUTE_CAPABILITIES"
env_vars="$env_vars CUDA_PATH"
env_vars="$env_vars HOMEBREW_RUBY_PATH"
env_vars="$env_vars INCLUDE"
env_vars="$env_vars LIB"
env_vars="$env_vars NO_WHOLE_ARCHIVE_OPTION"
env_vars="$env_vars PATH"
env_vars="$env_vars SYSTEMROOT"
env_vars="$env_vars TMP"
env_vars="$env_vars VS90COMNTOOLS"
env_vars="$env_vars VS100COMNTOOLS"
env_vars="$env_vars VS110COMNTOOLS"
env_vars="$env_vars VS120COMNTOOLS"
env_vars="$env_vars VS140COMNTOOLS"
# Propagate all environment variables to bootstrapped Bazel.
# See https://stackoverflow.com/41898503/loop-over-environment-variables-in-posix.sh
local env_vars="$(awk 'END { for (name in ENVIRON) { if(name != "_") print name; } }' </dev/null)"
for varname in $env_vars; do
eval value=\$$varname
if [ "${value}" ]; then
Expand Down

0 comments on commit 755669f

Please sign in to comment.