Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

build: regression after #1021 — Arrow's arrow_SOURCE_DIR collides with FetchContent on CMake 3.28, breaks vendored Arrow build

Cerrado
#1,028 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@raulcd ya está trabajando en esto.

Desde el 16/10/2026.

  • #1029 de @raulcd — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
22/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
cmake, cpp
Área
build-system

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C++
Estrellas
228
Forks
136
Merge medio
5 d 19 h
PR fusionados (30 d)
53

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/iceberg-cpp

Todos los issues de apache/iceberg-cpp

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.