Skip to content

GH-48178: [C++] Use FetchContent for bundled RE2 - #48179

Merged
kou merged 4 commits into
apache:mainfrom
raulcd:GH-48178
Nov 22, 2025
Merged

kou merged 4 commits into
apache:mainfrom
raulcd:GH-48178

Conversation

@raulcd

@raulcd raulcd commented Nov 19, 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. Moving RE2 is the next step before moving Protobuf and gRPC.

What changes are included in this PR?

The general change is moving from ExternalProject to FetchContent.

It also add some required integration due to other dependencies, like gRPC, using ExternalProject. We not only have to build but also install in order for those other dependencies to find RE2. This causes some timing issues between config, build, install that requires us to create a custom target to depend on so the other dependencies find abseil.

Are these changes tested?

Yes, the changes are tested locally and on CI.

Are there any user-facing changes?

No

@raulcd raulcd added the CI: Extra Run extra CI label Nov 19, 2025
@raulcd

raulcd commented Nov 19, 2025

Copy link
Copy Markdown
Member Author

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

@github-actions

Copy link
Copy Markdown

Revision: 52369f3

Submitted crossbow builds: ursacomputing/crossbow @ actions-69fddcd9fb

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates RE2 dependency management from ExternalProject to FetchContent, aligning with the project's goal of modernizing CMake dependency handling for CMake 3.25+.

Key changes:

  • Converts RE2 from ExternalProject_Add to FetchContent with custom install handling
  • Implements a dual-installation strategy to support gRPC's ExternalProject-based build while preventing double installation
  • Updates gRPC integration to use the new re2_fc target and handle vendored RE2 paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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

@conbench-apache-arrow

Copy link
Copy Markdown

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

There were no benchmark performance regressions. 🎉

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

Mottl pushed a commit to Mottl/arrow that referenced this pull request May 26, 2026
### 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. Moving RE2 is the next step before moving Protobuf and gRPC.

### What changes are included in this PR?

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

It also add some required integration due to other dependencies, like gRPC, using `ExternalProject`. We not only have to build but also install in order for those other dependencies to find RE2. This causes some timing issues between config, build, install that requires us to create a custom target to depend on so the other dependencies find abseil.

### Are these changes tested?

Yes, the changes are tested locally and on CI.

### Are there any user-facing changes?

No
* GitHub Issue: apache#48178

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