Repository navigation
Conversation
…versions of CMake
|
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped replacement uses an initialized source-directory variable and resolves the reported collision without identified regressions.
No open issues 🎉
What changed in this PR
Fixes Arrow C++ builds using FetchContent with older CMake versions by avoiding a source-directory variable collision.
Changes:
- Uses
ARROW_SOURCE_DIRto locate third-party files under the C++ source directory.
| File | Description |
|---|---|
| cpp/cmake_modules/ThirdpartyToolchain.cmake | Replaces the FetchContent-shadowed source-directory variable. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
For older versions of CMake the variable
arrow_SOURCE_DIRis overriden by FetchContent's one becauseproject(arrow)sets it as a cache variable while FetchContent sets a normal variable with precedence. Arrow can't findthirdparty/versions.txtbecause it is pointing to the tarball root instead of the cpp subfolder. See policy https://cmake.org/cmake/help/latest/policy/CMP0180.htmlThis has been tested and found at Iceberg-cpp here:
What changes are included in this PR?
Use
ARROW_SOURCE_DIRinstead ofarrow_SOURCE_DIRso FetchContent'sarrow_SOURCE_DIRdoes not have precedence.Are these changes tested?
Yes locally on the iceberg PR on Ubuntu 24.04.
Are there any user-facing changes?
No
Was AI used for this PR?
In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.
PR code and description written by:
I did use AI to initially find the root cause.
Reviewed before submission by: