diff options
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/cmake_install_test.sh | 2 | ||||
-rwxr-xr-x | ci/linux_clang-latest_libcxx_bazel.sh | 20 | ||||
-rwxr-xr-x | ci/linux_clang-latest_libstdcxx_bazel.sh | 20 | ||||
-rwxr-xr-x | ci/linux_gcc-latest_libstdcxx_bazel.sh | 20 |
4 files changed, 55 insertions, 7 deletions
diff --git a/ci/cmake_install_test.sh b/ci/cmake_install_test.sh index e54b78379640..7195d1801795 100755 --- a/ci/cmake_install_test.sh +++ b/ci/cmake_install_test.sh @@ -29,5 +29,5 @@ time docker run \ -e CFLAGS="-Werror" \ -e CXXFLAGS="-Werror" \ gcr.io/google.com/absl-177019/linux_gcc-4.8:20190316 \ - /bin/bash CMake/install_test_project/test.sh + /bin/bash CMake/install_test_project/test.sh $@ diff --git a/ci/linux_clang-latest_libcxx_bazel.sh b/ci/linux_clang-latest_libcxx_bazel.sh index 741e48c4777e..eec6c26f85cd 100755 --- a/ci/linux_clang-latest_libcxx_bazel.sh +++ b/ci/linux_clang-latest_libcxx_bazel.sh @@ -32,6 +32,20 @@ if [ -z ${COMPILATION_MODE:-} ]; then COMPILATION_MODE="fastbuild opt" fi +readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_clang-latest:20190313" + +# USE_BAZEL_CACHE=1 only works on Kokoro. +# Without access to the credentials this won't work. +if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then + DOCKER_EXTRA_ARGS="--volume=${KOKORO_KEYSTORE_DIR}:/keystore:ro ${DOCKER_EXTRA_ARGS:-}" + # Bazel doesn't track changes to tools outside of the workspace + # (e.g. /usr/bin/gcc), so by appending the docker container to the + # remote_http_cache url, we make changes to the container part of + # the cache key. Hashing the key is to make it shorter and url-safe. + container_key=$(echo ${DOCKER_CONTAINER} | sha256sum | head -c 16) + BAZEL_EXTRA_ARGS="--remote_http_cache=https://storage.googleapis.com/absl-bazel-remote-cache/${container_key} --google_credentials=/keystore/73103_absl-bazel-remote-cache ${BAZEL_EXTRA_ARGS:-}" +fi + for std in ${STD}; do for compilation_mode in ${COMPILATION_MODE}; do echo "--------------------------------------------------------------------" @@ -47,7 +61,8 @@ for std in ${STD}; do -e BAZEL_CXXOPTS="-std=${std}:-nostdinc++" \ -e BAZEL_LINKOPTS="-L/opt/llvm/libcxx/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx/lib" \ -e CPLUS_INCLUDE_PATH="/opt/llvm/libcxx/include/c++/v1" \ - gcr.io/google.com/absl-177019/linux_clang-latest:20190313 \ + ${DOCKER_EXTRA_ARGS:-} \ + ${DOCKER_CONTAINER} \ /usr/local/bin/bazel test ... \ --compilation_mode=${compilation_mode} \ --copt=-Werror \ @@ -57,6 +72,7 @@ for std in ${STD}; do --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \ --test_env="TZDIR=/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo" \ --test_output=errors \ - --test_tag_filters=-benchmark + --test_tag_filters=-benchmark \ + ${BAZEL_EXTRA_ARGS:-} done done diff --git a/ci/linux_clang-latest_libstdcxx_bazel.sh b/ci/linux_clang-latest_libstdcxx_bazel.sh index d703a7761cad..147232351234 100755 --- a/ci/linux_clang-latest_libstdcxx_bazel.sh +++ b/ci/linux_clang-latest_libstdcxx_bazel.sh @@ -32,6 +32,20 @@ if [ -z ${COMPILATION_MODE:-} ]; then COMPILATION_MODE="fastbuild opt" fi +readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_clang-latest:20190313" + +# USE_BAZEL_CACHE=1 only works on Kokoro. +# Without access to the credentials this won't work. +if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then + DOCKER_EXTRA_ARGS="--volume=${KOKORO_KEYSTORE_DIR}:/keystore:ro ${DOCKER_EXTRA_ARGS:-}" + # Bazel doesn't track changes to tools outside of the workspace + # (e.g. /usr/bin/gcc), so by appending the docker container to the + # remote_http_cache url, we make changes to the container part of + # the cache key. Hashing the key is to make it shorter and url-safe. + container_key=$(echo ${DOCKER_CONTAINER} | sha256sum | head -c 16) + BAZEL_EXTRA_ARGS="--remote_http_cache=https://storage.googleapis.com/absl-bazel-remote-cache/${container_key} --google_credentials=/keystore/73103_absl-bazel-remote-cache ${BAZEL_EXTRA_ARGS:-}" +fi + for std in ${STD}; do for compilation_mode in ${COMPILATION_MODE}; do echo "--------------------------------------------------------------------" @@ -46,7 +60,8 @@ for std in ${STD}; do -e BAZEL_COMPILER="llvm" \ -e BAZEL_CXXOPTS="-std=${std}" \ -e CPLUS_INCLUDE_PATH="/usr/include/c++/6" \ - gcr.io/google.com/absl-177019/linux_clang-latest:20190313 \ + ${DOCKER_EXTRA_ARGS:-} \ + ${DOCKER_CONTAINER} \ /usr/local/bin/bazel test ... \ --compilation_mode=${compilation_mode} \ --copt=-Werror \ @@ -56,6 +71,7 @@ for std in ${STD}; do --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \ --test_env="TZDIR=/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo" \ --test_output=errors \ - --test_tag_filters=-benchmark + --test_tag_filters=-benchmark \ + ${BAZEL_EXTRA_ARGS:-} done done diff --git a/ci/linux_gcc-latest_libstdcxx_bazel.sh b/ci/linux_gcc-latest_libstdcxx_bazel.sh index e14a019cd0e7..24469628278f 100755 --- a/ci/linux_gcc-latest_libstdcxx_bazel.sh +++ b/ci/linux_gcc-latest_libstdcxx_bazel.sh @@ -32,6 +32,20 @@ if [ -z ${COMPILATION_MODE:-} ]; then COMPILATION_MODE="fastbuild opt" fi +readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-latest:20190318" + +# USE_BAZEL_CACHE=1 only works on Kokoro. +# Without access to the credentials this won't work. +if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then + DOCKER_EXTRA_ARGS="--volume=${KOKORO_KEYSTORE_DIR}:/keystore:ro ${DOCKER_EXTRA_ARGS:-}" + # Bazel doesn't track changes to tools outside of the workspace + # (e.g. /usr/bin/gcc), so by appending the docker container to the + # remote_http_cache url, we make changes to the container part of + # the cache key. Hashing the key is to make it shorter and url-safe. + container_key=$(echo ${DOCKER_CONTAINER} | sha256sum | head -c 16) + BAZEL_EXTRA_ARGS="--remote_http_cache=https://storage.googleapis.com/absl-bazel-remote-cache/${container_key} --google_credentials=/keystore/73103_absl-bazel-remote-cache ${BAZEL_EXTRA_ARGS:-}" +fi + for std in ${STD}; do for compilation_mode in ${COMPILATION_MODE}; do echo "--------------------------------------------------------------------" @@ -44,7 +58,8 @@ for std in ${STD}; do --rm \ -e CC="/usr/local/bin/gcc" \ -e BAZEL_CXXOPTS="-std=${std}" \ - gcr.io/google.com/absl-177019/linux_gcc-latest:20190318 \ + ${DOCKER_EXTRA_ARGS:-} \ + ${DOCKER_CONTAINER} \ /usr/local/bin/bazel test ... \ --compilation_mode=${compilation_mode} \ --copt=-Werror \ @@ -54,6 +69,7 @@ for std in ${STD}; do --test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \ --test_env="TZDIR=/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo" \ --test_output=errors \ - --test_tag_filters=-benchmark + --test_tag_filters=-benchmark \ + ${BAZEL_EXTRA_ARGS:-} done done |