Skip to content

GH-48555: [C++] Use FetchContent for bundled opentelemetry - #48556

Merged
kou merged 3 commits into
apache:mainfrom
raulcd:GH-48555
Dec 19, 2025
Merged

kou merged 3 commits into
apache:mainfrom
raulcd:GH-48555

Conversation

@raulcd

@raulcd raulcd commented Dec 16, 2025 •

Copy link
Copy Markdown
Member

Rationale for this change

As a follow up of requiring a minimum CMake version >= 3.25 we discussed moving our dependencies from ExternalProject to FetchContent. This can simplify our third party dependency management.

What changes are included in this PR?

The general change is moving opentelemetry from ExternalProject to FetchContent.

We can clean up previously required installation on nlohmann-json. There has been also a minor unrelated change fixing a warning raised on non-clang compiler when using -Wno-unknown-warning-option

Are these changes tested?

Yes, the changes are tested locally and on CI.

Are there any user-facing changes?

No

@raulcd

raulcd commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g cpp

@github-actions

Copy link
Copy Markdown

Revision: fc75e09

Submitted crossbow builds: ursacomputing/crossbow @ actions-e46351eaaf

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-cuda-cpp-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-cuda-cpp-ubuntu-24.04-cuda-13.0.2 GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@raulcd

raulcd commented Dec 16, 2025

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g r

@github-actions

Copy link
Copy Markdown

Revision: fc75e09

Submitted crossbow builds: ursacomputing/crossbow @ actions-ec54fcedbe

Task Status
r-binary-packages GitHub Actions
r-recheck-most GitHub Actions
test-r-arrow-backwards-compatibility GitHub Actions
test-r-depsource-bundled Azure
test-r-depsource-system GitHub Actions
test-r-dev-duckdb GitHub Actions
test-r-devdocs GitHub Actions
test-r-extra-packages GitHub Actions
test-r-gcc-11 GitHub Actions
test-r-gcc-12 GitHub Actions
test-r-install-local GitHub Actions
test-r-install-local-minsizerel GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-linux-rchk GitHub Actions
test-r-linux-sanitizers GitHub Actions
test-r-linux-valgrind GitHub Actions
test-r-m1-san GitHub Actions
test-r-macos-as-cran GitHub Actions
test-r-minimal-build Azure
test-r-offline-maximal GitHub Actions
test-r-offline-minimal Azure
test-r-rhub-debian-gcc-devel-lto-latest Azure
test-r-rhub-ubuntu-gcc12-custom-ccache Azure
test-r-rhub-ubuntu-release-latest Azure
test-r-rocker-r-ver-latest Azure
test-r-rstudio-r-base-4.1-focal Azure
test-r-rstudio-r-base-4.2-focal Azure
test-r-ubuntu-22.04 GitHub Actions
test-r-versions GitHub Actions

@raulcd raulcd added the CI: Extra Run extra CI label Dec 16, 2025
Comment on lines -3123 to +3130
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")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

@raulcd

raulcd commented Dec 17, 2025

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit -g r -g cpp

@github-actions

Copy link
Copy Markdown

Revision: ddef2be

Submitted crossbow builds: ursacomputing/crossbow @ actions-d0a2796afe

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
r-binary-packages GitHub Actions
r-recheck-most GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-cuda-cpp-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-cuda-cpp-ubuntu-24.04-cuda-13.0.2 GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-42-cpp GitHub Actions
test-r-arrow-backwards-compatibility GitHub Actions
test-r-depsource-bundled Azure
test-r-depsource-system GitHub Actions
test-r-dev-duckdb GitHub Actions
test-r-devdocs GitHub Actions
test-r-extra-packages GitHub Actions
test-r-gcc-11 GitHub Actions
test-r-gcc-12 GitHub Actions
test-r-install-local GitHub Actions
test-r-install-local-minsizerel GitHub Actions
test-r-linux-as-cran GitHub Actions
test-r-linux-rchk GitHub Actions
test-r-linux-sanitizers GitHub Actions
test-r-linux-valgrind GitHub Actions
test-r-m1-san GitHub Actions
test-r-macos-as-cran GitHub Actions
test-r-minimal-build Azure
test-r-offline-maximal GitHub Actions
test-r-offline-minimal Azure
test-r-rhub-debian-gcc-devel-lto-latest Azure
test-r-rhub-ubuntu-gcc12-custom-ccache Azure
test-r-rhub-ubuntu-release-latest Azure
test-r-rocker-r-ver-latest Azure
test-r-rstudio-r-base-4.1-focal Azure
test-r-rstudio-r-base-4.2-focal Azure
test-r-ubuntu-22.04 GitHub Actions
test-r-versions GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@raulcd
raulcd marked this pull request as ready for review December 17, 2025 09:34
@raulcd
raulcd requested a review from kou December 17, 2025 09:35
@raulcd

raulcd commented Dec 17, 2025

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-ubuntu-24.04-cpp-thread-sanitizer

@raulcd

raulcd commented Dec 17, 2025

Copy link
Copy Markdown
Member Author

I am triggering the latest job without any changes on this PR just to diagnose a failure on a different PR :)

@github-actions

Copy link
Copy Markdown

Revision: ddef2be

Submitted crossbow builds: ursacomputing/crossbow @ actions-45e7cbdfe9

Task Status
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

@raulcd

raulcd commented Dec 18, 2025

Copy link
Copy Markdown
Member Author

@kou this should also be ready, follows the same pattern as the previous ones.

@kou kou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1

@kou
kou merged commit cbd48a4 into apache:main Dec 19, 2025
jonahkel pushed a commit to jonahkel/arrow that referenced this pull request Dec 22, 2025
…che#48556)

### Rationale for this change

As a follow up of requiring a minimum CMake version >= 3.25 we discussed moving our dependencies from ExternalProject to FetchContent. This can simplify our third party dependency management.

### What changes are included in this PR?

The general change is moving opentelemetry from `ExternalProject` to `FetchContent`. 

We can clean up previously required installation on nlohmann-json. There has been also a minor unrelated change fixing a warning raised on non-clang compiler when using ` -Wno-unknown-warning-option`

### Are these changes tested?

Yes, the changes are tested locally and on CI.

### Are there any user-facing changes?

No

* GitHub Issue: apache#48555

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit cbd48a4.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them.


add_dependencies(opentelemetry_dependencies opentelemetry_proto_ep
${ARROW_PROTOBUF_LIBPROTOBUF})
fetchcontent_makeavailable(opentelemetry_cpp)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hm, seems like this actually breaks the complete docs build job https://github.com/apache/arrow/actions/runs/20356061612/job/58491733937

endforeach()

set(OPENTELEMETRY_CMAKE_ARGS
${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=${OPENTELEMETRY_PREFIX}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 ... ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

which triggers protobug generated file schema are conflicted when CMAKE_UNITY_BUILD is on .. ? Let me try a quick fix.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the assessment, I love that I always make the protobug typo, seems I'm not the only one :P

@raulcd
raulcd deleted the GH-48555 branch January 7, 2026 09:49
Mottl pushed a commit to Mottl/arrow that referenced this pull request May 26, 2026
…che#48556)

### Rationale for this change

As a follow up of requiring a minimum CMake version >= 3.25 we discussed moving our dependencies from ExternalProject to FetchContent. This can simplify our third party dependency management.

### What changes are included in this PR?

The general change is moving opentelemetry from `ExternalProject` to `FetchContent`. 

We can clean up previously required installation on nlohmann-json. There has been also a minor unrelated change fixing a warning raised on non-clang compiler when using ` -Wno-unknown-warning-option`

### Are these changes tested?

Yes, the changes are tested locally and on CI.

### Are there any user-facing changes?

No

* GitHub Issue: apache#48555

Authored-by: Raúl Cumplido <raulcumplido@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants