duckdb / duckdb-wasm

WebAssembly version of DuckDB
https://shell.duckdb.org
MIT License
1.02k stars 110 forks source link

pass DUCKDB_EXTERNAL_PLATFORM to duckdb submodule cmake #1679

Closed smilingthax closed 2 months ago

smilingthax commented 3 months ago

Build-type detection should be overridden by providing DUCKDB_PLATFORM (cf. https://github.com/duckdb/duckdb/blob/8ce3df950c0c6f25815ebd1dd92257a81223f618/CMakeLists.txt#L1191):

duckdb_platform_binary > duckdb_platform_out || (echo "Provide explicit DUCKDB_PLATFORM=your_target_arch to avoid build-type detection of the platform" && exit 1)

Unfortunately, although scripts/wasm_build_lib.sh passes DUCKDB_EXPLICIT_PLATFORM to cmake via lib/CMakeLists.txt -> lib/cmake/duckdb.cmake, it does not end up at submodules/duckdb/CMakeLists.txt.

This breaks the build when auto detection fails, e.g. because the latest (3.1.56) default emsdk node version 16.20 would still need --experimental-wasm-eh to execute the duckdb_platform_binary.js/.wasm.