aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/ci
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/abseil-cpp/ci')
-rw-r--r--third_party/abseil-cpp/ci/absl_alternate_options.h7
-rw-r--r--third_party/abseil-cpp/ci/cmake_common.sh25
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/cmake_install_test.sh30
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh32
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh29
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh31
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh30
-rw-r--r--third_party/abseil-cpp/ci/linux_docker_containers.sh21
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh (renamed from third_party/abseil-cpp/ci/linux_gcc-4.9_libstdcxx_bazel.sh)26
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh28
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh66
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/linux_gcc_alpine_cmake.sh63
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/macos_xcode_bazel.sh8
-rwxr-xr-x[-rw-r--r--]third_party/abseil-cpp/ci/macos_xcode_cmake.sh46
14 files changed, 286 insertions, 156 deletions
diff --git a/third_party/abseil-cpp/ci/absl_alternate_options.h b/third_party/abseil-cpp/ci/absl_alternate_options.h
index f0c21fea9d..29b020d9fa 100644
--- a/third_party/abseil-cpp/ci/absl_alternate_options.h
+++ b/third_party/abseil-cpp/ci/absl_alternate_options.h
@@ -1,6 +1,3 @@
-#ifndef ABSL_BASE_OPTIONS_H_
-#define ABSL_BASE_OPTIONS_H_
-
// Copyright 2019 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,11 +15,15 @@
// Alternate options.h file, used in continuous integration testing to exercise
// option settings not used by default.
+#ifndef ABSL_BASE_OPTIONS_H_
+#define ABSL_BASE_OPTIONS_H_
+
#define ABSL_OPTION_USE_STD_ANY 0
#define ABSL_OPTION_USE_STD_OPTIONAL 0
#define ABSL_OPTION_USE_STD_STRING_VIEW 0
#define ABSL_OPTION_USE_STD_VARIANT 0
#define ABSL_OPTION_USE_INLINE_NAMESPACE 1
#define ABSL_OPTION_INLINE_NAMESPACE_NAME ns
+#define ABSL_OPTION_HARDENED 1
#endif // ABSL_BASE_OPTIONS_H_
diff --git a/third_party/abseil-cpp/ci/cmake_common.sh b/third_party/abseil-cpp/ci/cmake_common.sh
new file mode 100644
index 0000000000..51f310693e
--- /dev/null
+++ b/third_party/abseil-cpp/ci/cmake_common.sh
@@ -0,0 +1,25 @@
+# Copyright 2020 The Abseil Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# The commit of GoogleTest to be used in the CMake tests in this directory.
+# Keep this in sync with the commit in the WORKSPACE file.
+readonly ABSL_GOOGLETEST_COMMIT="8d51ffdfab10b3fba636ae69bc03da4b54f8c235"
+
+# Avoid depending on GitHub by looking for a cached copy of the commit first.
+if [[ -r "${KOKORO_GFILE_DIR:-}/distdir/${ABSL_GOOGLETEST_COMMIT}.zip" ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_GFILE_DIR}/distdir,target=/distdir,readonly ${DOCKER_EXTRA_ARGS:-}"
+ ABSL_GOOGLETEST_DOWNLOAD_URL="file:///distdir/${ABSL_GOOGLETEST_COMMIT}.zip"
+else
+ ABSL_GOOGLETEST_DOWNLOAD_URL="https://github.com/google/googletest/archive/${ABSL_GOOGLETEST_COMMIT}.zip"
+fi
diff --git a/third_party/abseil-cpp/ci/cmake_install_test.sh b/third_party/abseil-cpp/ci/cmake_install_test.sh
index 55fb4f120b..97ed8478e0 100644..100755
--- a/third_party/abseil-cpp/ci/cmake_install_test.sh
+++ b/third_party/abseil-cpp/ci/cmake_install_test.sh
@@ -16,17 +16,31 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp:ro" \
- --workdir=/abseil-cpp \
+if [[ -z ${LINK_TYPE:-} ]]; then
+ LINK_TYPE="STATIC DYNAMIC"
+fi
+
+source "${ABSEIL_ROOT}/ci/cmake_common.sh"
+
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_GCC_LATEST_CONTAINER}
+
+for link_type in ${LINK_TYPE}; do
+ time docker run \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp-ro,readonly \
--tmpfs=/buildfs:exec \
+ --tmpfs=/abseil-cpp:exec \
+ --workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
+ -e "ABSL_GOOGLETEST_COMMIT=${ABSL_GOOGLETEST_COMMIT}" \
+ -e "ABSL_GOOGLETEST_DOWNLOAD_URL=${ABSL_GOOGLETEST_DOWNLOAD_URL}" \
+ -e "LINK_TYPE=${link_type}" \
--rm \
- -e CFLAGS="-Werror" \
- -e CXXFLAGS="-Werror" \
- gcr.io/google.com/absl-177019/linux_gcc-latest:20200106 \
- /bin/bash CMake/install_test_project/test.sh $@
+ ${DOCKER_EXTRA_ARGS:-} \
+ ${DOCKER_CONTAINER} \
+ /bin/bash -c "cp -r /abseil-cpp-ro/* . && CMake/install_test_project/test.sh"
+done
diff --git a/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh b/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh
index 24efe3b7a0..5245933a5f 100644..100755
--- a/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh
+++ b/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_asan_bazel.sh
@@ -20,28 +20,29 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${STD:-} ]; then
- STD="c++11 c++14 c++17"
+if [[ -z ${STD:-} ]]; then
+ STD="c++11 c++14 c++17 c++20"
fi
-if [ -z ${COMPILATION_MODE:-} ]; then
+if [[ -z ${COMPILATION_MODE:-} ]]; then
COMPILATION_MODE="fastbuild opt"
fi
-if [ -z ${EXCEPTIONS_MODE:-} ]; then
+if [[ -z ${EXCEPTIONS_MODE:-} ]]; then
EXCEPTIONS_MODE="-fno-exceptions -fexceptions"
fi
-readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_clang-latest:20200102"
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_CLANG_LATEST_CONTAINER}
# 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:-}"
+if [[ ${USE_BAZEL_CACHE:-0} -ne 0 ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_KEYSTORE_DIR},target=/keystore,readonly ${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
@@ -50,17 +51,24 @@ if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then
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
+# Avoid depending on external sites like GitHub by checking --distdir for
+# external dependencies first.
+# https://docs.bazel.build/versions/master/guide.html#distdir
+if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -d "${KOKORO_GFILE_DIR}/distdir" ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_GFILE_DIR}/distdir,target=/distdir,readonly ${DOCKER_EXTRA_ARGS:-}"
+ BAZEL_EXTRA_ARGS="--distdir=/distdir ${BAZEL_EXTRA_ARGS:-}"
+fi
+
for std in ${STD}; do
for compilation_mode in ${COMPILATION_MODE}; do
for exceptions_mode in ${EXCEPTIONS_MODE}; do
echo "--------------------------------------------------------------------"
time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp:ro" \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp,readonly \
--workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
--rm \
-e CC="/opt/llvm/clang/bin/clang" \
- -e BAZEL_COMPILER="llvm" \
-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" \
@@ -69,15 +77,13 @@ for std in ${STD}; do
/usr/local/bin/bazel test ... \
--compilation_mode="${compilation_mode}" \
--copt="${exceptions_mode}" \
- --copt="-DDYNAMIC_ANNOTATIONS_ENABLED=1" \
- --copt="-DADDRESS_SANITIZER" \
- --copt="-DUNDEFINED_BEHAVIOR_SANITIZER" \
--copt="-fsanitize=address" \
--copt="-fsanitize=float-divide-by-zero" \
--copt="-fsanitize=nullability" \
--copt="-fsanitize=undefined" \
--copt="-fno-sanitize-blacklist" \
--copt=-Werror \
+ --distdir="/bazel-distdir" \
--keep_going \
--linkopt="-fsanitize=address" \
--linkopt="-fsanitize-link-c++-runtime" \
diff --git a/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh b/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh
index 127e7bc7b2..e0fe653de7 100644..100755
--- a/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh
+++ b/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_bazel.sh
@@ -20,28 +20,29 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${STD:-} ]; then
- STD="c++11 c++14 c++17"
+if [[ -z ${STD:-} ]]; then
+ STD="c++11 c++14 c++17 c++20"
fi
-if [ -z ${COMPILATION_MODE:-} ]; then
+if [[ -z ${COMPILATION_MODE:-} ]]; then
COMPILATION_MODE="fastbuild opt"
fi
-if [ -z ${EXCEPTIONS_MODE:-} ]; then
+if [[ -z ${EXCEPTIONS_MODE:-} ]]; then
EXCEPTIONS_MODE="-fno-exceptions -fexceptions"
fi
-readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_clang-latest:20200102"
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_CLANG_LATEST_CONTAINER}
# 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:-}"
+if [[ ${USE_BAZEL_CACHE:-0} -ne 0 ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_KEYSTORE_DIR},target=/keystore,readonly ${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
@@ -50,18 +51,25 @@ if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then
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
+# Avoid depending on external sites like GitHub by checking --distdir for
+# external dependencies first.
+# https://docs.bazel.build/versions/master/guide.html#distdir
+if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -d "${KOKORO_GFILE_DIR}/distdir" ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_GFILE_DIR}/distdir,target=/distdir,readonly ${DOCKER_EXTRA_ARGS:-}"
+ BAZEL_EXTRA_ARGS="--distdir=/distdir ${BAZEL_EXTRA_ARGS:-}"
+fi
+
for std in ${STD}; do
for compilation_mode in ${COMPILATION_MODE}; do
for exceptions_mode in ${EXCEPTIONS_MODE}; do
echo "--------------------------------------------------------------------"
time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp-ro:ro" \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp-ro,readonly \
--tmpfs=/abseil-cpp \
--workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
--rm \
-e CC="/opt/llvm/clang/bin/clang" \
- -e BAZEL_COMPILER="llvm" \
-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" \
@@ -77,6 +85,7 @@ for std in ${STD}; do
--copt=\"${exceptions_mode}\" \
--copt=-Werror \
--define=\"absl=1\" \
+ --distdir=\"/bazel-distdir\" \
--keep_going \
--show_timestamps \
--test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \
diff --git a/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh b/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh
index 00257b36ad..555f6b1c2a 100644..100755
--- a/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh
+++ b/third_party/abseil-cpp/ci/linux_clang-latest_libcxx_tsan_bazel.sh
@@ -20,28 +20,29 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${STD:-} ]; then
- STD="c++11 c++14 c++17"
+if [[ -z ${STD:-} ]]; then
+ STD="c++11 c++14 c++17 c++20"
fi
-if [ -z ${COMPILATION_MODE:-} ]; then
+if [[ -z ${COMPILATION_MODE:-} ]]; then
COMPILATION_MODE="fastbuild opt"
fi
-if [ -z ${EXCEPTIONS_MODE:-} ]; then
+if [[ -z ${EXCEPTIONS_MODE:-} ]]; then
EXCEPTIONS_MODE="-fno-exceptions -fexceptions"
fi
-readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_clang-latest:20200102"
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_CLANG_LATEST_CONTAINER}
# 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:-}"
+if [[ ${USE_BAZEL_CACHE:-0} -ne 0 ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_KEYSTORE_DIR},target=/keystore,readonly ${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
@@ -50,17 +51,24 @@ if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then
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
+# Avoid depending on external sites like GitHub by checking --distdir for
+# external dependencies first.
+# https://docs.bazel.build/versions/master/guide.html#distdir
+if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -d "${KOKORO_GFILE_DIR}/distdir" ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_GFILE_DIR}/distdir,target=/distdir,readonly ${DOCKER_EXTRA_ARGS:-}"
+ BAZEL_EXTRA_ARGS="--distdir=/distdir ${BAZEL_EXTRA_ARGS:-}"
+fi
+
for std in ${STD}; do
for compilation_mode in ${COMPILATION_MODE}; do
for exceptions_mode in ${EXCEPTIONS_MODE}; do
echo "--------------------------------------------------------------------"
time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp:ro" \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp,readonly \
--workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
--rm \
-e CC="/opt/llvm/clang/bin/clang" \
- -e BAZEL_COMPILER="llvm" \
-e BAZEL_CXXOPTS="-std=${std}:-nostdinc++" \
-e BAZEL_LINKOPTS="-L/opt/llvm/libcxx-tsan/lib:-lc++:-lc++abi:-lm:-Wl,-rpath=/opt/llvm/libcxx-tsan/lib" \
-e CPLUS_INCLUDE_PATH="/opt/llvm/libcxx-tsan/include/c++/v1" \
@@ -70,11 +78,10 @@ for std in ${STD}; do
--build_tag_filters="-notsan" \
--compilation_mode="${compilation_mode}" \
--copt="${exceptions_mode}" \
- --copt="-DDYNAMIC_ANNOTATIONS_ENABLED=1" \
- --copt="-DTHREAD_SANITIZER" \
--copt="-fsanitize=thread" \
--copt="-fno-sanitize-blacklist" \
--copt=-Werror \
+ --distdir="/bazel-distdir" \
--keep_going \
--linkopt="-fsanitize=thread" \
--show_timestamps \
diff --git a/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh b/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh
index 9fe71d3760..36fdf82c1d 100644..100755
--- a/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh
+++ b/third_party/abseil-cpp/ci/linux_clang-latest_libstdcxx_bazel.sh
@@ -20,28 +20,29 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${STD:-} ]; then
+if [[ -z ${STD:-} ]]; then
STD="c++11 c++14 c++17"
fi
-if [ -z ${COMPILATION_MODE:-} ]; then
+if [[ -z ${COMPILATION_MODE:-} ]]; then
COMPILATION_MODE="fastbuild opt"
fi
-if [ -z ${EXCEPTIONS_MODE:-} ]; then
+if [[ -z ${EXCEPTIONS_MODE:-} ]]; then
EXCEPTIONS_MODE="-fno-exceptions -fexceptions"
fi
-readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_clang-latest:20200102"
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_CLANG_LATEST_CONTAINER}
# 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:-}"
+if [[ ${USE_BAZEL_CACHE:-0} -ne 0 ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_KEYSTORE_DIR},target=/keystore,readonly ${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
@@ -50,27 +51,36 @@ if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then
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
+# Avoid depending on external sites like GitHub by checking --distdir for
+# external dependencies first.
+# https://docs.bazel.build/versions/master/guide.html#distdir
+if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -d "${KOKORO_GFILE_DIR}/distdir" ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_GFILE_DIR}/distdir,target=/distdir,readonly ${DOCKER_EXTRA_ARGS:-}"
+ BAZEL_EXTRA_ARGS="--distdir=/distdir ${BAZEL_EXTRA_ARGS:-}"
+fi
+
for std in ${STD}; do
for compilation_mode in ${COMPILATION_MODE}; do
for exceptions_mode in ${EXCEPTIONS_MODE}; do
echo "--------------------------------------------------------------------"
time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp:ro" \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp,readonly \
--workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
--rm \
-e CC="/opt/llvm/clang/bin/clang" \
- -e BAZEL_COMPILER="llvm" \
-e BAZEL_CXXOPTS="-std=${std}" \
- -e CPLUS_INCLUDE_PATH="/usr/include/c++/6" \
${DOCKER_EXTRA_ARGS:-} \
${DOCKER_CONTAINER} \
/usr/local/bin/bazel test ... \
--compilation_mode="${compilation_mode}" \
+ --copt="--gcc-toolchain=/usr/local" \
--copt="${exceptions_mode}" \
--copt=-Werror \
--define="absl=1" \
+ --distdir="/bazel-distdir" \
--keep_going \
+ --linkopt="--gcc-toolchain=/usr/local" \
--show_timestamps \
--test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \
--test_env="TZDIR=/abseil-cpp/absl/time/internal/cctz/testdata/zoneinfo" \
diff --git a/third_party/abseil-cpp/ci/linux_docker_containers.sh b/third_party/abseil-cpp/ci/linux_docker_containers.sh
new file mode 100644
index 0000000000..32865b8348
--- /dev/null
+++ b/third_party/abseil-cpp/ci/linux_docker_containers.sh
@@ -0,0 +1,21 @@
+# Copyright 2019 The Abseil Authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# The file contains Docker container identifiers currently used by test scripts.
+# Test scripts should source this file to get the identifiers.
+
+readonly LINUX_ALPINE_CONTAINER="gcr.io/google.com/absl-177019/alpine:20201026"
+readonly LINUX_CLANG_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210617"
+readonly LINUX_GCC_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20210617"
+readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20210617"
diff --git a/third_party/abseil-cpp/ci/linux_gcc-4.9_libstdcxx_bazel.sh b/third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh
index f8102cc0a1..54ab68a37e 100644..100755
--- a/third_party/abseil-cpp/ci/linux_gcc-4.9_libstdcxx_bazel.sh
+++ b/third_party/abseil-cpp/ci/linux_gcc-floor_libstdcxx_bazel.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright 2019 The Abseil Authors.
+# Copyright 2020 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,27 +20,28 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${STD:-} ]; then
+if [[ -z ${STD:-} ]]; then
STD="c++11 c++14"
fi
-if [ -z ${COMPILATION_MODE:-} ]; then
+if [[ -z ${COMPILATION_MODE:-} ]]; then
COMPILATION_MODE="fastbuild opt"
fi
-if [ -z ${EXCEPTIONS_MODE:-} ]; then
+if [[ -z ${EXCEPTIONS_MODE:-} ]]; then
EXCEPTIONS_MODE="-fno-exceptions -fexceptions"
fi
-readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-4.9:20191018"
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_GCC_FLOOR_CONTAINER}
# 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
+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
@@ -50,6 +51,14 @@ if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then
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
+# Avoid depending on external sites like GitHub by checking --distdir for
+# external dependencies first.
+# https://docs.bazel.build/versions/master/guide.html#distdir
+if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -d "${KOKORO_GFILE_DIR}/distdir" ]]; then
+ DOCKER_EXTRA_ARGS="--volume=${KOKORO_GFILE_DIR}/distdir:/distdir:ro ${DOCKER_EXTRA_ARGS:-}"
+ BAZEL_EXTRA_ARGS="--distdir=/distdir ${BAZEL_EXTRA_ARGS:-}"
+fi
+
for std in ${STD}; do
for compilation_mode in ${COMPILATION_MODE}; do
for exceptions_mode in ${EXCEPTIONS_MODE}; do
@@ -59,7 +68,7 @@ for std in ${STD}; do
--workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
--rm \
- -e CC="/usr/bin/gcc-4.9" \
+ -e CC="/usr/local/bin/gcc" \
-e BAZEL_CXXOPTS="-std=${std}" \
${DOCKER_EXTRA_ARGS:-} \
${DOCKER_CONTAINER} \
@@ -68,6 +77,7 @@ for std in ${STD}; do
--copt="${exceptions_mode}" \
--copt=-Werror \
--define="absl=1" \
+ --distdir="/bazel-distdir" \
--keep_going \
--show_timestamps \
--test_env="GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1" \
diff --git a/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh b/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh
index 59647031f8..0555ecedb5 100644..100755
--- a/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh
+++ b/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_bazel.sh
@@ -20,28 +20,29 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${STD:-} ]; then
- STD="c++11 c++14 c++17"
+if [[ -z ${STD:-} ]]; then
+ STD="c++11 c++14 c++17 c++20"
fi
-if [ -z ${COMPILATION_MODE:-} ]; then
+if [[ -z ${COMPILATION_MODE:-} ]]; then
COMPILATION_MODE="fastbuild opt"
fi
-if [ -z ${EXCEPTIONS_MODE:-} ]; then
+if [[ -z ${EXCEPTIONS_MODE:-} ]]; then
EXCEPTIONS_MODE="-fno-exceptions -fexceptions"
fi
-readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-latest:20200106"
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_GCC_LATEST_CONTAINER}
# 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:-}"
+if [[ ${USE_BAZEL_CACHE:-0} -ne 0 ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_KEYSTORE_DIR},target=/keystore,readonly ${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
@@ -50,12 +51,20 @@ if [ ${USE_BAZEL_CACHE:-0} -ne 0 ]; then
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
+# Avoid depending on external sites like GitHub by checking --distdir for
+# external dependencies first.
+# https://docs.bazel.build/versions/master/guide.html#distdir
+if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -d "${KOKORO_GFILE_DIR}/distdir" ]]; then
+ DOCKER_EXTRA_ARGS="--mount type=bind,source=${KOKORO_GFILE_DIR}/distdir,target=/distdir,readonly ${DOCKER_EXTRA_ARGS:-}"
+ BAZEL_EXTRA_ARGS="--distdir=/distdir ${BAZEL_EXTRA_ARGS:-}"
+fi
+
for std in ${STD}; do
for compilation_mode in ${COMPILATION_MODE}; do
for exceptions_mode in ${EXCEPTIONS_MODE}; do
echo "--------------------------------------------------------------------"
time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp-ro:ro" \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp-ro,readonly \
--tmpfs=/abseil-cpp \
--workdir=/abseil-cpp \
--cap-add=SYS_PTRACE \
@@ -74,6 +83,7 @@ for std in ${STD}; do
--copt=\"${exceptions_mode}\" \
--copt=-Werror \
--define=\"absl=1\" \
+ --distdir=\"/bazel-distdir\" \
--keep_going \
--show_timestamps \
--test_env=\"GTEST_INSTALL_FAILURE_SIGNAL_HANDLER=1\" \
diff --git a/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh b/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh
index 38ad99f7ef..ab06aa0574 100644..100755
--- a/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh
+++ b/third_party/abseil-cpp/ci/linux_gcc-latest_libstdcxx_cmake.sh
@@ -14,48 +14,52 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# TODO(absl-team): This script isn't fully hermetic because
-# -DABSL_USE_GOOGLETEST_HEAD=ON means that this script isn't pinned to a fixed
-# version of GoogleTest. This means that an upstream change to GoogleTest could
-# break this test. Fix this by allowing this script to pin to a known-good
-# version of GoogleTest.
-
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${ABSL_CMAKE_CXX_STANDARDS:-} ]; then
- ABSL_CMAKE_CXX_STANDARDS="11 14 17"
+source "${ABSEIL_ROOT}/ci/cmake_common.sh"
+
+if [[ -z ${ABSL_CMAKE_CXX_STANDARDS:-} ]]; then
+ ABSL_CMAKE_CXX_STANDARDS="11 14 17 20"
fi
-if [ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]; then
+if [[ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]]; then
ABSL_CMAKE_BUILD_TYPES="Debug Release"
fi
+if [[ -z ${ABSL_CMAKE_BUILD_SHARED:-} ]]; then
+ ABSL_CMAKE_BUILD_SHARED="OFF ON"
+fi
+
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_GCC_LATEST_CONTAINER}
+
for std in ${ABSL_CMAKE_CXX_STANDARDS}; do
for compilation_mode in ${ABSL_CMAKE_BUILD_TYPES}; do
- echo "--------------------------------------------------------------------"
- echo "Testing with CMAKE_BUILD_TYPE=${compilation_mode} and -std=c++${std}"
-
- time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp:ro" \
- --workdir=/abseil-cpp \
- --tmpfs=/buildfs:exec \
- --cap-add=SYS_PTRACE \
- --rm \
- -e CFLAGS="-Werror" \
- -e CXXFLAGS="-Werror" \
- gcr.io/google.com/absl-177019/linux_gcc-latest:20200106 \
- /bin/bash -c "
- cd /buildfs && \
- cmake /abseil-cpp \
- -DABSL_USE_GOOGLETEST_HEAD=ON \
- -DABSL_RUN_TESTS=ON \
- -DCMAKE_BUILD_TYPE=${compilation_mode} \
- -DCMAKE_CXX_STANDARD=${std} && \
- make -j$(nproc) && \
- ctest -j$(nproc) --output-on-failure"
+ for build_shared in ${ABSL_CMAKE_BUILD_SHARED}; do
+ time docker run \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp,readonly \
+ --tmpfs=/buildfs:exec \
+ --workdir=/buildfs \
+ --cap-add=SYS_PTRACE \
+ --rm \
+ -e CFLAGS="-Werror" \
+ -e CXXFLAGS="-Werror" \
+ ${DOCKER_EXTRA_ARGS:-} \
+ "${DOCKER_CONTAINER}" \
+ /bin/bash -c "
+ cmake /abseil-cpp \
+ -DABSL_GOOGLETEST_DOWNLOAD_URL=${ABSL_GOOGLETEST_DOWNLOAD_URL} \
+ -DBUILD_SHARED_LIBS=${build_shared} \
+ -DBUILD_TESTING=ON \
+ -DCMAKE_BUILD_TYPE=${compilation_mode} \
+ -DCMAKE_CXX_STANDARD=${std} \
+ -DCMAKE_MODULE_LINKER_FLAGS=\"-Wl,--no-undefined\" && \
+ make -j$(nproc) && \
+ ctest -j$(nproc) --output-on-failure"
+ done
done
done
diff --git a/third_party/abseil-cpp/ci/linux_gcc_alpine_cmake.sh b/third_party/abseil-cpp/ci/linux_gcc_alpine_cmake.sh
index 830a1360a3..bce27d295f 100644..100755
--- a/third_party/abseil-cpp/ci/linux_gcc_alpine_cmake.sh
+++ b/third_party/abseil-cpp/ci/linux_gcc_alpine_cmake.sh
@@ -14,50 +14,51 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# TODO(absl-team): This script isn't fully hermetic because
-# -DABSL_USE_GOOGLETEST_HEAD=ON means that this script isn't pinned to a fixed
-# version of GoogleTest. This means that an upstream change to GoogleTest could
-# break this test. Fix this by allowing this script to pin to a known-good
-# version of GoogleTest.
-
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
-if [ -z ${ABSL_CMAKE_CXX_STANDARDS:-} ]; then
+source "${ABSEIL_ROOT}/ci/cmake_common.sh"
+
+if [[ -z ${ABSL_CMAKE_CXX_STANDARDS:-} ]]; then
ABSL_CMAKE_CXX_STANDARDS="11 14 17"
fi
-if [ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]; then
+if [[ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]]; then
ABSL_CMAKE_BUILD_TYPES="Debug Release"
fi
-readonly DOCKER_CONTAINER="gcr.io/google.com/absl-177019/alpine:20191016"
+if [[ -z ${ABSL_CMAKE_BUILD_SHARED:-} ]]; then
+ ABSL_CMAKE_BUILD_SHARED="OFF ON"
+fi
+
+source "${ABSEIL_ROOT}/ci/linux_docker_containers.sh"
+readonly DOCKER_CONTAINER=${LINUX_ALPINE_CONTAINER}
for std in ${ABSL_CMAKE_CXX_STANDARDS}; do
for compilation_mode in ${ABSL_CMAKE_BUILD_TYPES}; do
- echo "--------------------------------------------------------------------"
- echo "Testing with CMAKE_BUILD_TYPE=${compilation_mode} and -std=c++${std}"
-
- time docker run \
- --volume="${ABSEIL_ROOT}:/abseil-cpp:ro" \
- --workdir=/abseil-cpp \
- --tmpfs=/buildfs:exec \
- --cap-add=SYS_PTRACE \
- --rm \
- -e CFLAGS="-Werror" \
- -e CXXFLAGS="-Werror" \
- "${DOCKER_CONTAINER}" \
- /bin/sh -c "
- cd /buildfs && \
- cmake /abseil-cpp \
- -DABSL_USE_GOOGLETEST_HEAD=ON \
- -DABSL_RUN_TESTS=ON \
- -DCMAKE_BUILD_TYPE=${compilation_mode} \
- -DCMAKE_CXX_STANDARD=${std} && \
- make -j$(nproc) && \
- ctest -j$(nproc) --output-on-failure"
+ for build_shared in ${ABSL_CMAKE_BUILD_SHARED}; do
+ time docker run \
+ --mount type=bind,source="${ABSEIL_ROOT}",target=/abseil-cpp,readonly \
+ --tmpfs=/buildfs:exec \
+ --workdir=/buildfs \
+ --cap-add=SYS_PTRACE \
+ --rm \
+ -e CFLAGS="-Werror" \
+ -e CXXFLAGS="-Werror" \
+ ${DOCKER_EXTRA_ARGS:-} \
+ "${DOCKER_CONTAINER}" \
+ /bin/sh -c "
+ cmake /abseil-cpp \
+ -DABSL_GOOGLETEST_DOWNLOAD_URL=${ABSL_GOOGLETEST_DOWNLOAD_URL} \
+ -DBUILD_TESTING=ON \
+ -DCMAKE_BUILD_TYPE=${compilation_mode} \
+ -DCMAKE_CXX_STANDARD=${std} \
+ -DCMAKE_MODULE_LINKER_FLAGS=\"-Wl,--no-undefined\" && \
+ make -j$(nproc) && \
+ ctest -j$(nproc) --output-on-failure"
+ done
done
done
diff --git a/third_party/abseil-cpp/ci/macos_xcode_bazel.sh b/third_party/abseil-cpp/ci/macos_xcode_bazel.sh
index f5f2d759cf..9e14e66039 100644..100755
--- a/third_party/abseil-cpp/ci/macos_xcode_bazel.sh
+++ b/third_party/abseil-cpp/ci/macos_xcode_bazel.sh
@@ -19,13 +19,13 @@
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(realpath $(dirname ${0})/..)"
fi
# If we are running on Kokoro, check for a versioned Bazel binary.
-KOKORO_GFILE_BAZEL_BIN="bazel-2.0.0-darwin-x86_64"
-if [ ${KOKORO_GFILE_DIR:-} ] && [ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]; then
+KOKORO_GFILE_BAZEL_BIN="bazel-3.7.0-darwin-x86_64"
+if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then
BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}"
chmod +x ${BAZEL_BIN}
else
@@ -41,7 +41,7 @@ echo "---------------"
cd ${ABSEIL_ROOT}
-if [ -n "${ALTERNATE_OPTIONS:-}" ]; then
+if [[ -n "${ALTERNATE_OPTIONS:-}" ]]; then
cp ${ALTERNATE_OPTIONS:-} absl/base/options.h || exit 1
fi
diff --git a/third_party/abseil-cpp/ci/macos_xcode_cmake.sh b/third_party/abseil-cpp/ci/macos_xcode_cmake.sh
index a1f4a857be..2a870cf4e9 100644..100755
--- a/third_party/abseil-cpp/ci/macos_xcode_cmake.sh
+++ b/third_party/abseil-cpp/ci/macos_xcode_cmake.sh
@@ -14,31 +14,43 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# This script is invoked on Kokoro to test Abseil on macOS.
-# It is not hermetic and may break when Kokoro is updated.
-
set -euox pipefail
-if [ -z ${ABSEIL_ROOT:-} ]; then
+if [[ -z ${ABSEIL_ROOT:-} ]]; then
ABSEIL_ROOT="$(dirname ${0})/.."
fi
ABSEIL_ROOT=$(realpath ${ABSEIL_ROOT})
-if [ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]; then
+source "${ABSEIL_ROOT}/ci/cmake_common.sh"
+
+# The MacOS build doesn't run in a docker container, so we have to override ABSL_GOOGLETEST_DOWNLOAD_URL.
+if [[ -r "${KOKORO_GFILE_DIR}/distdir/${ABSL_GOOGLETEST_COMMIT}.zip" ]]; then
+ ABSL_GOOGLETEST_DOWNLOAD_URL="file://${KOKORO_GFILE_DIR}/distdir/${ABSL_GOOGLETEST_COMMIT}.zip"
+fi
+
+if [[ -z ${ABSL_CMAKE_BUILD_TYPES:-} ]]; then
ABSL_CMAKE_BUILD_TYPES="Debug"
fi
+if [[ -z ${ABSL_CMAKE_BUILD_SHARED:-} ]]; then
+ ABSL_CMAKE_BUILD_SHARED="OFF ON"
+fi
+
for compilation_mode in ${ABSL_CMAKE_BUILD_TYPES}; do
- BUILD_DIR=$(mktemp -d ${compilation_mode}.XXXXXXXX)
- cd ${BUILD_DIR}
-
- # TODO(absl-team): Enable -Werror once all warnings are fixed.
- time cmake ${ABSEIL_ROOT} \
- -GXcode \
- -DCMAKE_BUILD_TYPE=${compilation_mode} \
- -DCMAKE_CXX_STANDARD=11 \
- -DABSL_USE_GOOGLETEST_HEAD=ON \
- -DABSL_RUN_TESTS=ON
- time cmake --build .
- time ctest -C ${compilation_mode} --output-on-failure
+ for build_shared in ${ABSL_CMAKE_BUILD_SHARED}; do
+ BUILD_DIR=$(mktemp -d ${compilation_mode}.XXXXXXXX)
+ cd ${BUILD_DIR}
+
+ # TODO(absl-team): Enable -Werror once all warnings are fixed.
+ time cmake ${ABSEIL_ROOT} \
+ -GXcode \
+ -DBUILD_SHARED_LIBS=${build_shared} \
+ -DBUILD_TESTING=ON \
+ -DCMAKE_BUILD_TYPE=${compilation_mode} \
+ -DCMAKE_CXX_STANDARD=11 \
+ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--no-undefined" \
+ -DABSL_GOOGLETEST_DOWNLOAD_URL="${ABSL_GOOGLETEST_DOWNLOAD_URL}"
+ time cmake --build .
+ time ctest -C ${compilation_mode} --output-on-failure
+ done
done