Skip to content

Commit

Permalink
chore!: updates as Debian 9 (Stretch) is EOL (#9405)
Browse files Browse the repository at this point in the history
Debian 9 (Stretch) reached EOL on 2022-06-30. Therefore, we have stopped
testing or supporting this distribution. This was the last distribution
we supported that required GCC < 7.3, and/or CMake < 3.10. Starting with
this release we require GCC >= 7.3 and CMake >= 3.10.

This PR updates the documentation, CI builds and fixes some test problems
that only show up with GCC circa 7.3
  • Loading branch information
coryan authored Jul 1, 2022
1 parent 548f0f1 commit b843e9e
Show file tree
Hide file tree
Showing 196 changed files with 423 additions and 821 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ transition to C++ >= 14 we will, if requested, backport critical fixes to
v1.42.0 until 2023-07-01. After 2023-07-01 we will drop all support to v1.42.0
and earlier versions.

**Debian 9 (Stretch) is EOL**

Debian 9 (Stretch) reached EOL on 2022-06-30. Therefore, we have stopped testing
or supporting this distribution. This was the last distribution we supported
that required GCC < 7.3, and/or CMake < 3.10. Starting with this release we
require CMake >= 3.10, and only test with GCC >= 7.3.

**OTHER CHANGES**

We are introducing a new client library. While we do not anticipate any API
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
# ~~~

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.10)

# Define the project name and where to report bugs.
set(PACKAGE_BUGREPORT "https://github.com/googleapis/google-cloud-cpp/issues")
Expand Down Expand Up @@ -44,9 +44,9 @@ if (APPLE AND NOT DEFINED CMAKE_CXX_STANDARD)
endif ()

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.3)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.3)
message(
WARNING "The `google-cloud-cpp` library is tested with GCC >= 6.3."
WARNING "The `google-cloud-cpp` library is tested with GCC >= 7.3."
" We will consider patches for older versions.")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ int main(int argc, char* argv[]) {
## Support
* This project supports Windows, macOS, Linux
* This project supports C++14 (and higher) compilers (we test with GCC >= 6.3,
* This project supports C++14 (and higher) compilers (we test with GCC >= 7.3,
Clang >= 6.0, and MSVC >= 2017)
* This project supports Bazel (>= 4.0) and CMake (>= 3.5) builds. See the
[Quickstart examples](https://github.com/googleapis/google-cloud-cpp#quickstart)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ source "$(dirname "$0")/../../lib/init.sh"
source module ci/cloudbuild/builds/lib/cmake.sh

# We run this test in a docker image that includes the oldest GCC that we
# support, which happens to be 6.3 currently.
# support, which happens to be 7.3 currently.
export CC=gcc
export CXX=g++

Expand Down
167 changes: 167 additions & 0 deletions ci/cloudbuild/dockerfiles/centos-7.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Copyright 2022 Google LLC
#
# 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.

FROM centos:7

# First install the development tools and OpenSSL. The development tools
# distributed with CentOS 7 are too old to build the project. In these
# instructions, we use `cmake3` and `gcc-7` obtained from
# [Software Collections](https://www.softwarecollections.org/).

RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum install -y centos-release-scl yum-utils
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
RUN yum makecache && \
yum install -y automake ccache cmake3 curl-devel devtoolset-7 gcc gcc-c++ \
git libtool make ninja-build openssl-devel patch re2-devel tar wget \
which zlib-devel
RUN ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest

# In order to use the `devtoolset-7` Software Collection we're supposed to run
# `scl enable devtoolset-7 bash`, which starts a new shell with the environment
# configured correctly. However, we can't do that in this Dockerfile, AND we
# want the instructions that we generate for the user to say the right thing.
# So this block is ignored, and we manually set some environment variables to
# make the devtoolset-7 available. After this ignored block, we'll include the
# correct instructions for the user. NOTE: These env values were obtained by
# manually running the `scl ...` command (above) then copying the values set in
# its environment.
ENV PATH /opt/rh/devtoolset-7/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV LD_LIBRARY_PATH /opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib:/opt/rh/devtoolset-7/root/usr/lib64/dyninst:/opt/rh/devtoolset-7/root/usr/lib/dyninst:/opt/rh/devtoolset-7/root/usr/lib64:/opt/rh/devtoolset-7/root/usr/lib

# CentOS-7 ships with `pkg-config` 0.27.1, which has a
# [bug](https://bugs.freedesktop.org/show_bug.cgi?id=54716) that can make
# invocations take extremely long to complete.

WORKDIR /var/tmp/build/pkg-config-cpp
RUN curl -sSL https://pkgconfig.freedesktop.org/releases/pkg-config-0.29.2.tar.gz | \
tar -xzf - --strip-components=1 && \
./configure --with-internal-glib && \
make -j "$(nproc)" && \
make install && \
ldconfig && cd /var/tmp && rm -fr build

# The following steps will install libraries and tools in `/usr/local`. By
# default, CentOS-7 does not search for shared libraries in these directories,
# there are multiple ways to solve this problem, the following steps are one
# solution:

RUN (echo "/usr/local/lib" ; echo "/usr/local/lib64") | \
tee /etc/ld.so.conf.d/usrlocal.conf
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig
ENV PATH=/usr/local/bin:${PATH}

WORKDIR /var/tmp/build/abseil-cpp
RUN curl -sSL https://github.com/abseil/abseil-cpp/archive/20211102.0.tar.gz | \
tar -xzf - --strip-components=1 && \
sed -i 's/^#define ABSL_OPTION_USE_\(.*\) 2/#define ABSL_OPTION_USE_\1 0/' "absl/base/options.h" && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=yes \
-GNinja -S . -B cmake-out && \
cmake --build cmake-out && \
cmake --build cmake-out --target install && \
ldconfig && cd /var/tmp && rm -fr build

WORKDIR /var/tmp/build/protobuf
RUN curl -sSL https://github.com/protocolbuffers/protobuf/archive/v21.2.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=yes \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_ABSL_PROVIDER=package \
-GNinja -S . -B cmake-out && \
cmake --build cmake-out && \
cmake --build cmake-out --target install && \
ldconfig && cd /var/tmp && rm -fr build

WORKDIR /var/tmp/build/c-ares
RUN curl -sSL https://github.com/c-ares/c-ares/archive/cares-1_14_0.tar.gz | \
tar -xzf - --strip-components=1 && \
./buildconf && ./configure && make -j "$(nproc)" && \
make install && \
ldconfig && cd /var/tmp && rm -fr build

WORKDIR /var/tmp/build/grpc
RUN curl -sSL https://github.com/grpc/grpc/archive/v1.47.0.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=yes \
-DgRPC_INSTALL=ON \
-DgRPC_BUILD_TESTS=OFF \
-DgRPC_ABSL_PROVIDER=package \
-DgRPC_CARES_PROVIDER=package \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_RE2_PROVIDER=package \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-GNinja -S . -B cmake-out && \
cmake --build cmake-out && \
cmake --build cmake-out --target install && \
ldconfig && cd /var/tmp && rm -fr build

WORKDIR /var/tmp/build/crc32c
RUN curl -sSL https://github.com/google/crc32c/archive/1.1.2.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=yes \
-DCRC32C_BUILD_TESTS=OFF \
-DCRC32C_BUILD_BENCHMARKS=OFF \
-DCRC32C_USE_GLOG=OFF \
-GNinja -S . -B cmake-out && \
cmake --build cmake-out && \
cmake --build cmake-out --target install && \
ldconfig && cd /var/tmp && rm -fr build

WORKDIR /var/tmp/build/json
RUN curl -sSL https://github.com/nlohmann/json/archive/v3.10.5.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=yes \
-DBUILD_TESTING=OFF \
-DJSON_BuildTests=OFF \
-GNinja -S . -B cmake-out && \
cmake --build cmake-out --target install && \
ldconfig && cd /var/tmp && rm -fr build

# Install googletest, remove the downloaded files and the temporary artifacts
# after a successful build to keep the image smaller (and with fewer layers)
WORKDIR /var/tmp/build
RUN curl -sSL https://github.com/google/googletest/archive/release-1.11.0.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=yes \
-GNinja -S . -B cmake-out && \
cmake --build cmake-out --target install && \
ldconfig && cd /var/tmp && rm -fr build

# Download and compile Google microbenchmark support library:
WORKDIR /var/tmp/build
RUN curl -sSL https://github.com/google/benchmark/archive/v1.6.1.tar.gz | \
tar -xzf - --strip-components=1 && \
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DBUILD_SHARED_LIBS=yes \
-DBENCHMARK_ENABLE_TESTING=OFF \
-GNinja -S . -B cmake-out && \
cmake --build cmake-out --target install && \
ldconfig && cd /var/tmp && rm -fr build

RUN ldconfig /usr/local/lib*
170 changes: 0 additions & 170 deletions ci/cloudbuild/dockerfiles/debian-stretch.Dockerfile

This file was deleted.

Loading

0 comments on commit b843e9e

Please sign in to comment.