From 916c422dd8ce41210358c3f2260a0bbef59f3c46 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 29 Jun 2026 20:52:32 -0500 Subject: [PATCH 1/6] ci: use Debug build and shared-only for faster CI Default all platforms to Debug (was Release on Windows, Debug on Unix). Build only the shared library (was both static and shared). The release candidate workflow already validates Release builds on all platforms. --- ci/scripts/build_example.sh | 10 +++++----- ci/scripts/build_iceberg.sh | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ci/scripts/build_example.sh b/ci/scripts/build_example.sh index 41714cf32c..fde163321a 100755 --- a/ci/scripts/build_example.sh +++ b/ci/scripts/build_example.sh @@ -38,19 +38,19 @@ CMAKE_ARGS=( if is_windows; then CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake") - CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release") -else - CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug") fi +build_type="${ICEBERG_BUILD_TYPE:-Debug}" +CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}") + cmake "${CMAKE_ARGS[@]}" ${source_dir} if is_windows; then - cmake --build . --config Release + cmake --build . --config "${build_type}" if [[ "${run_example}" == "ON" ]]; then if [[ -x ./demo_example.exe ]]; then ./demo_example.exe else - ./Release/demo_example.exe + ./"${build_type}"/demo_example.exe fi fi else diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index 6af0802f6b..b6499200cc 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -40,7 +40,7 @@ is_windows() { CMAKE_ARGS=( "-G Ninja" "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}" - "-DICEBERG_BUILD_STATIC=ON" + "-DICEBERG_BUILD_STATIC=OFF" "-DICEBERG_BUILD_SHARED=ON" "-DICEBERG_BUILD_REST_INTEGRATION_TESTS=${build_rest_integration_test}" ) @@ -65,15 +65,15 @@ fi if is_windows; then CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake") - CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release") -else - # Pass an externally provided toolchain (e.g. vcpkg for the SigV4 job) - if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then - CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") - fi - CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug") fi +# Pass an externally provided toolchain (e.g. vcpkg for the SigV4 job) +if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then + CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") +fi + +CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${ICEBERG_BUILD_TYPE:-Debug}") + if [[ "${build_enable_sccache}" == "ON" ]]; then CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER_LAUNCHER=sccache") CMAKE_ARGS+=("-DCMAKE_C_COMPILER_LAUNCHER=sccache") @@ -85,10 +85,12 @@ if [[ -n "${ICEBERG_EXTRA_CMAKE_ARGS:-}" ]]; then fi cmake "${CMAKE_ARGS[@]}" ${source_dir} + +build_type="${ICEBERG_BUILD_TYPE:-Debug}" if is_windows; then - cmake --build . --config Release --target install + cmake --build . --config "${build_type}" --target install if [[ "${run_tests}" == "ON" ]]; then - ctest --output-on-failure -C Release + ctest --output-on-failure -C "${build_type}" fi else cmake --build . --target install From b358d873d68fdcc081a43aea9b9533254125fe07 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 29 Jun 2026 21:24:45 -0500 Subject: [PATCH 2/6] ci: apply /Z7 debug info unconditionally on MSVC Vendored Boost hits PDB lock contention (C1041) when building Debug with Ninja parallelism. The /Z7 flag was only applied when sccache was the compiler launcher; apply it for all MSVC Debug builds. --- cmake_modules/IcebergSccache.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake_modules/IcebergSccache.cmake b/cmake_modules/IcebergSccache.cmake index d02e65df53..0104a0a4d4 100644 --- a/cmake_modules/IcebergSccache.cmake +++ b/cmake_modules/IcebergSccache.cmake @@ -15,8 +15,8 @@ # specific language governing permissions and limitations # under the License. -if(MSVC_TOOLCHAIN AND "${CMAKE_CXX_COMPILER_LAUNCHER}" STREQUAL "sccache") - message(STATUS "Configuring sccache for MSVC") +if(MSVC_TOOLCHAIN) + message(STATUS "Using /Z7 debug info for MSVC (avoids PDB lock contention with Ninja)") # Remove /Zi or /ZI string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") From a900ed640a13ac41f66152ea834bcf2b5c5f42d6 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 29 Jun 2026 21:32:50 -0500 Subject: [PATCH 3/6] ci: use CMP0141 to force /Z7 on all MSVC targets The per-flag string replacement only affects the default CMAKE_*_FLAGS but vendored Boost overrides them with target-level /Zi, causing PDB lock contention under Ninja. CMP0141 + CMAKE_MSVC_DEBUG_INFORMATION_FORMAT forces /Z7 for all targets including FetchContent dependencies. --- cmake_modules/IcebergSccache.cmake | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/cmake_modules/IcebergSccache.cmake b/cmake_modules/IcebergSccache.cmake index 0104a0a4d4..dbe459a7ae 100644 --- a/cmake_modules/IcebergSccache.cmake +++ b/cmake_modules/IcebergSccache.cmake @@ -16,21 +16,18 @@ # under the License. if(MSVC_TOOLCHAIN) - message(STATUS "Using /Z7 debug info for MSVC (avoids PDB lock contention with Ninja)") + message(STATUS "Embedding debug info (/Z7) on MSVC to avoid PDB lock contention with Ninja") - # Remove /Zi or /ZI - string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") - string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + # CMake 3.25+ policy: force /Z7 (Embedded) for ALL targets including FetchContent deps. + # Without this, vendored Boost uses /Zi which races on the shared .pdb under Ninja. + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT Embedded) - string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_RELWITHDEBINFO + # Belt-and-suspenders: also patch the default flag strings for older CMake code paths. + string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") - string(REGEX REPLACE "/Z[iI]" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO + string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - - # Add /Z7 - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Z7") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7") - - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Z7") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Z7") endif() From 045190a1a652ebe9631fa78c0cc9f7cd67872a4f Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 29 Jun 2026 22:03:12 -0500 Subject: [PATCH 4/6] ci: fix Debug and shared-only build issues Replace constexpr static PartitionValues with inline static const since PartitionValues has a virtual base class (not a literal type). MSVC Debug correctly rejects this; GCC/Clang are lenient. Use generator expressions for test link targets so tests resolve whichever library variant is available (static or shared). --- src/iceberg/test/CMakeLists.txt | 5 +++-- src/iceberg/test/scan_test_base.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/iceberg/test/CMakeLists.txt b/src/iceberg/test/CMakeLists.txt index fcbc22126f..22602f8f23 100644 --- a/src/iceberg/test/CMakeLists.txt +++ b/src/iceberg/test/CMakeLists.txt @@ -264,7 +264,7 @@ if(ICEBERG_BUILD_SQL_CATALOG target_include_directories(sql_catalog_test PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/") target_sources(sql_catalog_test PRIVATE sql_catalog_test.cc) target_link_libraries(sql_catalog_test - PRIVATE iceberg_sql_catalog_static + PRIVATE "$,iceberg_sql_catalog_static,iceberg_sql_catalog_shared>" "$,iceberg_bundle_static,iceberg_bundle_shared>" GTest::gmock_main) if(MSVC_TOOLCHAIN) @@ -287,7 +287,8 @@ if(ICEBERG_BUILD_REST) add_executable(${test_name}) target_include_directories(${test_name} PRIVATE "${CMAKE_BINARY_DIR}/iceberg/test/") target_sources(${test_name} PRIVATE ${ARG_SOURCES}) - target_link_libraries(${test_name} PRIVATE GTest::gmock_main iceberg_rest_static) + target_link_libraries(${test_name} PRIVATE GTest::gmock_main + "$,iceberg_rest_static,iceberg_rest_shared>") if(MSVC_TOOLCHAIN) target_compile_options(${test_name} PRIVATE /bigobj) endif() diff --git a/src/iceberg/test/scan_test_base.h b/src/iceberg/test/scan_test_base.h index 5bd1222e02..ec57ef8f4b 100644 --- a/src/iceberg/test/scan_test_base.h +++ b/src/iceberg/test/scan_test_base.h @@ -350,7 +350,7 @@ class ScanTestBase : public testing::TestWithParam { private: int manifest_counter_ = 0; int manifest_list_counter_ = 0; - constexpr static PartitionValues kEmptyPartition{}; + inline static const PartitionValues kEmptyPartition{}; }; } // namespace iceberg From 4455bd9f3ba960ed08574d5db243c16323497905 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 29 Jun 2026 22:21:35 -0500 Subject: [PATCH 5/6] ci: switch to static-only build Shared-only had unresolved export issues in tests. Static-only achieves the same target reduction and tests already link static. --- ci/scripts/build_iceberg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index b6499200cc..e3bbc908a9 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -40,8 +40,8 @@ is_windows() { CMAKE_ARGS=( "-G Ninja" "-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX:-${ICEBERG_HOME}}" - "-DICEBERG_BUILD_STATIC=OFF" - "-DICEBERG_BUILD_SHARED=ON" + "-DICEBERG_BUILD_STATIC=ON" + "-DICEBERG_BUILD_SHARED=OFF" "-DICEBERG_BUILD_REST_INTEGRATION_TESTS=${build_rest_integration_test}" ) From e29678f6798c7aa87c842939b15ae7f26bb725e7 Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 29 Jun 2026 20:53:43 -0500 Subject: [PATCH 6/6] test: probe header blast radius via string_util.h --- src/iceberg/util/string_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/iceberg/util/string_util.h b/src/iceberg/util/string_util.h index 01b6087b8c..3689605445 100644 --- a/src/iceberg/util/string_util.h +++ b/src/iceberg/util/string_util.h @@ -20,6 +20,7 @@ #pragma once #include +#include #include #include #include