From 1a49b444c665202e65406917fcb098501b34898f Mon Sep 17 00:00:00 2001 From: Alex Kasko Date: Sun, 21 Dec 2025 19:13:41 +0000 Subject: [PATCH] Add jemalloc placeholder on Windows Due to the way how `generated_extension_loader_package_build.cpp` is generated in the latest `main` versions of the engine, it expects to have the same set of linked extensions on all platforms. `jemalloc` extension is not available on Windows, so the JDBC build fails on Windows. This PR adds an emtpy placeholder for `JemallocExtension` class that is expected by `generated_extension_loader_package_build.cpp` to fix the compilation on Windows. --- CMakeLists.txt | 1 + CMakeLists.txt.in | 1 + src/windows/jemalloc_extension.hpp | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 src/windows/jemalloc_extension.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 732b2dea3..7fa867d12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -569,6 +569,7 @@ add_jar(duckdb_jdbc_tests ${JAVA_TEST_FILES} INCLUDE_JARS duckdb_jdbc_nolib) # main shared lib compilation if(MSVC) + list(APPEND DUCKDB_INCLUDE_DIRS src/windows) list(APPEND DUCKDB_SRC_FILES duckdb_java.def) else() list(APPEND DUCKDB_SRC_FILES ${JEMALLOC_SRC_FILES}) diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in index de3f157e6..48b018d21 100644 --- a/CMakeLists.txt.in +++ b/CMakeLists.txt.in @@ -95,6 +95,7 @@ add_jar(duckdb_jdbc_tests ${JAVA_TEST_FILES} INCLUDE_JARS duckdb_jdbc_nolib) # main shared lib compilation if(MSVC) + list(APPEND DUCKDB_INCLUDE_DIRS src/windows) list(APPEND DUCKDB_SRC_FILES duckdb_java.def) else() list(APPEND DUCKDB_SRC_FILES ${JEMALLOC_SRC_FILES}) diff --git a/src/windows/jemalloc_extension.hpp b/src/windows/jemalloc_extension.hpp new file mode 100644 index 000000000..bdbcc0c74 --- /dev/null +++ b/src/windows/jemalloc_extension.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include "duckdb.hpp" + +namespace duckdb { + +class JemallocExtension : public Extension { +public: + void Load(ExtensionLoader &) override {}; + std::string Name() override { + return ""; + }; + std::string Version() const override { + return ""; + }; +}; + +} // namespace duckdb