From 35c36b3035ec88f0dffafe73c7d22ed7d9159634 Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Fri, 13 Nov 2026 13:44:50 +0900 Subject: [PATCH 1/4] build: vendor FetchContent dependencies by default --- CMakeLists.txt | 6 ++++++ README.md | 7 ++++++- mkdocs/docs/getting-started.md | 7 ++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a9c3b2ff1..63ab0036c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,12 @@ option(ICEBERG_ENABLE_ASAN "Enable Address Sanitizer" OFF) option(ICEBERG_ENABLE_UBSAN "Enable Undefined Behavior Sanitizer" OFF) include(GNUInstallDirs) +# Use pinned dependency sources unless the caller explicitly enables package lookup. +set(FETCHCONTENT_TRY_FIND_PACKAGE_MODE + NEVER + CACHE STRING "Whether FetchContent should look for installed dependencies") +set_property(CACHE FETCHCONTENT_TRY_FIND_PACKAGE_MODE PROPERTY STRINGS NEVER OPT_IN + ALWAYS) include(FetchContent) set(ICEBERG_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}") diff --git a/README.md b/README.md index 12755f65f3..f8589de66e 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,10 @@ ctest --test-dir build --output-on-failure ## Build with CMake +Dependencies managed with CMake FetchContent use the pinned sources by default. +Set `-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN` to try installed packages before +fetching sources. Use a fresh build directory when changing this setting. + ### Build, Run Tests and Install Core Libraries ```bash @@ -85,7 +89,7 @@ cmake --install build #### Provided Apache Arrow ```bash -cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_PREFIX_PATH=/path/to/arrow -DICEBERG_BUILD_BUNDLE=ON +cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_PREFIX_PATH=/path/to/arrow -DICEBERG_BUILD_BUNDLE=ON -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN cmake --build build ctest --test-dir build --output-on-failure cmake --install build @@ -95,6 +99,7 @@ cmake --install build | Option | Default | Description | |--------|---------|-------------| +| `FETCHCONTENT_TRY_FIND_PACKAGE_MODE` | `NEVER` | Set to `OPT_IN` to try installed FetchContent dependencies before fetching sources | | `ICEBERG_BUILD_STATIC` | `ON` | Build static library | | `ICEBERG_BUILD_SHARED` | `OFF` | Build shared library | | `ICEBERG_BUILD_TESTS` | `ON` | Build tests | diff --git a/mkdocs/docs/getting-started.md b/mkdocs/docs/getting-started.md index 41d554c429..437c69e151 100644 --- a/mkdocs/docs/getting-started.md +++ b/mkdocs/docs/getting-started.md @@ -39,6 +39,10 @@ ctest --test-dir build --output-on-failure ## Build with CMake +Dependencies managed with CMake FetchContent use the pinned sources by default. +Set `-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN` to try installed packages before +fetching sources. Use a fresh build directory when changing this setting. + ### Core Libraries ```bash @@ -59,7 +63,7 @@ cmake --install build ### Bundle Library (with provided Apache Arrow) ```bash -cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_PREFIX_PATH=/path/to/arrow -DICEBERG_BUILD_BUNDLE=ON +cmake -S . -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_PREFIX_PATH=/path/to/arrow -DICEBERG_BUILD_BUNDLE=ON -DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN cmake --build build cmake --install build ``` @@ -68,6 +72,7 @@ cmake --install build | Option | Default | Description | |--------|---------|-------------| +| `FETCHCONTENT_TRY_FIND_PACKAGE_MODE` | `NEVER` | Set to `OPT_IN` to try installed FetchContent dependencies before fetching sources | | `ICEBERG_BUILD_STATIC` | `ON` | Build static library | | `ICEBERG_BUILD_SHARED` | `OFF` | Build shared library | | `ICEBERG_BUILD_TESTS` | `ON` | Build tests | From f71d95512fcb2c47f8b79c9cc23d074f4e772588 Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Tue, 17 Nov 2026 15:45:45 +0800 Subject: [PATCH 2/4] build: require Arrow 25 for system dependencies Keep the minimum supported Arrow version separate from the vendored source version. Check it during FetchContent lookup, explicit Arrow and Parquet lookup, and installed Iceberg dependency discovery. Document source fallback for unsupported installed Arrow packages and the configuration error for unsupported Parquet packages. Co-authored-by: Codex --- README.md | 6 ++++++ cmake_modules/IcebergThirdpartyToolchain.cmake | 9 ++++++--- mkdocs/docs/getting-started.md | 6 ++++++ src/iceberg/iceberg-config.cmake.in | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f8589de66e..f39047781a 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,12 @@ Dependencies managed with CMake FetchContent use the pinned sources by default. Set `-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN` to try installed packages before fetching sources. Use a fresh build directory when changing this setting. +Provided Apache Arrow and Parquet packages must be version 25.0.0 or a newer +compatible version. +With `OPT_IN`, an older Arrow package is skipped in favor of the pinned sources. +If a compatible Arrow package is found, a compatible Parquet package is required; +otherwise, CMake configuration fails. + ### Build, Run Tests and Install Core Libraries ```bash diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index b176dead8a..dbec61a069 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -94,6 +94,8 @@ endfunction() # cmake -S . -B build # +# Keep the minimum supported version independent of the vendored source version. +set(ICEBERG_ARROW_MIN_VERSION "25.0.0") set(ICEBERG_ARROW_BUILD_VERSION "25.0.0") set(ICEBERG_ARROW_BUILD_SHA256_CHECKSUM "12afc2dc8137bdd4a68876cec939f664c9d55cfc7b75f55b45163ebb4e344d81") @@ -260,7 +262,8 @@ function(resolve_arrow_dependency) URL ${ARROW_SOURCE_URL} URL_HASH "SHA256=${ICEBERG_ARROW_BUILD_SHA256_CHECKSUM}" PATCH_COMMAND ${ARROW_PATCH_COMMAND} SOURCE_SUBDIR cpp - FIND_PACKAGE_ARGS CONFIG) + FIND_PACKAGE_ARGS ${ICEBERG_ARROW_MIN_VERSION} + CONFIG) fetchcontent_makeavailable(Arrow) @@ -330,8 +333,8 @@ function(resolve_arrow_dependency) endif() else() set(ARROW_VENDORED FALSE) - find_package(Arrow CONFIG REQUIRED) - find_package(Parquet CONFIG REQUIRED) + find_package(Arrow ${ICEBERG_ARROW_MIN_VERSION} CONFIG REQUIRED) + find_package(Parquet ${ICEBERG_ARROW_MIN_VERSION} CONFIG REQUIRED) list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Arrow Parquet) endif() diff --git a/mkdocs/docs/getting-started.md b/mkdocs/docs/getting-started.md index 437c69e151..5b45a2580f 100644 --- a/mkdocs/docs/getting-started.md +++ b/mkdocs/docs/getting-started.md @@ -43,6 +43,12 @@ Dependencies managed with CMake FetchContent use the pinned sources by default. Set `-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN` to try installed packages before fetching sources. Use a fresh build directory when changing this setting. +Provided Apache Arrow and Parquet packages must be version 25.0.0 or a newer +compatible version. +With `OPT_IN`, an older Arrow package is skipped in favor of the pinned sources. +If a compatible Arrow package is found, a compatible Parquet package is required; +otherwise, CMake configuration fails. + ### Core Libraries ```bash diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index c8e2334fa7..8e977cbe0d 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -44,6 +44,8 @@ set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@") # Extra args forwarded to find_dependency() for specific dependencies. set(ICEBERG_FIND_EXTRA_ARGS_AWSSDK "@ICEBERG_FIND_EXTRA_ARGS_AWSSDK@") +set(ICEBERG_FIND_EXTRA_ARGS_Arrow "@ICEBERG_ARROW_MIN_VERSION@;CONFIG") +set(ICEBERG_FIND_EXTRA_ARGS_Parquet "@ICEBERG_ARROW_MIN_VERSION@;CONFIG") include(CMakeFindDependencyMacro) From 35fd9f8cd81a8d6d224f6079ee71a65400a665d6 Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Tue, 17 Nov 2026 16:03:13 +0800 Subject: [PATCH 3/4] docs: centralize Arrow dependency requirements Keep the minimum-version explanation in the getting-started guide and refer to the configured requirement instead of duplicating its value. Co-authored-by: Codex --- README.md | 6 ------ mkdocs/docs/getting-started.md | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f39047781a..f8589de66e 100644 --- a/README.md +++ b/README.md @@ -60,12 +60,6 @@ Dependencies managed with CMake FetchContent use the pinned sources by default. Set `-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN` to try installed packages before fetching sources. Use a fresh build directory when changing this setting. -Provided Apache Arrow and Parquet packages must be version 25.0.0 or a newer -compatible version. -With `OPT_IN`, an older Arrow package is skipped in favor of the pinned sources. -If a compatible Arrow package is found, a compatible Parquet package is required; -otherwise, CMake configuration fails. - ### Build, Run Tests and Install Core Libraries ```bash diff --git a/mkdocs/docs/getting-started.md b/mkdocs/docs/getting-started.md index 5b45a2580f..92b567b8e7 100644 --- a/mkdocs/docs/getting-started.md +++ b/mkdocs/docs/getting-started.md @@ -43,9 +43,9 @@ Dependencies managed with CMake FetchContent use the pinned sources by default. Set `-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN` to try installed packages before fetching sources. Use a fresh build directory when changing this setting. -Provided Apache Arrow and Parquet packages must be version 25.0.0 or a newer -compatible version. -With `OPT_IN`, an older Arrow package is skipped in favor of the pinned sources. +Provided Apache Arrow and Parquet packages must satisfy the minimum version set +by `ICEBERG_ARROW_MIN_VERSION` in `cmake_modules/IcebergThirdpartyToolchain.cmake`. +With `OPT_IN`, an unsupported Arrow package is skipped in favor of the pinned sources. If a compatible Arrow package is found, a compatible Parquet package is required; otherwise, CMake configuration fails. From e02080723527888bed044602cc3b2f94e90eada4 Mon Sep 17 00:00:00 2001 From: Manu Zhang Date: Tue, 17 Nov 2026 16:23:01 +0800 Subject: [PATCH 4/4] build: reuse Arrow build version for compatibility checks Use the source build version as the minimum accepted Arrow and Parquet package version in build and installed-package lookups. Remove the separate minimum-version setting and update the guide reference. Co-authored-by: Codex --- cmake_modules/IcebergThirdpartyToolchain.cmake | 8 +++----- mkdocs/docs/getting-started.md | 2 +- src/iceberg/iceberg-config.cmake.in | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cmake_modules/IcebergThirdpartyToolchain.cmake b/cmake_modules/IcebergThirdpartyToolchain.cmake index dbec61a069..5c76f7a546 100644 --- a/cmake_modules/IcebergThirdpartyToolchain.cmake +++ b/cmake_modules/IcebergThirdpartyToolchain.cmake @@ -94,8 +94,6 @@ endfunction() # cmake -S . -B build # -# Keep the minimum supported version independent of the vendored source version. -set(ICEBERG_ARROW_MIN_VERSION "25.0.0") set(ICEBERG_ARROW_BUILD_VERSION "25.0.0") set(ICEBERG_ARROW_BUILD_SHA256_CHECKSUM "12afc2dc8137bdd4a68876cec939f664c9d55cfc7b75f55b45163ebb4e344d81") @@ -262,7 +260,7 @@ function(resolve_arrow_dependency) URL ${ARROW_SOURCE_URL} URL_HASH "SHA256=${ICEBERG_ARROW_BUILD_SHA256_CHECKSUM}" PATCH_COMMAND ${ARROW_PATCH_COMMAND} SOURCE_SUBDIR cpp - FIND_PACKAGE_ARGS ${ICEBERG_ARROW_MIN_VERSION} + FIND_PACKAGE_ARGS ${ICEBERG_ARROW_BUILD_VERSION} CONFIG) fetchcontent_makeavailable(Arrow) @@ -333,8 +331,8 @@ function(resolve_arrow_dependency) endif() else() set(ARROW_VENDORED FALSE) - find_package(Arrow ${ICEBERG_ARROW_MIN_VERSION} CONFIG REQUIRED) - find_package(Parquet ${ICEBERG_ARROW_MIN_VERSION} CONFIG REQUIRED) + find_package(Arrow ${ICEBERG_ARROW_BUILD_VERSION} CONFIG REQUIRED) + find_package(Parquet ${ICEBERG_ARROW_BUILD_VERSION} CONFIG REQUIRED) list(APPEND ICEBERG_SYSTEM_DEPENDENCIES Arrow Parquet) endif() diff --git a/mkdocs/docs/getting-started.md b/mkdocs/docs/getting-started.md index 92b567b8e7..e67f56b8ba 100644 --- a/mkdocs/docs/getting-started.md +++ b/mkdocs/docs/getting-started.md @@ -44,7 +44,7 @@ Set `-DFETCHCONTENT_TRY_FIND_PACKAGE_MODE=OPT_IN` to try installed packages befo fetching sources. Use a fresh build directory when changing this setting. Provided Apache Arrow and Parquet packages must satisfy the minimum version set -by `ICEBERG_ARROW_MIN_VERSION` in `cmake_modules/IcebergThirdpartyToolchain.cmake`. +by `ICEBERG_ARROW_BUILD_VERSION` in `cmake_modules/IcebergThirdpartyToolchain.cmake`. With `OPT_IN`, an unsupported Arrow package is skipped in favor of the pinned sources. If a compatible Arrow package is found, a compatible Parquet package is required; otherwise, CMake configuration fails. diff --git a/src/iceberg/iceberg-config.cmake.in b/src/iceberg/iceberg-config.cmake.in index 8e977cbe0d..fc9c28252f 100644 --- a/src/iceberg/iceberg-config.cmake.in +++ b/src/iceberg/iceberg-config.cmake.in @@ -44,8 +44,8 @@ set(ICEBERG_SYSTEM_DEPENDENCIES "@ICEBERG_SYSTEM_DEPENDENCIES@") # Extra args forwarded to find_dependency() for specific dependencies. set(ICEBERG_FIND_EXTRA_ARGS_AWSSDK "@ICEBERG_FIND_EXTRA_ARGS_AWSSDK@") -set(ICEBERG_FIND_EXTRA_ARGS_Arrow "@ICEBERG_ARROW_MIN_VERSION@;CONFIG") -set(ICEBERG_FIND_EXTRA_ARGS_Parquet "@ICEBERG_ARROW_MIN_VERSION@;CONFIG") +set(ICEBERG_FIND_EXTRA_ARGS_Arrow "@ICEBERG_ARROW_BUILD_VERSION@;CONFIG") +set(ICEBERG_FIND_EXTRA_ARGS_Parquet "@ICEBERG_ARROW_BUILD_VERSION@;CONFIG") include(CMakeFindDependencyMacro)