From 2232131bcc5136cbef0f7a58b465e13246f630eb Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Thu, 2 Jul 2026 19:58:57 -0500 Subject: [PATCH 1/2] ci: build Windows test leg in Debug --- ci/scripts/build_example.sh | 23 +++++++------------- ci/scripts/build_iceberg.sh | 34 +++++++++++------------------- cmake_modules/IcebergSccache.cmake | 21 ++++++------------ src/iceberg/test/scan_test_base.h | 3 +-- 4 files changed, 28 insertions(+), 53 deletions(-) diff --git a/ci/scripts/build_example.sh b/ci/scripts/build_example.sh index a71649ec3..7ccdf4a8f 100755 --- a/ci/scripts/build_example.sh +++ b/ci/scripts/build_example.sh @@ -49,26 +49,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 - if [[ "${run_example}" == "ON" ]]; then - if [[ -x ./demo_example.exe ]]; then - ./demo_example.exe +cmake --build . +if [[ "${run_example}" == "ON" ]]; then + if is_windows; then + ./demo_example.exe else - ./Release/demo_example.exe + ./demo_example fi - fi -else - cmake --build . - if [[ "${run_example}" == "ON" ]]; then - ./demo_example - fi fi popd diff --git a/ci/scripts/build_iceberg.sh b/ci/scripts/build_iceberg.sh index 55fb4e532..6a7dc607a 100755 --- a/ci/scripts/build_iceberg.sh +++ b/ci/scripts/build_iceberg.sh @@ -37,11 +37,7 @@ is_windows() { [[ "${OSTYPE}" == "msys" || "${OSTYPE}" == "win32" || "${OSTYPE}" == "cygwin" ]] } -if is_windows; then - build_type=${7:-Release} -else - build_type=${7:-Debug} -fi +build_type=${7:-Debug} CMAKE_ARGS=( "-G Ninja" @@ -70,16 +66,16 @@ else fi if is_windows; then - CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake") - CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}") -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=${build_type}") + CMAKE_TOOLCHAIN_FILE="${CMAKE_TOOLCHAIN_FILE:-C:/vcpkg/scripts/buildsystems/vcpkg.cmake}" fi +# Pass an externally provided toolchain, or the default Windows vcpkg toolchain. +if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then + CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") +fi + +CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=${build_type}") + if [[ "${build_enable_sccache}" == "ON" ]]; then CMAKE_ARGS+=("-DCMAKE_CXX_COMPILER_LAUNCHER=sccache") CMAKE_ARGS+=("-DCMAKE_C_COMPILER_LAUNCHER=sccache") @@ -91,16 +87,10 @@ if [[ -n "${ICEBERG_EXTRA_CMAKE_ARGS:-}" ]]; then fi cmake "${CMAKE_ARGS[@]}" ${source_dir} -if is_windows; then - cmake --build . --config "${build_type}" --target install - if [[ "${run_tests}" == "ON" ]]; then - ctest --output-on-failure -C "${build_type}" - fi -else - cmake --build . --target install - if [[ "${run_tests}" == "ON" ]]; then + +cmake --build . --target install +if [[ "${run_tests}" == "ON" ]]; then ctest --output-on-failure - fi fi popd diff --git a/cmake_modules/IcebergSccache.cmake b/cmake_modules/IcebergSccache.cmake index d02e65df5..a618a4862 100644 --- a/cmake_modules/IcebergSccache.cmake +++ b/cmake_modules/IcebergSccache.cmake @@ -18,19 +18,12 @@ if(MSVC_TOOLCHAIN AND "${CMAKE_CXX_COMPILER_LAUNCHER}" STREQUAL "sccache") message(STATUS "Configuring sccache for MSVC") - # 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}") + # Keep MSVC Debug objects cacheable by sccache without affecting Release. + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") - string(REGEX REPLACE "/Z[iI]" "" CMAKE_C_FLAGS_RELWITHDEBINFO - "${CMAKE_C_FLAGS_RELWITHDEBINFO}") - string(REGEX REPLACE "/Z[iI]" "" 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") + # CMP0141 normally handles these flags; normalize any flags injected elsewhere. + foreach(flag_var CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELWITHDEBINFO + CMAKE_CXX_FLAGS_RELWITHDEBINFO) + string(REGEX REPLACE "/Z[iI]" "/Z7" ${flag_var} "${${flag_var}}") + endforeach() endif() diff --git a/src/iceberg/test/scan_test_base.h b/src/iceberg/test/scan_test_base.h index 5bd1222e0..4e32febe2 100644 --- a/src/iceberg/test/scan_test_base.h +++ b/src/iceberg/test/scan_test_base.h @@ -221,7 +221,7 @@ class ScanTestBase : public testing::TestWithParam { std::shared_ptr spec = nullptr) { std::vector> files_with_partitions; for (const auto& path : added_files) { - files_with_partitions.emplace_back(path, kEmptyPartition); + files_with_partitions.emplace_back(path, PartitionValues{}); } return MakeAppendSnapshotWithPartitionValues(format_version, snapshot_id, parent_snapshot_id, sequence_number, @@ -350,7 +350,6 @@ class ScanTestBase : public testing::TestWithParam { private: int manifest_counter_ = 0; int manifest_list_counter_ = 0; - constexpr static PartitionValues kEmptyPartition{}; }; } // namespace iceberg From baaab05b685152690e24d494ef9e26130f1d106d Mon Sep 17 00:00:00 2001 From: Abanoub Doss Date: Mon, 13 Jul 2026 14:29:47 -0500 Subject: [PATCH 2/2] ci: build SQL Catalog Windows leg in Debug Flip the SQL Catalog workflow's Windows matrix entry from Release to Debug so every SQL Catalog leg builds Debug. This relies on the MSVC sccache handling from the previous commit, which makes Debug objects cacheable via embedded /Z7 debug info. --- .github/workflows/sql_catalog_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sql_catalog_test.yml b/.github/workflows/sql_catalog_test.yml index 28bd33173..108ff8ae2 100644 --- a/.github/workflows/sql_catalog_test.yml +++ b/.github/workflows/sql_catalog_test.yml @@ -58,7 +58,7 @@ jobs: cmake_extra_args: "" - title: AMD64 Windows 2025 runs-on: windows-2025 - cmake_build_type: Release + cmake_build_type: Debug cmake_extra_args: -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake env: SCCACHE_DIR: ${{ github.workspace }}/.sccache