Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 8 additions & 44 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ jobs:
execute-integration-tests: true
secrets: inherit
windows-bazel:
# Disabled
if: false
# Build the full matrix only on push events to the default branch, or
# when PR gets the has a `gha:full-build` label, or when it had the
# label already and it gets a new commit.
if: |-
${{
github.event_name == 'schedule' ||
github.event_name == 'push' ||
contains(github.event.pull_request.labels.*.name, 'gha:full-build')
}}
# if: |-
# ${{
# github.event_name == 'schedule' ||
# github.event_name == 'push' ||
# contains(github.event.pull_request.labels.*.name, 'gha:full-build')
# }}
name: Windows-Bazel
needs: [pre-flight]
uses: ./.github/workflows/windows-bazel.yml
Expand Down Expand Up @@ -127,8 +129,6 @@ jobs:
execute-integration-tests: true
secrets: inherit
windows-cmake:
# Disabled
if: false
name: Windows-CMake
needs: [pre-flight]
uses: ./.github/workflows/windows-cmake.yml
Expand All @@ -147,39 +147,3 @@ jobs:
vcpkg-cache-mode: 'readwrite'
execute-integration-tests: true
secrets: inherit
notify:
name: Notify-Google-Chat
# Wait until all the other jobs have completed.
needs:
# macos-bazel is disabled
# macos-cmake is disabled
- windows-bazel
# windows-cmake is disabled is disabled
# Run even if the other jobs failed or were skipped.
if: always()
runs-on: ubuntu-latest
steps:
- name: Notify Google Chat
shell: bash
run: |
event_name="${{ github.event_name }}"
case "${event_name}" in
schedule)
;;
push)
;;
*)
exit 0
;;
esac
failure="${{ contains(needs.*.result, 'failure') }}"
cancelled="${{ contains(needs.*.result, 'cancelled') }}"
status=""
# Report whether any of the jobs failed or were cancelled.
if [[ "${cancelled}" == "true" ]]; then status="cancelled"; fi
if [[ "${failure}" == "true" ]]; then status="failure"; fi
# Exit early if there is nothing interesting to report.
if [[ -z "${status}" ]]; then exit 0; fi
printf '{"text": "GHA Build %s %s/%s/actions/runs/%s"}' \
"${status}" "${{ github.server_url }}" "${{ github.repository }}" "${{ github.run_id }}" |
curl -fsX POST -o /dev/null -d@- -H "Content-Type: application/json; charset=UTF-8" '${{ secrets.CLOUD_CPP_BUILD_ALERTS_WEBHOOK }}'
9 changes: 4 additions & 5 deletions .github/workflows/windows-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
msvc: [ msvc-2022 ]
build_type: [ Release ]
arch: [ x64 ]
shard: [ Core3, Core4 ]
shard: [ Core1, Core2, Core3, Core4, Core5, Compute, AIPlatform, Shard1, Shard2, Shard3, Shard4, Shard5 ]
exclude:
# Also skip shards (Compute and Other) that contain only generated code.
- exclude-from-full-trick: ${{ ! inputs.full-matrix }}
Expand Down Expand Up @@ -103,6 +103,7 @@ jobs:
dataproc
discoveryengine
monitoring
opentelemetry
retail
sql
dialogflow_cx
Expand Down Expand Up @@ -209,6 +210,8 @@ jobs:
universe_domain
)
shard5_features=(
asset
channel
video
datacatalog
iam
Expand Down Expand Up @@ -269,10 +272,6 @@ jobs:
skipped_features+=("${shard3_features[@]}")
skipped_features+=("${shard4_features[@]}")
skipped_features+=("${shard5_features[@]}")
# We use vcpkg in this build, which ships with Protobuf v21.x.
# Both `asset` and `channel` require Protobuf >= 23.x to compile on
# Windows.
skipped_features+=(asset channel)
skipped="$(printf ",-%s" "${skipped_features[@]}")"
echo "features=__ga_libraries__,__experimental_libraries__,${skipped:1}" >> "${GITHUB_OUTPUT}"
fi
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ if (APPLE
" cmake -DGOOGLE_CLOUD_CPP_ENABLE_MACOS_OPENSSL_CHECK=OFF ...")
endif ()

if (WIN32)
add_definitions(-DNOMINMAX)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Adding -DNOMINMAX is a crucial step for Windows compatibility in C++ projects. This prevents conflicts between the min/max macros defined in windows.h and std::min/std::max from the C++ standard library, which can lead to unexpected compilation errors or behavior.

endif ()

# If ccache is installed use it for the build.
option(GOOGLE_CLOUD_CPP_ENABLE_CCACHE "Automatically use ccache if available"
OFF)
Expand Down
10 changes: 10 additions & 0 deletions ci/cloudbuild/builds/cmake-oldest-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ ENABLED_FEATURES="$(printf ",%s" "${feature_list[@]}")"
ENABLED_FEATURES="${ENABLED_FEATURES:1}"
readonly ENABLED_FEATURES

function exit_trap() {
local exit_status=$?
io::log_h2 "cleanup on EXIT with exit_status=${exit_status}"
if ((exit_status != 0)); then
cat /workspace/cmake-out/build/vcpkg-manifest-install.log
fi
}

trap 'exit_trap' INT TERM EXIT

io::log_h2 "Configuring"
vcpkg_root="$(vcpkg::root_dir)"
cmake -GNinja -S . -B cmake-out/build \
Expand Down
66 changes: 66 additions & 0 deletions ci/cloudbuild/dockerfiles/ubuntu-22.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Copyright 2021 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 ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get --no-install-recommends install -y \
automake \
build-essential \
clang \
cmake \
curl \
gawk \
git \
gcc \
g++ \
cmake \
libcurl4-openssl-dev \
libssl-dev \
libtool \
lsb-release \
make \
ninja-build \
patch \
pkg-config \
python3 \
python3-dev \
python3-pip \
tar \
unzip \
zip \
wget \
zlib1g-dev \
apt-utils \
ca-certificates \
apt-transport-https

# Install Python packages used in the integration tests.
RUN update-alternatives --install /usr/bin/python python $(which python3) 10
RUN pip3 install setuptools wheel
# The Cloud Pub/Sub emulator needs Java :shrug:
RUN apt update && (apt install -y openjdk-11-jre || apt install -y openjdk-9-jre)

# Install the Cloud SDK and some of the emulators. We use the emulators to run
# integration tests for the client libraries.
COPY . /var/tmp/ci
WORKDIR /var/tmp/downloads
RUN /var/tmp/ci/install-cloud-sdk.sh
ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk
ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH}

RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.27.0/bazelisk-linux-${ARCH}" && \
chmod +x /usr/bin/bazelisk && \
ln -s /usr/bin/bazelisk /usr/bin/bazel
9 changes: 9 additions & 0 deletions ci/cloudbuild/dockerfiles/ubuntu-focal.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ RUN apt-get update && \
ca-certificates \
apt-transport-https

RUN apt update -y && apt upgrade -y

RUN apt update \
&& apt install software-properties-common -y

RUN add-apt-repository ppa:deadsnakes/ppa -y
RUN apt update && \
apt install python3.12 -y

# Install Python packages used in the integration tests.
RUN update-alternatives --install /usr/bin/python python $(which python3) 10
RUN pip3 install setuptools wheel
Expand Down
2 changes: 1 addition & 1 deletion ci/cloudbuild/triggers/cmake-oldest-deps-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
name: prepare-for-v3-0-0-cmake-oldest-deps-ci
substitutions:
_BUILD_NAME: cmake-oldest-deps
_DISTRO: ubuntu-focal
_DISTRO: ubuntu-22.04
_TRIGGER_TYPE: ci
tags:
- ci
2 changes: 1 addition & 1 deletion ci/cloudbuild/triggers/cmake-oldest-deps-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS
name: prepare-for-v3-0-0-cmake-oldest-deps-pr
substitutions:
_BUILD_NAME: cmake-oldest-deps
_DISTRO: ubuntu-focal
_DISTRO: ubuntu-22.04
_TRIGGER_TYPE: pr
tags:
- pr
18 changes: 8 additions & 10 deletions ci/etc/oldest-deps/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"$TODO": "move `gtest` and `benchmark` to dev-dependencies",
"builtin-baseline": "6d9ed568117dd958c543b3ab8d3ed692965cac34",
"dependencies": [
{"name": "abseil", "version>=": "20250127.1"},
{"name": "crc32c", "version>=": "1.1.1"},
{"name": "abseil", "version>=": "20250814.1"},
{
"name": "curl",
"features": [
Expand All @@ -26,19 +25,18 @@
"version>=": "3.15.8",
"host": true
},
{"name": "grpc", "version>=": "1.33.1"},
{"name": "opentelemetry-cpp", "version>=": "1.20.0"},
{"name": "protobuf", "version>=": "3.15.8"},
{"name": "grpc", "version>=": "1.76.0"},
{"name": "opentelemetry-cpp", "version>=": "1.23.0"},
{"name": "protobuf", "version>=": "6.33.4"},
{"name": "nlohmann-json", "version>=": "3.9.1"},
"benchmark",
{"name": "gtest", "version>=": "1.11.0", "host": true}
],
"overrides": [
{ "name": "abseil", "version": "20250127.1"},
{ "name": "opentelemetry-cpp", "version": "1.20.0"},
{ "name": "protobuf", "version": "3.15.8" },
{ "name": "grpc", "version": "1.36.4" },
{ "name": "upb", "version": "2020-12-19" },
{ "name": "abseil", "version": "20250814.1"},
{ "name": "opentelemetry-cpp", "version": "1.23.0"},
{ "name": "protobuf", "version": "6.33.4" },
{ "name": "grpc", "version": "1.76.0" },
{ "name": "gtest", "version": "1.12.0" }
],
"configuration": {
Expand Down
2 changes: 1 addition & 1 deletion ci/etc/vcpkg-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025.10.17
3895230f38e498525f2560a281223d12066fa74a
3 changes: 2 additions & 1 deletion ci/gha/builds/lib/cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function cmake::common_args() {
fi
local args
args=(
-DCMAKE_CXX_STANDARD=17

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Setting CMAKE_CXX_STANDARD to 17 explicitly ensures that the project is built with C++17 features. This is a good practice for modern C++ development and aligns with the repository's stated support for C++14 as a minimum version, effectively upgrading the standard used in this build configuration.

References
  1. The repository style guide states that C++14 is the minimum supported C++ standard version. Upgrading to C++17 is a positive step towards modern C++ practices. (link)

-DGOOGLE_CLOUD_CPP_ENABLE_CCACHE=OFF
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=ON
-GNinja
Expand All @@ -58,7 +59,7 @@ function cmake::common_args() {
if [[ -n "${VCPKG_TRIPLET:-}" ]]; then
args+=("-DVCPKG_TARGET_TRIPLET=${VCPKG_TRIPLET}")
fi
args+=("-DVCPKG_OVERLAY_PORTS=ci/gha/builds/vcpkg-overlays")
args+=("-DVCPKG_OVERLAY_PORTS=ci\gha\builds\vcpkg-overlays")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Changing the path separator from / to \ for VCPKG_OVERLAY_PORTS is essential for correct functionality on Windows systems, as Windows uses backslashes for directory paths. This ensures that vcpkg can correctly locate the overlay ports.

printf "%s\n" "${args[@]}"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/cmake/opentracing-cpp.cmake b/cmake/opentracing-cpp.cmake
index f014ecd..fd8898a 100644
--- a/cmake/opentracing-cpp.cmake
+++ b/cmake/opentracing-cpp.cmake
@@ -1,7 +1,11 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

-find_package(OpenTracing CONFIG QUIET)
+find_package(OpenTracing CONFIG REQUIRED)
+if(NOT TARGET OpenTracing::opentracing AND TARGET OpenTracing::opentracing-static)
+ add_library(OpenTracing::opentracing ALIAS OpenTracing::opentracing-static)
+endif()
+
set(OpenTracing_PROVIDER "find_package")

if(NOT OpenTracing_FOUND)
Loading