Skip to content

Commit

Permalink
[opentelemetry-cpp] Update to 1.6.0 and fix abseil[cxx17] (microsoft#…
Browse files Browse the repository at this point in the history
…26857)

* opentelemetry-cpp: Update to 1.6.0 and fix abseil[cxx17]

* opentelemetry-cpp: Adjust versions json

* opentelemetry-cpp: Re-add 1.5.0p1 version
  • Loading branch information
Tradias authored Oct 15, 2022
1 parent 8f06ea4 commit a2261f6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
18 changes: 11 additions & 7 deletions ports/opentelemetry-cpp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO open-telemetry/opentelemetry-cpp
REF v1.5.0
SHA512 a506973223c49531d4b0c3febf5734dfe2e44c22f8854ed96935cda0783a14d0819cc3dbb2d3f8373f960f27acf78aafc777ee76aeb14828df9c4b4434e4fe6f
REF v1.6.0
SHA512 ae0777451a3d2d676afd9f3142ab78c7afb08474f6038bd810ff0ee30fee6695e10100c901e7ffadf3faf16c7d19622acdea414cd720be8572f7720f2d528628
HEAD_REF main
PATCHES
support_absl_cxx17.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand All @@ -23,16 +25,18 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

# opentelemetry-proto is a third party submodule and opentelemetry-cpp release did not pack it.
if(WITH_OTLP)
set(OTEL_PROTO_VERSION "0.17.0")
set(OTEL_PROTO_VERSION "0.18.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 b61d7fe7d6e1b5943d45ab9d17c22fe36c0f7a8312f668aea2b6685aa0f5c98aaa41e76659057310ec1f061d36ad9e66993be177039121f62f73858a6749d3d9
SHA512 5176e93ddbb92d10b5900f42bb7b98cd718488fb261ad204e73127e1bf1feb6a20cf17d5c7d4fbdd89575cef6c7fa98127a28d83e50ffba61da01a73659ddae6
)

vcpkg_extract_source_archive("${ARCHIVE}" "${SOURCE_PATH}/third_party")
vcpkg_extract_source_archive(src ARCHIVE "${ARCHIVE}")
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/opentelemetry-proto")
file(RENAME "${SOURCE_PATH}/third_party/opentelemetry-proto-${OTEL_PROTO_VERSION}" "${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(MAKE_DIRECTORY "${SOURCE_PATH}/third_party/opentelemetry-proto/.git")
endif()

vcpkg_cmake_configure(
Expand All @@ -46,7 +50,7 @@ vcpkg_cmake_configure(
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/opentelemetry-cpp)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
vcpkg_copy_pdbs()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
Expand Down
17 changes: 17 additions & 0 deletions ports/opentelemetry-cpp/support_absl_cxx17.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1b69340..193c9e39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -305,7 +305,11 @@ if(WITH_OTLP)
CACHE{WITH_OTLP_HTTP}))
find_package(CURL)
endif()
-
+ if (ABSL_USE_CXX17)
+ message(STATUS "Found absl uses CXX17, enable CXX17 feature.")
+ set(CMAKE_CXX_STANDARD 17)
+ set(WITH_STL ON)
+ endif()
cmake_dependent_option(
WITH_OTLP_GRPC "Whether to include the OTLP gRPC exporter in the SDK" ON
"gRPC_FOUND" OFF)
3 changes: 1 addition & 2 deletions ports/opentelemetry-cpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "opentelemetry-cpp",
"version-semver": "1.5.0",
"port-version": 1,
"version-semver": "1.6.0",
"description": [
"OpenTelemetry is a collection of tools, APIs, and SDKs.",
"You use it to instrument, generate, collect, and export telemetry data (metrics, logs, and traces) for analysis in order to understand your software's performance and behavior."
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5485,8 +5485,8 @@
"port-version": 0
},
"opentelemetry-cpp": {
"baseline": "1.5.0",
"port-version": 1
"baseline": "1.6.0",
"port-version": 0
},
"opentracing": {
"baseline": "1.6.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/o-/opentelemetry-cpp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b85f6215a2936a5a21c752b11e16fc7250a102b2",
"version-semver": "1.6.0",
"port-version": 0
},
{
"git-tree": "49b229180a92d7c0148fd1c28a691a76c59aea51",
"version-semver": "1.5.0",
Expand Down

0 comments on commit a2261f6

Please sign in to comment.