Skip to content

Commit 331818a

Browse files
authored
ci: move Bazel builds to Fedora:38 (#12743)
1 parent ff31dc8 commit 331818a

26 files changed

+103
-23
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
# Use host-OS-specific config lines from bazelrc files.
1919
build --enable_platform_specific_config=true
20+
# gRPC fails to compile with Clang 16 if layering check is enabled:
21+
# https://github.com/grpc/grpc/issues/34482
22+
build --features=-layering_check
2023

2124
# The project requires C++ >= 14. By default Bazel adds `-std=c++0x` which
2225
# disables C++14 features, even if the compilers defaults to C++ >= 14

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ New `*Client` for conversational search.
127127
Remove `PoliciesClient`. This client was placed in the wrong library. The
128128
correct location is google/cloud/iam/v2.
129129

130+
### Known issues
131+
132+
Compiling gRPC with Bazel and Clang >= 16 requires `--features=-layering_check`
133+
in your Bazel command-line. For more details, see [grpc#34482].
134+
130135
## v2.15.0 - 2023-09
131136

132137
### New Libraries
@@ -4379,6 +4384,7 @@ releases. The relevant notes are:
43794384
[functions-v2]: https://cloud.google.com/functions/docs/concepts/version-comparison
43804385
[github-cpp-common]: https://github.com/googleapis/google-cloud-cpp-common
43814386
[google.pubsub.v1.schemaserviceclient]: https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#google.pubsub.v1.SchemaService
4387+
[grpc#34482]: https://github.com/grpc/grpc/issues/34482
43824388
[guac-dox]: https://cloud.google.com/cpp/docs/reference/common/latest/group__guac
43834389
[howto-mock-data-api]: https://cloud.google.com/cpp/docs/reference/bigtable/latest/bigtable-mocking
43844390
[iam-conditions-link]: https://cloud.google.com/iam/docs/conditions-overview

ci/cloudbuild/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
# Advanced Examples:
6464
#
6565
# 1. Runs the ci/cloudbuild/builds/asan.sh script using the
66-
# ci/cloudbuild/dockerfiles/fedora-37-bazel.Dockerfile distro.
67-
# $ build.sh --build asan --distro fedora-37-bazel
66+
# ci/cloudbuild/dockerfiles/fedora-latest-bazel.Dockerfile distro.
67+
# $ build.sh --build asan --distro fedora-latest-bazel
6868
#
6969
# Note: Builds with the `--docker` flag inherit some (but not all) environment
7070
# variables from the calling process, such as USE_BAZEL_VERSION

ci/cloudbuild/builds/integration-daily.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# `ci/cloudbuild/triggers` directory. "Manual" triggers exist only within the
2424
# GCB UI at the time of this writing. Users with the appropriate access can run
2525
# this build by hand with:
26-
# `ci/cloudbuild/build.sh --distro fedora-37-bazel --build integration-daily --cloud cloud-cpp-testing-resources`
26+
# `ci/cloudbuild/build.sh --distro fedora-latest-bazel --build integration-daily --cloud cloud-cpp-testing-resources`
2727

2828
set -euo pipefail
2929

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright 2023 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+
# https://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+
FROM fedora:38
16+
ARG NCPU=4
17+
ARG ARCH=amd64
18+
19+
# Install the minimal packages needed to install Bazel, and then compile our
20+
# code.
21+
RUN dnf install -y clang diffutils findutils gcc-c++ git lcov libcxx-devel \
22+
libcxxabi-devel libasan libubsan libtsan llvm patch python python3 \
23+
python-pip tar unzip w3m wget which zip zlib-devel
24+
25+
# Install the Python modules needed to run the storage emulator
26+
RUN dnf makecache && dnf install -y python3-devel
27+
RUN pip3 install --upgrade pip
28+
RUN pip3 install setuptools wheel
29+
30+
# The Cloud Pub/Sub emulator needs Java, and so does `bazel coverage` :shrug:
31+
# Bazel needs the '-devel' version with javac.
32+
RUN dnf makecache && dnf install -y java-latest-openjdk-devel
33+
34+
# Sets root's password to the empty string to enable users to get a root shell
35+
# inside the container with `su -` and no password. Sudo would not work because
36+
# we run these containers as the invoking user's uid, which does not exist in
37+
# the container's /etc/passwd file.
38+
RUN echo 'root:' | chpasswd
39+
40+
WORKDIR /var/tmp/build
41+
42+
# Install the Cloud SDK and some of the emulators. We use the emulators to run
43+
# integration tests for the client libraries.
44+
COPY . /var/tmp/ci
45+
WORKDIR /var/tmp/downloads
46+
ENV CLOUDSDK_PYTHON=python3
47+
RUN /var/tmp/ci/install-cloud-sdk.sh
48+
ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk
49+
ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH}
50+
51+
RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-${ARCH}" && \
52+
chmod +x /usr/bin/bazelisk && \
53+
ln -s /usr/bin/bazelisk /usr/bin/bazel
54+
55+
# Download the packages needed to run Bigtable conformance tests.
56+
WORKDIR /var/tmp/downloads
57+
RUN wget -O go.tgz https://go.dev/dl/go1.20.5.linux-amd64.tar.gz
58+
RUN tar -C /usr/local/ -xzf go.tgz
59+
ENV GO_LOCATION=/usr/local/go
60+
ENV PATH=${GO_LOCATION}/bin:${PATH}
61+
RUN go version
62+
WORKDIR /var/tmp/downloads/cloud-bigtable-clients-test
63+
RUN curl -fsSL https://github.com/googleapis/cloud-bigtable-clients-test/archive/v0.0.1.tar.gz | \
64+
tar -xzf - --strip-components=1

ci/cloudbuild/triggers/asan-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ github:
77
name: asan-ci
88
substitutions:
99
_BUILD_NAME: asan
10-
_DISTRO: fedora-37-bazel
10+
_DISTRO: fedora-latest-bazel
1111
_TRIGGER_TYPE: ci
1212
includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
1313
tags:

ci/cloudbuild/triggers/asan-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ github:
88
name: asan-pr
99
substitutions:
1010
_BUILD_NAME: asan
11-
_DISTRO: fedora-37-bazel
11+
_DISTRO: fedora-latest-bazel
1212
_TRIGGER_TYPE: pr
1313
includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
1414
tags:

ci/cloudbuild/triggers/bazel-oldest-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ github:
77
name: bazel-oldest-ci
88
substitutions:
99
_BUILD_NAME: bazel-oldest
10-
_DISTRO: fedora-37-bazel
10+
_DISTRO: fedora-latest-bazel
1111
_TRIGGER_TYPE: ci
1212
includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
1313
tags:

ci/cloudbuild/triggers/bazel-oldest-pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ github:
88
name: bazel-oldest-pr
99
substitutions:
1010
_BUILD_NAME: bazel-oldest
11-
_DISTRO: fedora-37-bazel
11+
_DISTRO: fedora-latest-bazel
1212
_TRIGGER_TYPE: pr
1313
includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
1414
tags:

ci/cloudbuild/triggers/bazel-targets-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ github:
77
name: bazel-targets-ci
88
substitutions:
99
_BUILD_NAME: bazel-targets
10-
_DISTRO: fedora-37-bazel
10+
_DISTRO: fedora-latest-bazel
1111
_TRIGGER_TYPE: ci
1212
includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
1313
tags:

0 commit comments

Comments
 (0)