From a3937b6fe8264f1027efb85580dc54c3c0bb1b33 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 2 Jan 2024 18:10:32 -0500 Subject: [PATCH 1/2] [opentelemetry-cpp] Update to 1.13.0 The patch to add a dependency of opentelemetry-proto on gRPC should not be needed after the upstream changes in: https://github.com/open-telemetry/opentelemetry-cpp/pull/2268 Additionally, the "zpages" feature is removed as it is no longer present upstream after having been deprecated in a previous release. A patch is added extracted from https://github.com/open-telemetry/opentelemetry-cpp/pull/2475 and https://github.com/open-telemetry/opentelemetry-cpp/pull/2449 which fix problems that arose after `NOMINMAX` was no longer defined within opentelemetry-cpp on Windows. Fixes #35992. --- .../add-missing-dependencies.patch | 15 -- .../fix-nominmax-problems.patch | 224 ++++++++++++++++++ ports/opentelemetry-cpp/portfile.cmake | 8 +- ports/opentelemetry-cpp/vcpkg.json | 6 +- versions/baseline.json | 4 +- versions/o-/opentelemetry-cpp.json | 5 + 6 files changed, 235 insertions(+), 27 deletions(-) delete mode 100644 ports/opentelemetry-cpp/add-missing-dependencies.patch create mode 100644 ports/opentelemetry-cpp/fix-nominmax-problems.patch diff --git a/ports/opentelemetry-cpp/add-missing-dependencies.patch b/ports/opentelemetry-cpp/add-missing-dependencies.patch deleted file mode 100644 index 2de8be70c7a2c1..00000000000000 --- a/ports/opentelemetry-cpp/add-missing-dependencies.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/cmake/opentelemetry-proto.cmake b/cmake/opentelemetry-proto.cmake -index 34b33d3..19e67e9 100644 ---- a/cmake/opentelemetry-proto.cmake -+++ b/cmake/opentelemetry-proto.cmake -@@ -311,6 +311,10 @@ if(WITH_OTLP_GRPC) - endif() - endif() - -+if(TARGET gRPC::grpc++) -+ target_link_libraries(opentelemetry_proto PUBLIC gRPC::grpc++) -+endif() -+ - if(BUILD_SHARED_LIBS) - foreach(proto_target ${OPENTELEMETRY_PROTO_TARGETS}) - set_property(TARGET ${proto_target} PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/ports/opentelemetry-cpp/fix-nominmax-problems.patch b/ports/opentelemetry-cpp/fix-nominmax-problems.patch new file mode 100644 index 00000000000000..7cf003711337ea --- /dev/null +++ b/ports/opentelemetry-cpp/fix-nominmax-problems.patch @@ -0,0 +1,224 @@ +diff --git a/api/include/opentelemetry/std/span.h b/api/include/opentelemetry/std/span.h +index 2a3dc12a84..1160d54fbe 100644 +--- a/api/include/opentelemetry/std/span.h ++++ b/api/include/opentelemetry/std/span.h +@@ -60,7 +60,7 @@ OPENTELEMETRY_END_NAMESPACE + OPENTELEMETRY_BEGIN_NAMESPACE + namespace nostd + { +-constexpr std::size_t dynamic_extent = (std::numeric_limits::max()); ++constexpr std::size_t dynamic_extent = (std::numeric_limits::max)(); + + template + using span = std::span; +index 7deb369ab3..6da8bdd032 100644 +--- a/docs/cpp-ostream-exporter-design.md ++++ b/docs/cpp-ostream-exporter-design.md +@@ -154,7 +154,7 @@ public: + return sdktrace::ExportResult::kSuccess; + } + +- bool Shutdown(std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept ++ bool Shutdown(std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept + { + isShutdown = true; + return true; +diff --git a/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_record_exporter.h b/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_record_exporter.h +index 8579c99138..b72ff4f917 100644 +--- a/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_record_exporter.h ++++ b/exporters/elasticsearch/include/opentelemetry/exporters/elasticsearch/es_log_record_exporter.h +@@ -100,14 +100,14 @@ class ElasticsearchLogRecordExporter final : public opentelemetry::sdk::logs::Lo + * @return return true when all data are exported, and false when timeout + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shutdown this exporter. + * @param timeout The maximum time to wait for the shutdown method to return + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + private: + // Stores if this exporter had its Shutdown() method called +diff --git a/exporters/elasticsearch/src/es_log_record_exporter.cc b/exporters/elasticsearch/src/es_log_record_exporter.cc +index c90072e4e4..e167faf3d9 100644 +--- a/exporters/elasticsearch/src/es_log_record_exporter.cc ++++ b/exporters/elasticsearch/src/es_log_record_exporter.cc +@@ -430,7 +430,7 @@ bool ElasticsearchLogRecordExporter::ForceFlush( + std::chrono::duration_cast(timeout); + if (timeout_steady <= std::chrono::steady_clock::duration::zero()) + { +- timeout_steady = std::chrono::steady_clock::duration::max(); ++ timeout_steady = (std::chrono::steady_clock::duration::max)(); + } + + std::unique_lock lk_cv(synchronization_data_->force_flush_cv_m); +diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h +index 7aff1e24a5..870e5a043a 100644 +--- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h ++++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h +@@ -58,7 +58,7 @@ class OtlpGrpcExporter final : public opentelemetry::sdk::trace::SpanExporter + * @return return true when all data are exported, and false when timeout + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shut down the exporter. +@@ -67,7 +67,7 @@ class OtlpGrpcExporter final : public opentelemetry::sdk::trace::SpanExporter + * @return return the status of this operation + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + private: + // The configuration options associated with this exporter. +diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter.h +index 29333703b1..f1cd96888c 100644 +--- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter.h ++++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter.h +@@ -60,14 +60,14 @@ class OtlpGrpcLogRecordExporter : public opentelemetry::sdk::logs::LogRecordExpo + * @return return true when all data are exported, and false when timeout + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shutdown this exporter. + * @param timeout The maximum time to wait for the shutdown method to return. + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + private: + // Configuration options for the exporter +diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h +index 1adbbc70b9..b5faf1a9b8 100644 +--- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h ++++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_exporter.h +@@ -59,7 +59,7 @@ class OPENTELEMETRY_EXPORT OtlpHttpExporter final : public opentelemetry::sdk::t + * @return return true when all data are exported, and false when timeout + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shut down the exporter. +@@ -68,7 +68,7 @@ class OPENTELEMETRY_EXPORT OtlpHttpExporter final : public opentelemetry::sdk::t + * @return return the status of this operation + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + private: + // The configuration options associated with this exporter. +diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h +index 4393345dfd..f481fdab0b 100644 +--- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h ++++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_log_record_exporter.h +@@ -58,14 +58,14 @@ class OtlpHttpLogRecordExporter final : public opentelemetry::sdk::logs::LogReco + * @return return true when all data are exported, and false when timeout + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shutdown this exporter. + * @param timeout The maximum time to wait for the shutdown method to return + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + private: + // Configuration options for the exporter +diff --git a/exporters/otlp/src/otlp_http_client.cc b/exporters/otlp/src/otlp_http_client.cc +index 9c57a9bd83..7814199ef2 100644 +--- a/exporters/otlp/src/otlp_http_client.cc ++++ b/exporters/otlp/src/otlp_http_client.cc +@@ -782,7 +782,7 @@ bool OtlpHttpClient::ForceFlush(std::chrono::microseconds timeout) noexcept + std::chrono::duration_cast(timeout); + if (timeout_steady <= std::chrono::steady_clock::duration::zero()) + { +- timeout_steady = std::chrono::steady_clock::duration::max(); ++ timeout_steady = (std::chrono::steady_clock::duration::max)(); + } + + while (timeout_steady > std::chrono::steady_clock::duration::zero()) +diff --git a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h +index e93ebf3d6b..d6a44df142 100644 +--- a/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h ++++ b/sdk/include/opentelemetry/sdk/logs/batch_log_record_processor.h +@@ -72,7 +72,7 @@ class BatchLogRecordProcessor : public LogRecordProcessor + * NOTE: Timeout functionality not supported yet. + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shuts down the processor and does any cleanup required. Completely drains the buffer/queue of +@@ -82,7 +82,7 @@ class BatchLogRecordProcessor : public LogRecordProcessor + * NOTE: Timeout functionality not supported yet. + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Class destructor which invokes the Shutdown() method. +diff --git a/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h b/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h +index 335da7f668..8ca5cffcca 100644 +--- a/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h ++++ b/sdk/include/opentelemetry/sdk/logs/multi_log_record_processor.h +@@ -45,7 +45,7 @@ class MultiLogRecordProcessor : public LogRecordProcessor + * @return a result code indicating whether it succeeded, failed or timed out + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shuts down the processor and does any cleanup required. +@@ -55,7 +55,7 @@ class MultiLogRecordProcessor : public LogRecordProcessor + * @return true if the shutdown succeeded, false otherwise + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + private: + std::vector> processors_; +diff --git a/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h b/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h +index a748b06361..afbf4486b0 100644 +--- a/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h ++++ b/sdk/include/opentelemetry/sdk/trace/batch_span_processor.h +@@ -69,7 +69,7 @@ class BatchSpanProcessor : public SpanProcessor + * NOTE: Timeout functionality not supported yet. + */ + bool ForceFlush( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Shuts down the processor and does any cleanup required. Completely drains the buffer/queue of +@@ -79,7 +79,7 @@ class BatchSpanProcessor : public SpanProcessor + * NOTE: Timeout functionality not supported yet. + */ + bool Shutdown( +- std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override; ++ std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override; + + /** + * Class destructor which invokes the Shutdown() method. The Shutdown() method is supposed to be diff --git a/ports/opentelemetry-cpp/portfile.cmake b/ports/opentelemetry-cpp/portfile.cmake index abf959e27b09ed..f6781bb1b82d29 100644 --- a/ports/opentelemetry-cpp/portfile.cmake +++ b/ports/opentelemetry-cpp/portfile.cmake @@ -6,14 +6,13 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO open-telemetry/opentelemetry-cpp REF "v${VERSION}" - SHA512 55553e3695adbc446264a4589fe8e3b2a284c0aac50ce2a09f76913bc8c0196b8ec8f79a32366c4473196332d4bff058793fe54ad2e95350fc046e3d148c8abb + SHA512 38a3796a5f4c28fd54cc2a5475b3a024e2e73594acbc635fccc6358bf4d93ae897fc0ce55a93d27736a08622869ccc9fe9a9ee62e3884adadb3f135c27d378ec HEAD_REF main PATCHES - # When compiling code generated by gRPC we need to link the gRPC library - # too. - add-missing-dependencies.patch # Missing find_dependency for Abseil add-missing-find-dependency.patch + # Fix problems from removing NOMINMAX on Windows. Fixed in 1.14.0 + fix-nominmax-problems.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -24,7 +23,6 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS elasticsearch WITH_ELASTICSEARCH jaeger WITH_JAEGER otlp-http WITH_OTLP_HTTP - zpages WITH_ZPAGES otlp-grpc WITH_OTLP_GRPC ) diff --git a/ports/opentelemetry-cpp/vcpkg.json b/ports/opentelemetry-cpp/vcpkg.json index 5ac8f88894746f..3de8314a24d433 100644 --- a/ports/opentelemetry-cpp/vcpkg.json +++ b/ports/opentelemetry-cpp/vcpkg.json @@ -1,8 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "opentelemetry-cpp", - "version-semver": "1.12.0", - "port-version": 1, + "version-semver": "1.13.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." @@ -87,9 +86,6 @@ }, "zipkin": { "description": "Whether to include the Zipkin exporter in the SDK" - }, - "zpages": { - "description": "Whether to include the Zpages Server in the SDK" } } } diff --git a/versions/baseline.json b/versions/baseline.json index f2932131fc2ba1..1092883e28874c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6361,8 +6361,8 @@ "port-version": 1 }, "opentelemetry-cpp": { - "baseline": "1.12.0", - "port-version": 1 + "baseline": "1.13.0", + "port-version": 0 }, "opentelemetry-fluentd": { "baseline": "2.0.0", diff --git a/versions/o-/opentelemetry-cpp.json b/versions/o-/opentelemetry-cpp.json index 1fbfbd2d19b476..d225639c56dcac 100644 --- a/versions/o-/opentelemetry-cpp.json +++ b/versions/o-/opentelemetry-cpp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ee3f9ecfa4b682ab5d0ed2bb020d4e34f642cb7a", + "version-semver": "1.13.0", + "port-version": 0 + }, { "git-tree": "71dd31a63ee43f477bad710ccce04ffac2be5238", "version-semver": "1.12.0", From 9833a3697b7d653ee54c378ca55bb8ddac905457 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Fri, 5 Jan 2024 13:18:41 -0800 Subject: [PATCH 2/2] Fix whitespace and add quotes in portfile.cmake --- ports/opentelemetry-cpp/portfile.cmake | 8 ++++---- versions/o-/opentelemetry-cpp.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/opentelemetry-cpp/portfile.cmake b/ports/opentelemetry-cpp/portfile.cmake index f6781bb1b82d29..e691bd29e5b551 100644 --- a/ports/opentelemetry-cpp/portfile.cmake +++ b/ports/opentelemetry-cpp/portfile.cmake @@ -11,8 +11,8 @@ vcpkg_from_github( PATCHES # Missing find_dependency for Abseil add-missing-find-dependency.patch - # Fix problems from removing NOMINMAX on Windows. Fixed in 1.14.0 - fix-nominmax-problems.patch + # Fix problems from removing NOMINMAX on Windows. Fixed in 1.14.0 + fix-nominmax-problems.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -41,7 +41,7 @@ if(WITH_OTLP_GRPC) # 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}) + list(APPEND FEATURE_OPTIONS "-DgRPC_CPP_PLUGIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/grpc/grpc_cpp_plugin${VCPKG_HOST_EXECUTABLE_SUFFIX}") endif() vcpkg_cmake_configure( @@ -60,7 +60,7 @@ vcpkg_cmake_configure( ) vcpkg_cmake_install() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/versions/o-/opentelemetry-cpp.json b/versions/o-/opentelemetry-cpp.json index d225639c56dcac..e20d473aaaf063 100644 --- a/versions/o-/opentelemetry-cpp.json +++ b/versions/o-/opentelemetry-cpp.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "ee3f9ecfa4b682ab5d0ed2bb020d4e34f642cb7a", + "git-tree": "fe04f9f3867c1225a0636a9f410871b30dce6670", "version-semver": "1.13.0", "port-version": 0 },