fix: skip DuckDB build on 32-bit targets and suppress GCC 16 SFINAE warning#5251
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a 64-bit build check to skip DuckDB on 32-bit architectures and silences GCC 16+ -Wsfinae-incomplete warnings. The reviewer recommends moving the compiler flag check for -Wsfinae-incomplete from the per-target setup macro to the directory-level CMakeLists.txt to avoid redundant evaluations and keep compiler checks centralized.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| MY_CHECK_CXX_COMPILER_FLAG("-Wsfinae-incomplete") | ||
| IF(have_CXX__Wsfinae_incomplete) | ||
| TARGET_COMPILE_OPTIONS(${_target} PRIVATE -Wno-sfinae-incomplete) | ||
| ENDIF() |
There was a problem hiding this comment.
Calling MY_CHECK_CXX_COMPILER_FLAG inside a target setup macro (duckdb_setup_target) means the compiler flag check is evaluated repeatedly for every target that uses this macro. Although CMake caches the result, it is cleaner and more efficient to perform compiler capability checks once at the directory level (e.g., in storage/duckdb/CMakeLists.txt) and only reference the resulting variable here.
IF(have_CXX__Wsfinae_incomplete)
TARGET_COMPILE_OPTIONS(${_target} PRIVATE -Wno-sfinae-incomplete)
ENDIF()
| IF(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| MESSAGE_ONCE(duckdb "DuckDB: not a 64-bit build, skipping") | ||
| return() | ||
| ENDIF() |
There was a problem hiding this comment.
Perform the compiler flag check for -Wsfinae-incomplete here at the directory level, rather than inside the per-target setup macro, to avoid redundant evaluations and keep compiler checks centralized.
IF(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE_ONCE(duckdb "DuckDB: not a 64-bit build, skipping")
return()
ENDIF()
MY_CHECK_CXX_COMPILER_FLAG("-Wsfinae-incomplete")
PR Description
Fix one CI build issue with the DuckDB storage engine plugin.
Skip DuckDB on 32-bit builds
The existing
CMAKE_SYSTEM_PROCESSORguard in storage/duckdb/CMakeLists.txt does not protect against-m32multilib builds running inside an x86_64 CI container — the processor is still reported asx86_64while the actual target is 32-bit. This causes a link failure because DuckDB's jemalloc extension is 64-bit only and is not produced for 32-bit targets:Add a
CMAKE_SIZEOF_VOID_P EQUAL 8guard (the standard CMake way to detect pointer size, derived from the compiler's actual target) to skip DuckDB entirely on any 32-bit build.Suppress
-Wsfinae-incompleteon GCC 16+GCC 16 introduces
-Wsfinae-incompletewhich fires on DuckDB'sCompressionInfoclass (upstream issue). Suppress it with-Wno-sfinae-incompletefor DuckDB plugin targets only (PRIVATEscope), gated byMY_CHECK_CXX_COMPILER_FLAGso older compilers are unaffected.Changes
CMAKE_SIZEOF_VOID_Pguard-Wno-sfinae-incomplete