You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "raulcd (via GitHub)" <gi...@apache.org> on 2025/12/16 11:37:19 UTC
[PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
raulcd opened a new pull request, #48556:
URL: https://github.com/apache/arrow/pull/48556
## TBD
### Rationale for this change
### What changes are included in this PR?
### Are these changes tested?
### Are there any user-facing changes?
**This PR includes breaking changes to public APIs.** (If there are any breaking changes to public APIs, please explain which changes are breaking. If not, you can remove this.)
**This PR contains a "Critical Fix".** (If the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld), please provide explanation. If not, you can remove this.)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3660194147
Revision: fc75e09310612c1d93322f96704be2963c96fab0
Submitted crossbow builds: [ursacomputing/crossbow @ actions-e46351eaaf](https://github.com/ursacomputing/crossbow/branches/all?query=actions-e46351eaaf)
|Task|Status|
|----|------|
|example-cpp-minimal-build-static|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282870/job/58193608891)|
|example-cpp-minimal-build-static-system-dependency|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283213/job/58193610150)|
|example-cpp-tutorial|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283863/job/58193612468)|
|test-build-cpp-fuzz|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282953/job/58193609217)|
|test-conda-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282943/job/58193609133)|
|test-conda-cpp-valgrind|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283689/job/58193611804)|
|test-cuda-cpp-ubuntu-22.04-cuda-11.7.1|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283505/job/58193611170)|
|test-cuda-cpp-ubuntu-24.04-cuda-13.0.2|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282659/job/58193608439)|
|test-debian-12-cpp-amd64|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283171/job/58193609998)|
|test-debian-12-cpp-i386|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283807/job/58193612297)|
|test-fedora-42-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283614/job/58193611592)|
|test-ubuntu-22.04-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283688/job/58193611806)|
|test-ubuntu-22.04-cpp-20|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283441/job/58193610919)|
|test-ubuntu-22.04-cpp-bundled|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283261/job/58193610405)|
|test-ubuntu-22.04-cpp-emscripten|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282987/job/58193609479)|
|test-ubuntu-22.04-cpp-no-threading|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283291/job/58193610428)|
|test-ubuntu-24.04-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283513/job/58193611177)|
|test-ubuntu-24.04-cpp-bundled-offline|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283777/job/58193612161)|
|test-ubuntu-24.04-cpp-gcc-13-bundled|[](https://github.com/ursacomputing/crossbow/actions/runs/20267283081/job/58193609733)|
|test-ubuntu-24.04-cpp-gcc-14|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282688/job/58193608472)|
|test-ubuntu-24.04-cpp-minimal-with-formats|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282693/job/58193608525)|
|test-ubuntu-24.04-cpp-thread-sanitizer|[](https://github.com/ursacomputing/crossbow/actions/runs/20267282883/job/58193608997)|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #48556:
URL: https://github.com/apache/arrow/pull/48556#discussion_r2623748949
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -3120,10 +3121,13 @@ function(build_grpc)
# Add warning suppression flags for gRPC build.
if(NOT MSVC)
- string(APPEND CMAKE_C_FLAGS
- " -Wno-attributes -Wno-format-security -Wno-unknown-warning-option")
- string(APPEND CMAKE_CXX_FLAGS
- " -Wno-attributes -Wno-format-security -Wno-unknown-warning-option")
+ string(APPEND CMAKE_C_FLAGS " -Wno-attributes -Wno-format-security")
+ string(APPEND CMAKE_CXX_FLAGS " -Wno-attributes -Wno-format-security")
+ endif()
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL
+ "Clang")
+ string(APPEND CMAKE_C_FLAGS " -Wno-unknown-warning-option")
+ string(APPEND CMAKE_CXX_FLAGS " -Wno-unknown-warning-option")
Review Comment:
This isn't strictly necessary for this PR but I found that it was raising a warning:
```
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou merged PR #48556:
URL: https://github.com/apache/arrow/pull/48556
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3660302615
@github-actions crossbow submit -g r
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3664535287
I am triggering the latest job without any changes on this PR just to diagnose a failure on a different PR :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3664523278
@github-actions crossbow submit test-ubuntu-24.04-cpp-thread-sanitizer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3691225150
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit cbd48a4d98ef4291927d940eb095f359bc270624.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/58913021087) has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #48556:
URL: https://github.com/apache/arrow/pull/48556#discussion_r2667747292
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -3726,220 +3689,87 @@ endif()
# ----------------------------------------------------------------------
# OpenTelemetry C++
-macro(build_opentelemetry)
- message(STATUS "Building OpenTelemetry from source")
+function(build_opentelemetry)
+ list(APPEND CMAKE_MESSAGE_INDENT "OpenTelemetry: ")
+ message(STATUS "Building OpenTelemetry from source using FetchContent")
+
if(Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
message(FATAL_ERROR "GH-36013: Can't use bundled OpenTelemetry with Protobuf 3.22 or later. "
"Protobuf is version ${Protobuf_VERSION}")
endif()
- set(OPENTELEMETRY_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry_ep-install")
- set(OPENTELEMETRY_INCLUDE_DIR "${OPENTELEMETRY_PREFIX}/include")
- set(OPENTELEMETRY_STATIC_LIB
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ set(OPENTELEMETRY_VENDORED
+ TRUE
+ PARENT_SCOPE)
+
+ fetchcontent_declare(opentelemetry_proto
+ ${FC_DECLARE_COMMON_OPTIONS}
+ URL ${OPENTELEMETRY_PROTO_SOURCE_URL}
+ URL_HASH "SHA256=${ARROW_OPENTELEMETRY_PROTO_BUILD_SHA256_CHECKSUM}"
)
- set(_OPENTELEMETRY_APIS api ext sdk)
- set(_OPENTELEMETRY_LIBS
- common
- http_client_curl
- logs
- ostream_log_record_exporter
- ostream_span_exporter
- otlp_http_client
- otlp_http_log_record_exporter
- otlp_http_exporter
- otlp_recordable
- proto
- resources
- trace
- version)
- set(OPENTELEMETRY_BUILD_BYPRODUCTS)
- set(OPENTELEMETRY_LIBRARIES)
-
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_APIS})
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} INTERFACE IMPORTED)
- target_include_directories(opentelemetry-cpp::${_OPENTELEMETRY_LIB} BEFORE
- INTERFACE "${OPENTELEMETRY_INCLUDE_DIR}")
- endforeach()
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_LIBS})
- # N.B. OTel targets and libraries don't follow any consistent naming scheme
- if(_OPENTELEMETRY_LIB STREQUAL "http_client_curl")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_span_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_span${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_client")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_client${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_log${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_logs${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- else()
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- endif()
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} STATIC IMPORTED)
- set_target_properties(opentelemetry-cpp::${_OPENTELEMETRY_LIB}
- PROPERTIES IMPORTED_LOCATION ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_BUILD_BYPRODUCTS ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_LIBRARIES opentelemetry-cpp::${_OPENTELEMETRY_LIB})
- endforeach()
- set(OPENTELEMETRY_CMAKE_ARGS
- ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=${OPENTELEMETRY_PREFIX}"
Review Comment:
Thanks for the assessment, I love that I always make the `protobug` typo, seems I'm not the only one :P
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3660184731
@github-actions crossbow submit -g cpp
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3669026222
@kou this should also be ready, follows the same pattern as the previous ones.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #48556:
URL: https://github.com/apache/arrow/pull/48556#discussion_r2667045766
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -3726,220 +3689,87 @@ endif()
# ----------------------------------------------------------------------
# OpenTelemetry C++
-macro(build_opentelemetry)
- message(STATUS "Building OpenTelemetry from source")
+function(build_opentelemetry)
+ list(APPEND CMAKE_MESSAGE_INDENT "OpenTelemetry: ")
+ message(STATUS "Building OpenTelemetry from source using FetchContent")
+
if(Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
message(FATAL_ERROR "GH-36013: Can't use bundled OpenTelemetry with Protobuf 3.22 or later. "
"Protobuf is version ${Protobuf_VERSION}")
endif()
- set(OPENTELEMETRY_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry_ep-install")
- set(OPENTELEMETRY_INCLUDE_DIR "${OPENTELEMETRY_PREFIX}/include")
- set(OPENTELEMETRY_STATIC_LIB
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ set(OPENTELEMETRY_VENDORED
+ TRUE
+ PARENT_SCOPE)
+
+ fetchcontent_declare(opentelemetry_proto
+ ${FC_DECLARE_COMMON_OPTIONS}
+ URL ${OPENTELEMETRY_PROTO_SOURCE_URL}
+ URL_HASH "SHA256=${ARROW_OPENTELEMETRY_PROTO_BUILD_SHA256_CHECKSUM}"
)
- set(_OPENTELEMETRY_APIS api ext sdk)
- set(_OPENTELEMETRY_LIBS
- common
- http_client_curl
- logs
- ostream_log_record_exporter
- ostream_span_exporter
- otlp_http_client
- otlp_http_log_record_exporter
- otlp_http_exporter
- otlp_recordable
- proto
- resources
- trace
- version)
- set(OPENTELEMETRY_BUILD_BYPRODUCTS)
- set(OPENTELEMETRY_LIBRARIES)
-
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_APIS})
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} INTERFACE IMPORTED)
- target_include_directories(opentelemetry-cpp::${_OPENTELEMETRY_LIB} BEFORE
- INTERFACE "${OPENTELEMETRY_INCLUDE_DIR}")
- endforeach()
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_LIBS})
- # N.B. OTel targets and libraries don't follow any consistent naming scheme
- if(_OPENTELEMETRY_LIB STREQUAL "http_client_curl")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_span_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_span${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_client")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_client${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_log${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_logs${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- else()
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- endif()
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} STATIC IMPORTED)
- set_target_properties(opentelemetry-cpp::${_OPENTELEMETRY_LIB}
- PROPERTIES IMPORTED_LOCATION ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_BUILD_BYPRODUCTS ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_LIBRARIES opentelemetry-cpp::${_OPENTELEMETRY_LIB})
- endforeach()
- set(OPENTELEMETRY_CMAKE_ARGS
- ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=${OPENTELEMETRY_PREFIX}"
- -DWITH_EXAMPLES=OFF)
+ # Use FetchContent_Populate instead of MakeAvailable because opentelemetry-proto
+ # has no CMakeLists.txt.
+ cmake_policy(PUSH)
+ if(POLICY CMP0169)
+ cmake_policy(SET CMP0169 OLD)
+ endif()
+ fetchcontent_populate(opentelemetry_proto)
+ cmake_policy(POP)
- set(OPENTELEMETRY_PREFIX_PATH_LIST)
- # Don't specify the DEPENDS unless we actually have dependencies, else
- # Ninja/other build systems may consider this target to always be dirty
- set(_OPENTELEMETRY_DEPENDENCIES)
- add_custom_target(opentelemetry_dependencies)
+ fetchcontent_declare(opentelemetry_cpp
+ ${FC_DECLARE_COMMON_OPTIONS}
+ URL ${OPENTELEMETRY_SOURCE_URL}
+ URL_HASH "SHA256=${ARROW_OPENTELEMETRY_BUILD_SHA256_CHECKSUM}")
- set(_OPENTELEMETRY_DEPENDENCIES "opentelemetry_dependencies")
- list(APPEND ARROW_BUNDLED_STATIC_LIBS ${OPENTELEMETRY_LIBRARIES})
- list(APPEND OPENTELEMETRY_PREFIX_PATH_LIST ${NLOHMANN_JSON_PREFIX})
+ prepare_fetchcontent()
- get_target_property(OPENTELEMETRY_PROTOBUF_INCLUDE_DIR ${ARROW_PROTOBUF_LIBPROTOBUF}
- INTERFACE_INCLUDE_DIRECTORIES)
- set(OPENTELEMETRY_PROTOBUF_LIBRARY "$<TARGET_FILE:${ARROW_PROTOBUF_LIBPROTOBUF}>")
- set(OPENTELEMETRY_PROTOC_EXECUTABLE "$<TARGET_FILE:${ARROW_PROTOBUF_PROTOC}>")
- list(APPEND
- OPENTELEMETRY_CMAKE_ARGS
- -DWITH_OTLP_HTTP=ON
- -DWITH_OTLP_GRPC=OFF
- # Disabled because it seemed to cause linking errors. May be worth a closer look.
- -DWITH_FUNC_TESTS=OFF
- # These options are slated for removal in v1.14 and their features are deemed stable
- # as of v1.13. However, setting their corresponding ENABLE_* macros in headers seems
- # finicky - resulting in build failures or ABI-related runtime errors during HTTP
- # client initialization. There may still be a solution, but we disable them for now.
- -DWITH_OTLP_HTTP_SSL_PREVIEW=OFF
- -DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=OFF
- "-DProtobuf_INCLUDE_DIR=${OPENTELEMETRY_PROTOBUF_INCLUDE_DIR}"
- "-DProtobuf_LIBRARY=${OPENTELEMETRY_PROTOBUF_LIBRARY}"
- "-DProtobuf_PROTOC_EXECUTABLE=${OPENTELEMETRY_PROTOC_EXECUTABLE}")
-
- # OpenTelemetry with OTLP enabled requires Protobuf definitions from a
- # submodule. This submodule path is hardcoded into their CMake definitions,
- # and submodules are not included in their releases. Add a custom build step
- # to download and extract the Protobufs.
-
- # Adding such a step is rather complicated, so instead: create a separate
- # ExternalProject that just fetches the Protobufs, then add a custom step
- # to the main build to copy the Protobufs.
- externalproject_add(opentelemetry_proto_ep
- ${EP_COMMON_OPTIONS}
- URL_HASH "SHA256=${ARROW_OPENTELEMETRY_PROTO_BUILD_SHA256_CHECKSUM}"
- URL ${OPENTELEMETRY_PROTO_SOURCE_URL}
- BUILD_COMMAND ""
- CONFIGURE_COMMAND ""
- INSTALL_COMMAND ""
- EXCLUDE_FROM_ALL OFF)
- if(NLOHMANN_JSON_VENDORED)
- add_dependencies(opentelemetry_dependencies nlohmann_json_fc)
- else()
- add_dependencies(opentelemetry_dependencies nlohmann_json::nlohmann_json)
- endif()
+ set(OTELCPP_PROTO_PATH "${opentelemetry_proto_SOURCE_DIR}")
+ set(WITH_EXAMPLES OFF)
+ set(WITH_OTLP_HTTP ON)
+ set(WITH_OTLP_GRPC OFF)
+ set(WITH_FUNC_TESTS OFF)
+ # These options are slated for removal in v1.14 and their features are deemed stable
+ # as of v1.13. However, setting their corresponding ENABLE_* macros in headers seems
+ # finicky - resulting in build failures or ABI-related runtime errors during HTTP
+ # client initialization. There may still be a solution, but we disable them for now.
+ set(WITH_OTLP_HTTP_SSL_PREVIEW OFF)
+ set(WITH_OTLP_HTTP_SSL_TLS_PREVIEW OFF)
- add_dependencies(opentelemetry_dependencies opentelemetry_proto_ep
- ${ARROW_PROTOBUF_LIBPROTOBUF})
+ fetchcontent_makeavailable(opentelemetry_cpp)
Review Comment:
Hm, seems like this actually breaks the complete docs build job https://github.com/apache/arrow/actions/runs/20356061612/job/58491733937
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #48556:
URL: https://github.com/apache/arrow/pull/48556#discussion_r2667049585
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -3726,220 +3689,87 @@ endif()
# ----------------------------------------------------------------------
# OpenTelemetry C++
-macro(build_opentelemetry)
- message(STATUS "Building OpenTelemetry from source")
+function(build_opentelemetry)
+ list(APPEND CMAKE_MESSAGE_INDENT "OpenTelemetry: ")
+ message(STATUS "Building OpenTelemetry from source using FetchContent")
+
if(Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
message(FATAL_ERROR "GH-36013: Can't use bundled OpenTelemetry with Protobuf 3.22 or later. "
"Protobuf is version ${Protobuf_VERSION}")
endif()
- set(OPENTELEMETRY_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry_ep-install")
- set(OPENTELEMETRY_INCLUDE_DIR "${OPENTELEMETRY_PREFIX}/include")
- set(OPENTELEMETRY_STATIC_LIB
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ set(OPENTELEMETRY_VENDORED
+ TRUE
+ PARENT_SCOPE)
+
+ fetchcontent_declare(opentelemetry_proto
+ ${FC_DECLARE_COMMON_OPTIONS}
+ URL ${OPENTELEMETRY_PROTO_SOURCE_URL}
+ URL_HASH "SHA256=${ARROW_OPENTELEMETRY_PROTO_BUILD_SHA256_CHECKSUM}"
)
- set(_OPENTELEMETRY_APIS api ext sdk)
- set(_OPENTELEMETRY_LIBS
- common
- http_client_curl
- logs
- ostream_log_record_exporter
- ostream_span_exporter
- otlp_http_client
- otlp_http_log_record_exporter
- otlp_http_exporter
- otlp_recordable
- proto
- resources
- trace
- version)
- set(OPENTELEMETRY_BUILD_BYPRODUCTS)
- set(OPENTELEMETRY_LIBRARIES)
-
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_APIS})
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} INTERFACE IMPORTED)
- target_include_directories(opentelemetry-cpp::${_OPENTELEMETRY_LIB} BEFORE
- INTERFACE "${OPENTELEMETRY_INCLUDE_DIR}")
- endforeach()
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_LIBS})
- # N.B. OTel targets and libraries don't follow any consistent naming scheme
- if(_OPENTELEMETRY_LIB STREQUAL "http_client_curl")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_span_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_span${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_client")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_client${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_log${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_logs${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- else()
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- endif()
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} STATIC IMPORTED)
- set_target_properties(opentelemetry-cpp::${_OPENTELEMETRY_LIB}
- PROPERTIES IMPORTED_LOCATION ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_BUILD_BYPRODUCTS ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_LIBRARIES opentelemetry-cpp::${_OPENTELEMETRY_LIB})
- endforeach()
- set(OPENTELEMETRY_CMAKE_ARGS
- ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=${OPENTELEMETRY_PREFIX}"
Review Comment:
Cuz before it was using a diff cmake ... which doesn't propagate `CMAKE_UNITY_BUILD=ON` but seems like now we pass it from the parent came L3739 ... ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3664191514
@github-actions crossbow submit -g r -g cpp
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3664201693
Revision: ddef2be59a1ba62bb9c590a6ae3fe31509e03c3f
Submitted crossbow builds: [ursacomputing/crossbow @ actions-d0a2796afe](https://github.com/ursacomputing/crossbow/branches/all?query=actions-d0a2796afe)
|Task|Status|
|----|------|
|example-cpp-minimal-build-static|[](https://github.com/ursacomputing/crossbow/actions/runs/20296306702/job/58290730025)|
|example-cpp-minimal-build-static-system-dependency|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309831/job/58290739184)|
|example-cpp-tutorial|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308756/job/58290736152)|
|r-binary-packages|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309888/job/58290805092)|
|r-recheck-most|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309365/job/58290737859)|
|test-build-cpp-fuzz|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307436/job/58290732233)|
|test-conda-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309047/job/58290736900)|
|test-conda-cpp-valgrind|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307752/job/58290733433)|
|test-cuda-cpp-ubuntu-22.04-cuda-11.7.1|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309006/job/58290736760)|
|test-cuda-cpp-ubuntu-24.04-cuda-13.0.2|[](https://github.com/ursacomputing/crossbow/actions/runs/20296306919/job/58290730650)|
|test-debian-12-cpp-amd64|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308761/job/58290736101)|
|test-debian-12-cpp-i386|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308472/job/58290735245)|
|test-fedora-42-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20296306964/job/58290730840)|
|test-r-arrow-backwards-compatibility|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308426/job/58290735089)|
|test-r-depsource-bundled|[](https://github.com/ursacomputing/crossbow/runs/58290736824)|
|test-r-depsource-system|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309726/job/58290738900)|
|test-r-dev-duckdb|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308147/job/58290734407)|
|test-r-devdocs|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309715/job/58290738884)|
|test-r-extra-packages|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308648/job/58290735802)|
|test-r-gcc-11|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307906/job/58290733652)|
|test-r-gcc-12|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309493/job/58290738195)|
|test-r-install-local|[](https://github.com/ursacomputing/crossbow/actions/runs/20296306778/job/58290730257)|
|test-r-install-local-minsizerel|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309460/job/58290738070)|
|test-r-linux-as-cran|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307794/job/58290733465)|
|test-r-linux-rchk|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309769/job/58290739166)|
|test-r-linux-sanitizers|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308519/job/58290735399)|
|test-r-linux-valgrind|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307352/job/58290732011)|
|test-r-m1-san|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308283/job/58290734738)|
|test-r-macos-as-cran|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309518/job/58290738279)|
|test-r-minimal-build|[](https://github.com/ursacomputing/crossbow/runs/58290736846)|
|test-r-offline-maximal|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308200/job/58290734515)|
|test-r-offline-minimal|[](https://github.com/ursacomputing/crossbow/runs/58290738898)|
|test-r-rhub-debian-gcc-devel-lto-latest|[](https://github.com/ursacomputing/crossbow/runs/58290738781)|
|test-r-rhub-ubuntu-gcc12-custom-ccache|[](https://github.com/ursacomputing/crossbow/runs/58290738004)|
|test-r-rhub-ubuntu-release-latest|[](https://github.com/ursacomputing/crossbow/runs/58290741030)|
|test-r-rocker-r-ver-latest|[](https://github.com/ursacomputing/crossbow/runs/58290737564)|
|test-r-rstudio-r-base-4.1-focal|[](https://github.com/ursacomputing/crossbow/runs/58290735899)|
|test-r-rstudio-r-base-4.2-focal|[](https://github.com/ursacomputing/crossbow/runs/58290737900)|
|test-r-ubuntu-22.04|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309593/job/58290738511)|
|test-r-versions|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307756/job/58290733355)|
|test-ubuntu-22.04-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309104/job/58290737019)|
|test-ubuntu-22.04-cpp-20|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309173/job/58290737314)|
|test-ubuntu-22.04-cpp-bundled|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309172/job/58290737342)|
|test-ubuntu-22.04-cpp-emscripten|[](https://github.com/ursacomputing/crossbow/actions/runs/20296306620/job/58290729879)|
|test-ubuntu-22.04-cpp-no-threading|[](https://github.com/ursacomputing/crossbow/actions/runs/20296309066/job/58290736927)|
|test-ubuntu-24.04-cpp|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308969/job/58290736653)|
|test-ubuntu-24.04-cpp-bundled-offline|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307621/job/58290732812)|
|test-ubuntu-24.04-cpp-gcc-13-bundled|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307399/job/58290732121)|
|test-ubuntu-24.04-cpp-gcc-14|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308237/job/58290734647)|
|test-ubuntu-24.04-cpp-minimal-with-formats|[](https://github.com/ursacomputing/crossbow/actions/runs/20296307084/job/58290731257)|
|test-ubuntu-24.04-cpp-thread-sanitizer|[](https://github.com/ursacomputing/crossbow/actions/runs/20296308444/job/58290735338)|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3664536170
Revision: ddef2be59a1ba62bb9c590a6ae3fe31509e03c3f
Submitted crossbow builds: [ursacomputing/crossbow @ actions-45e7cbdfe9](https://github.com/ursacomputing/crossbow/branches/all?query=actions-45e7cbdfe9)
|Task|Status|
|----|------|
|test-ubuntu-24.04-cpp-thread-sanitizer|[](https://github.com/ursacomputing/crossbow/actions/runs/20298461977/job/58297778554)|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #48556:
URL: https://github.com/apache/arrow/pull/48556#issuecomment-3660317069
Revision: fc75e09310612c1d93322f96704be2963c96fab0
Submitted crossbow builds: [ursacomputing/crossbow @ actions-ec54fcedbe](https://github.com/ursacomputing/crossbow/branches/all?query=actions-ec54fcedbe)
|Task|Status|
|----|------|
|r-binary-packages|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059810/job/58196252579)|
|r-recheck-most|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059726/job/58196252344)|
|test-r-arrow-backwards-compatibility|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058139/job/58196247158)|
|test-r-depsource-bundled|[](https://github.com/ursacomputing/crossbow/runs/58196253727)|
|test-r-depsource-system|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059071/job/58196250134)|
|test-r-dev-duckdb|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058744/job/58196248786)|
|test-r-devdocs|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059584/job/58196251766)|
|test-r-extra-packages|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058323/job/58196247506)|
|test-r-gcc-11|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059287/job/58196250841)|
|test-r-gcc-12|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058820/job/58196249022)|
|test-r-install-local|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058563/job/58196248295)|
|test-r-install-local-minsizerel|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058215/job/58196247375)|
|test-r-linux-as-cran|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059725/job/58196252332)|
|test-r-linux-rchk|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058807/job/58196248969)|
|test-r-linux-sanitizers|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059019/job/58196249897)|
|test-r-linux-valgrind|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058401/job/58196247660)|
|test-r-m1-san|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059295/job/58196250913)|
|test-r-macos-as-cran|[](https://github.com/ursacomputing/crossbow/actions/runs/20268057973/job/58196246761)|
|test-r-minimal-build|[](https://github.com/ursacomputing/crossbow/runs/58196256879)|
|test-r-offline-maximal|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059501/job/58196251477)|
|test-r-offline-minimal|[](https://github.com/ursacomputing/crossbow/runs/58196255225)|
|test-r-rhub-debian-gcc-devel-lto-latest|[](https://github.com/ursacomputing/crossbow/runs/58196256965)|
|test-r-rhub-ubuntu-gcc12-custom-ccache|[](https://github.com/ursacomputing/crossbow/runs/58196256894)|
|test-r-rhub-ubuntu-release-latest|[](https://github.com/ursacomputing/crossbow/runs/58196257819)|
|test-r-rocker-r-ver-latest|[](https://github.com/ursacomputing/crossbow/runs/58196255718)|
|test-r-rstudio-r-base-4.1-focal|[](https://github.com/ursacomputing/crossbow/runs/58196258715)|
|test-r-rstudio-r-base-4.2-focal|[](https://github.com/ursacomputing/crossbow/runs/58196259690)|
|test-r-ubuntu-22.04|[](https://github.com/ursacomputing/crossbow/actions/runs/20268059396/job/58196251118)|
|test-r-versions|[](https://github.com/ursacomputing/crossbow/actions/runs/20268058839/job/58196249067)|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-48555: [C++] Use FetchContent for bundled opentelemetry [arrow]
Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #48556:
URL: https://github.com/apache/arrow/pull/48556#discussion_r2667050868
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -3726,220 +3689,87 @@ endif()
# ----------------------------------------------------------------------
# OpenTelemetry C++
-macro(build_opentelemetry)
- message(STATUS "Building OpenTelemetry from source")
+function(build_opentelemetry)
+ list(APPEND CMAKE_MESSAGE_INDENT "OpenTelemetry: ")
+ message(STATUS "Building OpenTelemetry from source using FetchContent")
+
if(Protobuf_VERSION VERSION_GREATER_EQUAL 3.22)
message(FATAL_ERROR "GH-36013: Can't use bundled OpenTelemetry with Protobuf 3.22 or later. "
"Protobuf is version ${Protobuf_VERSION}")
endif()
- set(OPENTELEMETRY_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/opentelemetry_ep-install")
- set(OPENTELEMETRY_INCLUDE_DIR "${OPENTELEMETRY_PREFIX}/include")
- set(OPENTELEMETRY_STATIC_LIB
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ set(OPENTELEMETRY_VENDORED
+ TRUE
+ PARENT_SCOPE)
+
+ fetchcontent_declare(opentelemetry_proto
+ ${FC_DECLARE_COMMON_OPTIONS}
+ URL ${OPENTELEMETRY_PROTO_SOURCE_URL}
+ URL_HASH "SHA256=${ARROW_OPENTELEMETRY_PROTO_BUILD_SHA256_CHECKSUM}"
)
- set(_OPENTELEMETRY_APIS api ext sdk)
- set(_OPENTELEMETRY_LIBS
- common
- http_client_curl
- logs
- ostream_log_record_exporter
- ostream_span_exporter
- otlp_http_client
- otlp_http_log_record_exporter
- otlp_http_exporter
- otlp_recordable
- proto
- resources
- trace
- version)
- set(OPENTELEMETRY_BUILD_BYPRODUCTS)
- set(OPENTELEMETRY_LIBRARIES)
-
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_APIS})
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} INTERFACE IMPORTED)
- target_include_directories(opentelemetry-cpp::${_OPENTELEMETRY_LIB} BEFORE
- INTERFACE "${OPENTELEMETRY_INCLUDE_DIR}")
- endforeach()
- foreach(_OPENTELEMETRY_LIB ${_OPENTELEMETRY_LIBS})
- # N.B. OTel targets and libraries don't follow any consistent naming scheme
- if(_OPENTELEMETRY_LIB STREQUAL "http_client_curl")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_span_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_span${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_client")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_client${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "otlp_http_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_otlp_http_log${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- elseif(_OPENTELEMETRY_LIB STREQUAL "ostream_log_record_exporter")
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_exporter_ostream_logs${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- else()
- set(_OPENTELEMETRY_STATIC_LIBRARY
- "${OPENTELEMETRY_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}opentelemetry_${_OPENTELEMETRY_LIB}${CMAKE_STATIC_LIBRARY_SUFFIX}"
- )
- endif()
- add_library(opentelemetry-cpp::${_OPENTELEMETRY_LIB} STATIC IMPORTED)
- set_target_properties(opentelemetry-cpp::${_OPENTELEMETRY_LIB}
- PROPERTIES IMPORTED_LOCATION ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_BUILD_BYPRODUCTS ${_OPENTELEMETRY_STATIC_LIBRARY})
- list(APPEND OPENTELEMETRY_LIBRARIES opentelemetry-cpp::${_OPENTELEMETRY_LIB})
- endforeach()
- set(OPENTELEMETRY_CMAKE_ARGS
- ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=${OPENTELEMETRY_PREFIX}"
Review Comment:
which triggers protobug generated file schema are conflicted when `CMAKE_UNITY_BUILD` is on .. ? Let me try a quick fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org