Skip to content
Closed
Show file tree
Hide file tree
Changes from 14 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 }}'
2 changes: 1 addition & 1 deletion .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, Core3, Core4 ]
exclude:
# Also skip shards (Compute and Other) that contain only generated code.
- exclude-from-full-trick: ${{ ! inputs.full-matrix }}
Expand Down
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
-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")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The backslashes in this path are not escaped. When this line is interpreted by a shell like bash, the backslashes will act as escape characters and will be removed, resulting in a malformed path (cighabuildsvcpkg-overlays).

If backslashes are necessary for Windows, they must be escaped:

args+=("-DVCPKG_OVERLAY_PORTS=ci\\gha\\builds\\vcpkg-overlays")

However, CMake on Windows generally handles forward slashes correctly, which is more portable. It's recommended to use forward slashes unless there's a specific reason vcpkg requires backslashes here.

Suggested change
args+=("-DVCPKG_OVERLAY_PORTS=ci\gha\builds\vcpkg-overlays")
args+=("-DVCPKG_OVERLAY_PORTS=ci/gha/builds/vcpkg-overlays")

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)
168 changes: 68 additions & 100 deletions ci/gha/builds/vcpkg-overlays/opentelemetry-cpp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,130 +1,98 @@
if (VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif ()
endif()

vcpkg_from_github(
OUT_SOURCE_PATH
SOURCE_PATH
REPO
open-telemetry/opentelemetry-cpp
REF
"v${VERSION}"
SHA512
c93005c9b24b358a9998141f6c7fd9675778731775dacaad18f0e81117fd00aaabff371c04cf96688a9c86117727181052a141d961d4db28fc457b454351c570
HEAD_REF
main
OUT_SOURCE_PATH SOURCE_PATH
REPO open-telemetry/opentelemetry-cpp
REF "v${VERSION}"
SHA512 6dc0357d8b3410852d3f970f72b8bec59dba9d6c533ca600432102e65de161903bd9170d98cef7ff0af5191309577ffd2a69ccd004b840914a910a6a282204e4
HEAD_REF main
PATCHES
# Missing find_dependency for Abseil
add-missing-find-dependency.patch)
fix-target_link.patch
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS
FEATURE_OPTIONS
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
etw
WITH_ETW
zipkin
WITH_ZIPKIN
prometheus
WITH_PROMETHEUS
elasticsearch
WITH_ELASTICSEARCH
otlp-http
WITH_OTLP_HTTP
otlp-grpc
WITH_OTLP_GRPC
geneva
WITH_GENEVA
user-events
WITH_USER_EVENTS
etw WITH_ETW
zipkin WITH_ZIPKIN
prometheus WITH_PROMETHEUS
elasticsearch WITH_ELASTICSEARCH
otlp-file WITH_OTLP_FILE
otlp-http WITH_OTLP_HTTP
otlp-grpc WITH_OTLP_GRPC
geneva WITH_GENEVA
user-events WITH_USER_EVENTS
opentracing WITH_OPENTRACING
INVERTED_FEATURES
user-events
BUILD_TRACEPOINTS)
user-events BUILD_TRACEPOINTS
)

# opentelemetry-proto is a third party submodule and opentelemetry-cpp release
# did not pack it.
if (WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
set(OTEL_PROTO_VERSION "1.3.1")
vcpkg_download_distfile(
ARCHIVE
URLS
"https://github.com/open-telemetry/opentelemetry-proto/archive/v${OTEL_PROTO_VERSION}.tar.gz"
FILENAME
"opentelemetry-proto-${OTEL_PROTO_VERSION}.tar.gz"
SHA512
8c75e4ff79c4b5b251e0ec8ece92ec901d70ec601644505ffdd137fb728daac91fd9203e1f448500124906737d91d80f10b694977688c655418b94f61c828d06
# opentelemetry-proto is a third party submodule and opentelemetry-cpp release did not pack it.
if(WITH_OTLP_FILE OR WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
set(OTEL_PROTO_VERSION "1.6.0")
vcpkg_download_distfile(ARCHIVE
URLS "https://github.com/open-telemetry/opentelemetry-proto/archive/v${OTEL_PROTO_VERSION}.tar.gz"
FILENAME "opentelemetry-proto-${OTEL_PROTO_VERSION}.tar.gz"
SHA512 0e72e0c32d2d699d7a832a4c57a9dbe60e844d4c4e8d7b39eb45e4282cde89fccfeef893eae70b9d018643782090a7228c3ef60863b00747498e80f0cf1db8ae
)

vcpkg_extract_source_archive(src ARCHIVE "${ARCHIVE}")
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/opentelemetry-proto")
file(COPY "${src}/."
DESTINATION "${SOURCE_PATH}/third_party/opentelemetry-proto")
# Create empty .git directory to prevent opentelemetry from cloning it
# during build time
file(COPY "${src}/." DESTINATION "${SOURCE_PATH}/third_party/opentelemetry-proto")
# Create empty .git directory to prevent opentelemetry from cloning it during build time
file(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/opentelemetry-proto/.git")
list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=14)
list(
APPEND
FEATURE_OPTIONS
"-DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}"
)
endif ()
list(APPEND FEATURE_OPTIONS "-DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}")
endif()
list(APPEND FEATURE_OPTIONS -DCMAKE_CXX_STANDARD=17 -DWITH_STL=CXX17)

set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "OFF")

if (WITH_GENEVA OR WITH_USER_EVENTS)
# Geneva and user events exporters from opentelemetry-cpp-contrib are
# tightly coupled with opentelemetry-cpp repo, so they should be ported as a
# feature under opentelemetry-cpp.
if(WITH_GENEVA OR WITH_USER_EVENTS)
# Geneva and user events exporters from opentelemetry-cpp-contrib are tightly coupled with opentelemetry-cpp repo,
# so they should be ported as a feature under opentelemetry-cpp.
clone_opentelemetry_cpp_contrib(CONTRIB_SOURCE_PATH)

if (WITH_GENEVA)
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS
"${CONTRIB_SOURCE_PATH}/exporters/geneva")
if (VCPKG_TARGET_IS_WINDOWS)
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS
"${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/geneva-trace"
)
else ()
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS
"${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/fluentd"
)
endif ()
endif ()
if(WITH_GENEVA)
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "${CONTRIB_SOURCE_PATH}/exporters/geneva")
if(VCPKG_TARGET_IS_WINDOWS)
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/geneva-trace")
else()
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/fluentd")
endif()
endif()

if (WITH_USER_EVENTS)
if (WITH_GENEVA)
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS
"${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/user_events"
)
else ()
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS
"${CONTRIB_SOURCE_PATH}/exporters/user_events")
endif ()
endif ()
endif ()
if(WITH_USER_EVENTS)
if(WITH_GENEVA)
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}\;${CONTRIB_SOURCE_PATH}/exporters/user_events")
else()
set(OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS "${CONTRIB_SOURCE_PATH}/exporters/user_events")
endif()
endif()
endif()

vcpkg_cmake_configure(
SOURCE_PATH
"${SOURCE_PATH}"
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTING=OFF
-DWITH_EXAMPLES=OFF
-DOPENTELEMETRY_INSTALL=ON
-DWITH_STL=CXX14
-DWITH_ABSEIL=ON
-DWITH_BENCHMARK=OFF
-DOPENTELEMETRY_EXTERNAL_COMPONENT_PATH=${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}
${FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
-DWITH_EXAMPLES=OFF
-DOPENTELEMETRY_INSTALL=ON
-DWITH_BENCHMARK=OFF
-DCMAKE_CXX_STANDARD=17
-DWITH_STL=CXX17

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

These CMake options are redundant as they are already appended to FEATURE_OPTIONS on line 47. Since ${FEATURE_OPTIONS} is passed to vcpkg_cmake_configure, these lines can be removed to avoid duplication and improve clarity.

-DOPENTELEMETRY_EXTERNAL_COMPONENT_PATH=${OPENTELEMETRY_CPP_EXTERNAL_COMPONENTS}
${FEATURE_OPTIONS}
MAYBE_UNUSED_VARIABLES
WITH_GENEVA
WITH_USER_EVENTS
BUILD_TRACEPOINTS)
WITH_GENEVA
WITH_USER_EVENTS
BUILD_TRACEPOINTS
gRPC_CPP_PLUGIN_EXECUTABLE
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
Loading
Loading