build: regression after #1021 — Arrow's arrow_SOURCE_DIR collides with FetchContent on CMake 3.28, breaks vendored Arrow build
维护者通常 3 天内回复
评估
- 难度
- 3/5
- 预计耗时
- 半天
- 新手友好度
- 22/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- cmake, cpp
- 领域
- build-system
调研方向
The collision comes from the FetchContent_Declare(Arrow ...) call that commit 31659e7 introduced in the top-level CMake files, and Arrow's cpp/cmake_modules/ThirdpartyToolchain.cmake, which reads arrow_SOURCE_DIR to find thirdparty/versions.txt. Reproduce by configuring with CMake 3.28 and checking the file(STRINGS) error. Done means configure succeeds on CMake 3.28 with vendored Arrow. Linked PR #1029 already targets this, so check it before starting.
由索引模型根据 Issue 内容生成。
描述
After #1021 (commit 31659e7), configuring iceberg-cpp with vendored Arrow fails on CMake 3.28 (Ubuntu 24.04 LTS). The rename of the FetchContent content name from VendoredArrow to Arrow creates a variable-name collision with Arrow's own project(arrow) call, which Arrow's cpp/cmake_modules/ThirdpartyToolchain.cmake relies on.
Environment
- Ubuntu 24.04 LTS
- CMake 3.28.3
- GCC 14.2.0
- Fresh clone of main
Reproduction
git clone https://github.com/apache/iceberg-cpp.git
cd iceberg-cpp
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14
Error
CMake Error at build/_deps/arrow-src/cpp/cmake_modules/ThirdpartyToolchain.cmake:446 (file):
file STRINGS file
"/_deps/arrow-src/thirdparty/versions.txt"
cannot be read.
The file actually lives at _deps/arrow-src/cpp/thirdparty/versions.txt (inside cpp/). Because versions.txt can't be read, all *_BUILD_SHA256_CHECKSUM variables become empty and the subsequent Boost ExternalProject_Add fails with URL_HASH SHA256= (empty).
Root cause
Arrow's cpp/cmake_modules/ThirdpartyToolchain.cmake sets:
set(THIRDPARTY_DIR "${arrow_SOURCE_DIR}/thirdparty")
In a standalone Arrow build, project(arrow) in cpp/CMakeLists.txt sets arrow_SOURCE_DIR to the cpp/ directory. But when Arrow is pulled in by iceberg-cpp via FetchContent_Declare(Arrow ...), CMake pre-sets arrow_SOURCE_DIR to the tarball root (parent of cpp/). On CMake 3.28, the subsequent project(arrow) does not override the inherited arrow_SOURCE_DIR — PROJECT_SOURCE_DIR is updated, but arrow_SOURCE_DIR keeps the FetchContent value.
Verified with a minimal repro:
cmake_minimum_required(VERSION 3.25)
project(TestFC)
cmake_minimum_required(VERSION 3.25)
project(TestFC)
include(FetchContent)
FetchContent_Declare(Arrow URL file:///path/to/apache-arrow-25.0.0.tar.gz SOURCE_SUBDIR cpp)
FetchContent_Populate(Arrow)
arrow_SOURCE_DIR is set by FetchContent to the tarball root
Add a subdir that calls project(arrow)
→ PROJECT_SOURCE_DIR updates to /subdir, but arrow_SOURCE_DIR does NOT change
Before #1021 this worked because the FetchContent name was VendoredArrow (variable vendoredarrow_SOURCE_DIR), separate from Arrow's own arrow_SOURCE_DIR.
Why CI didn't catch it
CI runs on ubuntu-26.04, which ships a newer CMake. Either the newer CMake behaves differently for project() overrides, or a system Arrow is picked up by FIND_PACKAGE_ARGS CONFIG. Either way, CMake 3.28 on Ubuntu 24.04 LTS — the current widely-used LTS — isn't exercised.
Suggested fix
Rename back to VendoredArrow (or any name other than Arrow/arrow) to avoid the collision. Alternatively, consider adding ubuntu-24.04 with its stock CMake to the CI matrix.
Workaround
git revert 31659e7 locally.
- 主要语言
- C++
- 星标
- 228
- 派生
- 136
- 平均合并
- 4 天 18 小时
- 30 天内合并 PR
- 61
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/iceberg-cpp 的其他 Issue
-
Parquet reader: fall back to positional field IDs when a file has no field IDs and no name mapping未关闭
难度 4/5 3-5 天 新手友好度 45/100
apache/iceberg-cpp#1046 ·
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 12/100
apache/iceberg-cpp#1027 · 3 条评论 ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
apache/iceberg-cpp#1000 · 2 条评论 · 1 个 reaction ·
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 8/100
apache/iceberg-cpp#988 · 2 条评论 ·
维护者通常 3 天内回复
-
难度 5/5 一周以上 新手友好度 20/100
apache/iceberg-cpp#959 · 1 条评论 ·
维护者通常 3 天内回复
查看 apache/iceberg-cpp 的全部 Issue
相似的 Issue
-
[Docs] CONTRIBUTING still says FreeType 2.14.3 and TabLabel.h says ImGui 1.92.9b after the bumps可能已有人在做 @mgradwohl 今天认领。 未关闭agent:WSL documentation LOW
难度 1/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
finalburnneo/FBNeo#2820 · 1 条评论 ·
维护者通常 1 天内回复
-
area/ysql kind/enhancement priority/medium status/awaiting-triage
难度 2/5 1-3 小时 新手友好度 73/100
yugabyte/yugabyte-db#35578 ·
维护者通常 1 天内回复
-
cudf-polars feature request
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 2 天内回复
-
(S1 - Need confirmation)
难度 2/5 1-3 小时 新手友好度 68/100
CleverRaven/Cataclysm-DDA#89212 ·
维护者通常 1 天内回复