Skip to content

Commit 52190ca

Browse files
derekmaurocopybara-github
authored andcommitted
Bazel: Move environment variables to --action_env
According to https://bazel.build/remote/caching#known-issues and bazelbuild/bazel#4558 this is better since these needs to be taken into account for the cache key. PiperOrigin-RevId: 730947060 Change-Id: I0e27368e29fab5f6583e32a779fe84f0070b0d14
1 parent aea2fc0 commit 52190ca

6 files changed

+18
-18
lines changed

ci/linux_clang-latest_libcxx_asan_bazel.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ for std in ${STD}; do
6868
--workdir=/abseil-cpp \
6969
--cap-add=SYS_PTRACE \
7070
--rm \
71-
-e CC="/opt/llvm/clang/bin/clang" \
72-
-e BAZEL_CXXOPTS="-std=${std}:-nostdinc++" \
73-
-e BAZEL_LINKOPTS="-L/opt/llvm/libcxx/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx/lib" \
74-
-e CPLUS_INCLUDE_PATH="/opt/llvm/libcxx/include/c++/v1" \
7571
${DOCKER_EXTRA_ARGS:-} \
7672
${DOCKER_CONTAINER} \
7773
/usr/local/bin/bazel test ... \
74+
--action_env="CC=/opt/llvm/clang/bin/clang" \
75+
--action_env="BAZEL_CXXOPTS=-std=${std}:-nostdinc++" \
76+
--action_env="BAZEL_LINKOPTS=-L/opt/llvm/libcxx/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx/lib" \
77+
--action_env="CPLUS_INCLUDE_PATH=/opt/llvm/libcxx/include/c++/v1" \
7878
--compilation_mode="${compilation_mode}" \
7979
--copt="${exceptions_mode}" \
8080
--copt="-DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1" \

ci/linux_clang-latest_libcxx_bazel.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ for std in ${STD}; do
6969
--workdir=/abseil-cpp \
7070
--cap-add=SYS_PTRACE \
7171
--rm \
72-
-e CC="/opt/llvm/clang/bin/clang" \
73-
-e BAZEL_CXXOPTS="-std=${std}:-nostdinc++" \
74-
-e BAZEL_LINKOPTS="-L/opt/llvm/libcxx/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx/lib" \
75-
-e CPLUS_INCLUDE_PATH="/opt/llvm/libcxx/include/c++/v1" \
7672
${DOCKER_EXTRA_ARGS:-} \
7773
${DOCKER_CONTAINER} \
7874
/bin/sh -c "
@@ -81,6 +77,10 @@ for std in ${STD}; do
8177
cp ${ALTERNATE_OPTIONS:-} absl/base/options.h || exit 1
8278
fi
8379
/usr/local/bin/bazel test ... \
80+
--action_env=CC=/opt/llvm/clang/bin/clang \
81+
--action_env=BAZEL_CXXOPTS=-std=${std}:-nostdinc++ \
82+
--action_env=BAZEL_LINKOPTS=-L/opt/llvm/libcxx/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx/lib \
83+
--action_env=CPLUS_INCLUDE_PATH=/opt/llvm/libcxx/include/c++/v1 \
8484
--compilation_mode=\"${compilation_mode}\" \
8585
--copt=\"${exceptions_mode}\" \
8686
--copt=\"-DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1\" \

ci/linux_clang-latest_libcxx_tsan_bazel.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ for std in ${STD}; do
6868
--workdir=/abseil-cpp \
6969
--cap-add=SYS_PTRACE \
7070
--rm \
71-
-e CC="/opt/llvm/clang/bin/clang" \
72-
-e BAZEL_CXXOPTS="-std=${std}:-nostdinc++" \
73-
-e BAZEL_LINKOPTS="-L/opt/llvm/libcxx-tsan/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx-tsan/lib" \
74-
-e CPLUS_INCLUDE_PATH="/opt/llvm/libcxx-tsan/include/c++/v1" \
7571
${DOCKER_EXTRA_ARGS:-} \
7672
${DOCKER_CONTAINER} \
7773
/usr/local/bin/bazel test ... \
74+
--action_env="CC=/opt/llvm/clang/bin/clang" \
75+
--action_env="BAZEL_CXXOPTS=-std=${std}:-nostdinc++" \
76+
--action_env="BAZEL_LINKOPTS=-L/opt/llvm/libcxx-tsan/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx-tsan/lib" \
77+
--action_env="CPLUS_INCLUDE_PATH=/opt/llvm/libcxx-tsan/include/c++/v1" \
7878
--build_tag_filters="-notsan" \
7979
--compilation_mode="${compilation_mode}" \
8080
--copt="${exceptions_mode}" \

ci/linux_clang-latest_libstdcxx_bazel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ for std in ${STD}; do
6868
--workdir=/abseil-cpp \
6969
--cap-add=SYS_PTRACE \
7070
--rm \
71-
-e CC="/opt/llvm/clang/bin/clang" \
72-
-e BAZEL_CXXOPTS="-std=${std}" \
7371
${DOCKER_EXTRA_ARGS:-} \
7472
${DOCKER_CONTAINER} \
7573
/usr/local/bin/bazel test ... \
74+
--action_env="CC=/opt/llvm/clang/bin/clang" \
75+
--action_env="BAZEL_CXXOPTS=-std=${std}" \
7676
--compilation_mode="${compilation_mode}" \
7777
--copt="--gcc-toolchain=/usr/local" \
7878
--copt="-DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1" \

ci/linux_gcc-floor_libstdcxx_bazel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ for std in ${STD}; do
6868
--workdir=/abseil-cpp \
6969
--cap-add=SYS_PTRACE \
7070
--rm \
71-
-e CC="/usr/local/bin/gcc" \
72-
-e BAZEL_CXXOPTS="-std=${std}" \
7371
${DOCKER_EXTRA_ARGS:-} \
7472
${DOCKER_CONTAINER} \
7573
/usr/local/bin/bazel test ... \
74+
--action_env="CC=/usr/local/bin/gcc" \
75+
--action_env="BAZEL_CXXOPTS=-std=${std}" \
7676
--compilation_mode="${compilation_mode}" \
7777
--copt="${exceptions_mode}" \
7878
--copt="-DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1" \

ci/linux_gcc-latest_libstdcxx_bazel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ for std in ${STD}; do
6969
--workdir=/abseil-cpp \
7070
--cap-add=SYS_PTRACE \
7171
--rm \
72-
-e CC="/usr/local/bin/gcc" \
73-
-e BAZEL_CXXOPTS="-std=${std}" \
7472
${DOCKER_EXTRA_ARGS:-} \
7573
${DOCKER_CONTAINER} \
7674
/bin/sh -c "
@@ -79,6 +77,8 @@ for std in ${STD}; do
7977
cp ${ALTERNATE_OPTIONS:-} absl/base/options.h || exit 1
8078
fi
8179
/usr/local/bin/bazel test ... \
80+
--action_env=CC=/usr/local/bin/gcc \
81+
--action_env=BAZEL_CXXOPTS=-std=${std} \
8282
--compilation_mode=\"${compilation_mode}\" \
8383
--copt=\"${exceptions_mode}\" \
8484
--copt=\"-DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1\" \

0 commit comments

Comments
 (0)