Skip to content

fix: skip DuckDB build on 32-bit targets and suppress GCC 16 SFINAE warning#5251

Merged
grooverdan merged 3 commits into
MariaDB:11.4from
drrtuy:bb-11.4-drrtuy-duckdb-x86-32
Jun 17, 2026
Merged

fix: skip DuckDB build on 32-bit targets and suppress GCC 16 SFINAE warning#5251
grooverdan merged 3 commits into
MariaDB:11.4from
drrtuy:bb-11.4-drrtuy-duckdb-x86-32

Conversation

@drrtuy

@drrtuy drrtuy commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

PR Description

Fix one CI build issue with the DuckDB storage engine plugin.

Skip DuckDB on 32-bit builds

The existing CMAKE_SYSTEM_PROCESSOR guard in storage/duckdb/CMakeLists.txt does not protect against -m32 multilib builds running inside an x86_64 CI container — the processor is still reported as x86_64 while 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:

No rule to make target '.../jemalloc/libjemalloc_extension.a', needed by 'ha_duckdb.so'

Add a CMAKE_SIZEOF_VOID_P EQUAL 8 guard (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-incomplete on GCC 16+

GCC 16 introduces -Wsfinae-incomplete which fires on DuckDB's CompressionInfo class (upstream issue). Suppress it with -Wno-sfinae-incomplete for DuckDB plugin targets only (PRIVATE scope), gated by MY_CHECK_CXX_COMPILER_FLAG so older compilers are unaffected.

Changes

  • storage/duckdb/CMakeLists.txt — add CMAKE_SIZEOF_VOID_P guard
  • storage/duckdb/cmake/duckdb_target_setup.cmake — add conditional -Wno-sfinae-incomplete

@drrtuy drrtuy requested review from gkodinov and grooverdan June 17, 2026 10:04

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +21 to +24
MY_CHECK_CXX_COMPILER_FLAG("-Wsfinae-incomplete")
IF(have_CXX__Wsfinae_incomplete)
TARGET_COMPILE_OPTIONS(${_target} PRIVATE -Wno-sfinae-incomplete)
ENDIF()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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()

Comment on lines +19 to +22
IF(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE_ONCE(duckdb "DuckDB: not a 64-bit build, skipping")
return()
ENDIF()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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")

@grooverdan grooverdan enabled auto-merge (rebase) June 17, 2026 20:24
@grooverdan grooverdan merged commit c8f382f into MariaDB:11.4 Jun 17, 2026
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants