31
31
32
32
set -euox pipefail
33
33
34
- readonly LINUX_LATEST_CONTAINER=" gcr.io/google.com/absl-177019/linux_hybrid-latest:20241218 "
35
- readonly LINUX_GCC_FLOOR_CONTAINER=" gcr.io/google.com/absl-177019/linux_gcc-floor:20250205 "
34
+ readonly LINUX_LATEST_CONTAINER=" gcr.io/google.com/absl-177019/linux_hybrid-latest:20250430 "
35
+ readonly LINUX_GCC_FLOOR_CONTAINER=" gcr.io/google.com/absl-177019/linux_gcc-floor:20250430 "
36
36
37
37
if [[ -z ${GTEST_ROOT:- } ]]; then
38
38
GTEST_ROOT=" $( realpath $( dirname ${0} ) /..) "
39
39
fi
40
40
41
+ # Use Bazel Vendor mode to reduce reliance on external dependencies.
42
+ # See https://bazel.build/external/vendor and the Dockerfile for
43
+ # an explaination of how this works.
44
+ if [[ ${KOKORO_GFILE_DIR:- } ]] && [[ -f " ${KOKORO_GFILE_DIR} /distdir/googletest_vendor.tar.gz" ]]; then
45
+ DOCKER_EXTRA_ARGS=" --mount type=bind,source=${KOKORO_GFILE_DIR} /distdir,target=/distdir,readonly --env=BAZEL_VENDOR_ARCHIVE=/distdir/googletest_vendor.tar.gz ${DOCKER_EXTRA_ARGS:- } "
46
+ BAZEL_EXTRA_ARGS=" --vendor_dir=/googletest_vendor ${BAZEL_EXTRA_ARGS:- } "
47
+ fi
48
+
41
49
if [[ -z ${STD:- } ]]; then
42
- STD=" c++17 c++20"
50
+ STD=" c++17 c++20 c++23 "
43
51
fi
44
52
45
53
# Test CMake + GCC
@@ -93,18 +101,21 @@ time docker run \
93
101
--rm \
94
102
--env=" CC=/usr/local/bin/gcc" \
95
103
--env=" BAZEL_CXXOPTS=-std=c++17" \
104
+ ${DOCKER_EXTRA_ARGS:- } \
96
105
${LINUX_GCC_FLOOR_CONTAINER} \
106
+ /bin/bash --login -c "
97
107
/usr/local/bin/bazel test ... \
98
- --copt=" -Wall" \
99
- --copt=" -Werror" \
100
- --copt=" -Wuninitialized" \
101
- --copt=" -Wundef" \
102
- --copt=" -Wno-error=pragmas" \
108
+ --copt=\ " -Wall\ " \
109
+ --copt=\ " -Werror\ " \
110
+ --copt=\ " -Wuninitialized\ " \
111
+ --copt=\ " -Wundef\ " \
112
+ --copt=\ " -Wno-error=pragmas\ " \
103
113
--enable_bzlmod=false \
104
114
--features=external_include_paths \
105
115
--keep_going \
106
116
--show_timestamps \
107
- --test_output=errors
117
+ --test_output=errors \
118
+ ${BAZEL_EXTRA_ARGS:- } "
108
119
109
120
# Test GCC
110
121
for std in ${STD} ; do
@@ -115,18 +126,21 @@ for std in ${STD}; do
115
126
--rm \
116
127
--env=" CC=/usr/local/bin/gcc" \
117
128
--env=" BAZEL_CXXOPTS=-std=${std} " \
129
+ ${DOCKER_EXTRA_ARGS:- } \
118
130
${LINUX_LATEST_CONTAINER} \
119
- /usr/local/bin/bazel test ... \
120
- --copt=" -Wall" \
121
- --copt=" -Werror" \
122
- --copt=" -Wuninitialized" \
123
- --copt=" -Wundef" \
124
- --define=" absl=${absl} " \
125
- --enable_bzlmod=true \
126
- --features=external_include_paths \
127
- --keep_going \
128
- --show_timestamps \
129
- --test_output=errors
131
+ /bin/bash --login -c "
132
+ /usr/local/bin/bazel test ... \
133
+ --copt=\" -Wall\" \
134
+ --copt=\" -Werror\" \
135
+ --copt=\" -Wuninitialized\" \
136
+ --copt=\" -Wundef\" \
137
+ --define=\" absl=${absl} \" \
138
+ --enable_bzlmod=true \
139
+ --features=external_include_paths \
140
+ --keep_going \
141
+ --show_timestamps \
142
+ --test_output=errors \
143
+ ${BAZEL_EXTRA_ARGS:- } "
130
144
done
131
145
done
132
146
@@ -139,19 +153,22 @@ for std in ${STD}; do
139
153
--rm \
140
154
--env=" CC=/opt/llvm/clang/bin/clang" \
141
155
--env=" BAZEL_CXXOPTS=-std=${std} " \
156
+ ${DOCKER_EXTRA_ARGS:- } \
142
157
${LINUX_LATEST_CONTAINER} \
143
- /usr/local/bin/bazel test ... \
144
- --copt=" --gcc-toolchain=/usr/local" \
145
- --copt=" -Wall" \
146
- --copt=" -Werror" \
147
- --copt=" -Wuninitialized" \
148
- --copt=" -Wundef" \
149
- --define=" absl=${absl} " \
150
- --enable_bzlmod=true \
151
- --features=external_include_paths \
152
- --keep_going \
153
- --linkopt=" --gcc-toolchain=/usr/local" \
154
- --show_timestamps \
155
- --test_output=errors
158
+ /bin/bash --login -c "
159
+ /usr/local/bin/bazel test ... \
160
+ --copt=\" --gcc-toolchain=/usr/local\" \
161
+ --copt=\" -Wall\" \
162
+ --copt=\" -Werror\" \
163
+ --copt=\" -Wuninitialized\" \
164
+ --copt=\" -Wundef\" \
165
+ --define=\" absl=${absl} \" \
166
+ --enable_bzlmod=true \
167
+ --features=external_include_paths \
168
+ --keep_going \
169
+ --linkopt=\" --gcc-toolchain=/usr/local\" \
170
+ --show_timestamps \
171
+ --test_output=errors \
172
+ ${BAZEL_EXTRA_ARGS:- } "
156
173
done
157
174
done
0 commit comments