build: regression after #1021 — Arrow's arrow_SOURCE_DIR collides with FetchContent on CMake 3.28, breaks vendored Arrow build
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 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
- 平均マージ
- 5日 19時間
- マージ済み PR(30日)
- 53
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/iceberg-cpp のほかの issue
-
bug: TableMetadataBuilder::RemoveSchemas leaves removed ids in the schema index対応中かも @LuciferYang が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/iceberg-cpp#1011 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
apache/iceberg-cpp#1027 ·
メンテナーはふだん 2 日以内に返信
-
bug: gzip table metadata is neither written nor detected as gzip対応中かも @LuciferYang が 5 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
apache/iceberg-cpp#1013 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
apache/iceberg-cpp#1000 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
apache/iceberg-cpp#988 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
apache/iceberg-cpp の issue をすべて見る
似ている issue
-
Bug: negative DECIMAL with fewer digits than its scale prints as "0.-5"対応中かも @adsharma が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
LadybugDB/ladybug#1311 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
メンテナーはふだん 1 日以内に返信
-
(S1 - Need confirmation)
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
CleverRaven/Cataclysm-DDA#89159 ·
メンテナーはふだん 1 日以内に返信
-
area:libnvmpi bug P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gjrtimmer/jetson-nvmpi#33 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信