Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit df0f077

Browse files
authored
ci: configs for clang-3.8 and gcc-4.8 builds (#253)
Just more builds, these are important because some of the other projects have them, and they break when a new release of `-common` cannot compile with those compilers. We just had that happen with `-pubsub`. There are some formatting changes triggered by the double braces, I chose not to argue with clang-format (I never do).
1 parent 3d5fe45 commit df0f077

File tree

9 files changed

+62
-10
lines changed

9 files changed

+62
-10
lines changed

ci/kokoro/docker/Dockerfile.centos

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG DISTRO_VERSION=7
16+
FROM centos:${DISTRO_VERSION}
17+
18+
# We need to install cmake3, which on CentOS-7 requires an extra source
19+
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
20+
RUN yum install -y centos-release-scl
21+
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
22+
23+
RUN yum makecache && \
24+
yum install -y automake cmake3 curl-devel gcc gcc-c++ git libtool \
25+
make openssl-devel pkgconfig tar wget which zlib-devel
26+
RUN ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest

ci/kokoro/docker/Dockerfile.ubuntu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ FROM ubuntu:${DISTRO_VERSION}
1717

1818
RUN apt-get update && \
1919
apt-get --no-install-recommends install -y \
20-
abi-compliance-checker \
21-
abi-dumper \
2220
apt-transport-https \
2321
apt-utils \
2422
automake \
@@ -28,13 +26,11 @@ RUN apt-get update && \
2826
clang \
2927
cmake \
3028
curl \
31-
ctags \
3229
doxygen \
3330
gawk \
3431
git \
3532
gcc \
3633
g++ \
37-
cmake \
3834
libssl-dev \
3935
libtool \
4036
lsb-release \

ci/kokoro/docker/build.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,26 @@ elif [[ "${BUILD_NAME}" = "scan-build" ]]; then
168168
export CC=clang
169169
export CXX=clang++
170170
export SCAN_BUILD=yes
171+
elif [[ "${BUILD_NAME}" = "gcc-4.8" ]]; then
172+
# The oldest version of GCC we support is 4.8, this build checks the code
173+
# against that version. The use of CentOS 7 for that build is not a
174+
# coincidence: the reason we support GCC 4.8 is to support this distribution
175+
# (and its commercial cousin: RHEL 7).
176+
export DISTRO=centos
177+
export DISTRO_VERSION=7
178+
export CMAKE_SOURCE_DIR="super"
179+
in_docker_script="ci/kokoro/docker/build-in-docker-cmake.sh"
180+
elif [[ "${BUILD_NAME}" = "clang-3.8" ]]; then
181+
# The oldest version of Clang we actively test is 3.8. There is nothing
182+
# particularly interesting about that version. It is simply the version
183+
# included with Ubuntu:16.04, and the oldest version tested by
184+
# google-cloud-cpp-common.
185+
export DISTRO=ubuntu
186+
export DISTRO_VERSION=16.04
187+
export CC=clang
188+
export CXX=clang++
189+
export CMAKE_SOURCE_DIR="super"
190+
in_docker_script="ci/kokoro/docker/build-in-docker-cmake.sh"
171191
elif [[ "${BUILD_NAME}" = "cxx17" ]]; then
172192
export GOOGLE_CLOUD_CPP_CXX_STANDARD=17
173193
export TEST_INSTALL=yes
@@ -237,6 +257,7 @@ docker_build_flags=(
237257
# upload it.
238258
"-t" "${IMAGE}:latest"
239259
"--build-arg" "NCPU=${NCPU}"
260+
"--build-arg" "DISTRO_VERSION=${DISTRO_VERSION}"
240261
"-f" "ci/kokoro/docker/Dockerfile.${DISTRO}"
241262
)
242263

ci/kokoro/docker/clang-3.8-presubmit.cfg

Whitespace-only changes.

ci/kokoro/docker/clang-3.8.cfg

Whitespace-only changes.

ci/kokoro/docker/gcc-4.8-presubmit.cfg

Whitespace-only changes.

ci/kokoro/docker/gcc-4.8.cfg

Whitespace-only changes.

google/cloud/internal/parse_rfc3339.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ std::chrono::system_clock::time_point ParseDateTime(
6767
ReportError(timestamp, "Invalid date-time separator, expected 'T' or 't'.");
6868
}
6969

70-
std::array<int, kMonthsInYear> constexpr kMaxDaysInMonth{
70+
// Double braces are needed to workaround a clang-3.8 bug.
71+
std::array<int, kMonthsInYear> constexpr kMaxDaysInMonth{{
7172
31, // January
7273
29, // February (non-leap years checked below)
7374
31, // March
@@ -80,7 +81,7 @@ std::chrono::system_clock::time_point ParseDateTime(
8081
31, // October
8182
30, // November
8283
31, // December
83-
};
84+
}};
8485
auto constexpr kMkTimeBaseYear = 1900;
8586
if (month < 1 || month > kMonthsInYear) {
8687
ReportError(timestamp, "Out of range month.");

google/cloud/log.cc

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,18 @@ static_assert(static_cast<int>(Severity::GCP_LS_LOWEST) <
2929
std::ostream& operator<<(std::ostream& os, Severity x) {
3030
auto constexpr kSeverityCount =
3131
static_cast<int>(Severity::GCP_LS_HIGHEST) + 1;
32-
std::array<char const*, kSeverityCount> names{
33-
"TRACE", "DEBUG", "INFO", "NOTICE", "WARNING",
34-
"ERROR", "CRITICAL", "ALERT", "FATAL",
35-
};
32+
// Double braces needed to workaround a clang-3.8 bug.
33+
std::array<char const*, kSeverityCount> names{{
34+
"TRACE",
35+
"DEBUG",
36+
"INFO",
37+
"NOTICE",
38+
"WARNING",
39+
"ERROR",
40+
"CRITICAL",
41+
"ALERT",
42+
"FATAL",
43+
}};
3644
auto index = static_cast<int>(x);
3745
return os << names[index];
3846
}

0 commit comments

Comments
 (0)