@@ -51,12 +51,12 @@ if [[ ${USE_BAZEL_CACHE:-0} -ne 0 ]]; then
5151 BAZEL_EXTRA_ARGS=" --remote_cache=https://storage.googleapis.com/absl-bazel-remote-cache/${container_key} --google_credentials=/keystore/73103_absl-bazel-remote-cache ${BAZEL_EXTRA_ARGS:- } "
5252fi
5353
54- # Avoid depending on external sites like GitHub by checking --distdir for
55- # external dependencies first.
56- # https://docs.bazel.build/versions/master/guide.html#distdir
57- if [[ ${KOKORO_GFILE_DIR:- } ]] && [[ -d " ${KOKORO_GFILE_DIR} /distdir" ]]; then
58- DOCKER_EXTRA_ARGS=" --mount type=bind,source=${KOKORO_GFILE_DIR} /distdir,target=/distdir,readonly ${DOCKER_EXTRA_ARGS:- } "
59- BAZEL_EXTRA_ARGS=" --distdir=/distdir ${BAZEL_EXTRA_ARGS:- } "
54+ # Use Bazel Vendor mode to reduce reliance on external dependencies.
55+ # See https://bazel.build/ external/vendor and the Dockerfile for
56+ # an explaination of how this works.
57+ if [[ ${KOKORO_GFILE_DIR:- } ]] && [[ -f " ${KOKORO_GFILE_DIR} /distdir/abseil-cpp_vendor.tar.gz " ]]; then
58+ DOCKER_EXTRA_ARGS=" --mount type=bind,source=${KOKORO_GFILE_DIR} /distdir,target=/distdir,readonly --env=BAZEL_VENDOR_ARCHIVE=/distdir/abseil-cpp_vendor.tar.gz ${DOCKER_EXTRA_ARGS:- } "
59+ BAZEL_EXTRA_ARGS=" --vendor_dir=/abseil-cpp_vendor ${BAZEL_EXTRA_ARGS:- } "
6060fi
6161
6262for std in ${STD} ; do
@@ -70,28 +70,29 @@ for std in ${STD}; do
7070 --rm \
7171 ${DOCKER_EXTRA_ARGS:- } \
7272 ${DOCKER_CONTAINER} \
73+ /bin/bash --login -c "
7374 /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" \
78- --build_tag_filters=" -notsan" \
79- --compilation_mode=" ${compilation_mode} " \
80- --copt=" ${exceptions_mode} " \
81- --copt=" -DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1" \
82- --copt=" -fsanitize=thread" \
83- --copt=" -fno-sanitize-blacklist" \
75+ --action_env=\ " CC=/opt/llvm/clang/bin/clang\ " \
76+ --action_env=\ " BAZEL_CXXOPTS=-std=${std} :-nostdinc++\ " \
77+ --action_env=\ " BAZEL_LINKOPTS=-L/opt/llvm/libcxx-tsan/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx-tsan/lib\ " \
78+ --action_env=\ " CPLUS_INCLUDE_PATH=/opt/llvm/libcxx-tsan/include/c++/v1\ " \
79+ --build_tag_filters=\ " -notsan\ " \
80+ --compilation_mode=\ "${compilation_mode} \ " \
81+ --copt=\ "${exceptions_mode} \ " \
82+ --copt=\ " -DGTEST_REMOVE_LEGACY_TEST_CASEAPI_=1\ " \
83+ --copt=\ " -fsanitize=thread\ " \
84+ --copt=\ " -fno-sanitize-blacklist\ " \
8485 --copt=-Werror \
8586 --enable_bzlmod=true \
8687 --features=external_include_paths \
8788 --keep_going \
88- --linkopt=" -fsanitize=thread" \
89+ --linkopt=\ " -fsanitize=thread\ " \
8990 --show_timestamps \
90- --test_env=" TSAN_SYMBOLIZER_PATH=/opt/llvm/clang/bin/llvm-symbolizer" \
91- --test_env=" TZDIR=/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo" \
91+ --test_env=\ " TSAN_SYMBOLIZER_PATH=/opt/llvm/clang/bin/llvm-symbolizer\ " \
92+ --test_env=\ " TZDIR=/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo\ " \
9293 --test_output=errors \
93- --test_tag_filters=" -benchmark,-notsan" \
94- ${BAZEL_EXTRA_ARGS:- }
94+ --test_tag_filters=\ " -benchmark,-notsan\ " \
95+ ${BAZEL_EXTRA_ARGS:- } "
9596 done
9697 done
9798done
0 commit comments