From 9dcd6e4058d5970afccf2db8b1f6a71a33921488 Mon Sep 17 00:00:00 2001 From: Alexander Droste Date: Tue, 16 Dec 2025 14:41:25 +0000 Subject: [PATCH 1/3] feat: build duckdb on windows Signed-off-by: Alexander Droste --- .github/workflows/ci.yml | 2 +- vortex-duckdb/build.rs | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b2cda04cf6..bafd6f7d039 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -533,7 +533,7 @@ jobs: tool: nextest - name: Rust Tests (Windows) if: matrix.os == 'windows-x64' - run: cargo nextest run --locked --workspace --all-features --no-fail-fast --exclude bench-vortex --exclude vortex-python --exclude vortex-duckdb --exclude vortex-fuzz + run: cargo nextest run --locked --workspace --all-features --no-fail-fast --exclude bench-vortex --exclude vortex-python --exclude vortex-fuzz - name: Rust Tests (Other) if: matrix.os != 'windows-x64' run: cargo nextest run --locked --workspace --all-features --no-fail-fast --exclude bench-vortex --exclude vortex-duckdb diff --git a/vortex-duckdb/build.rs b/vortex-duckdb/build.rs index e9b484f8f24..666631f7ef8 100644 --- a/vortex-duckdb/build.rs +++ b/vortex-duckdb/build.rs @@ -36,6 +36,8 @@ fn download_duckdb_lib_archive() -> Result> "x86_64-apple-darwin" => ("osx", "universal"), "x86_64-unknown-linux-gnu" => ("linux", "amd64"), "aarch64-unknown-linux-gnu" => ("linux", "arm64"), + "x86_64-pc-windows-msvc" => ("windows", "amd64"), + "aarch64-pc-windows-msvc" => ("windows", "arm64"), _ => return Err(format!("Unsupported target: {target}").into()), }; @@ -71,9 +73,11 @@ fn extract_duckdb_libraries(archive_path: PathBuf) -> Result Result Date: Tue, 16 Dec 2025 15:26:58 +0000 Subject: [PATCH 2/3] install llvm/clang for windows ci run Signed-off-by: Alexander Droste --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bafd6f7d039..c5ea4cd863e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -519,6 +519,10 @@ jobs: shell: bash run: | choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive" -y + - name: Install LLVM / Clang (Windows) + if: matrix.os == 'windows-x64' + shell: bash + run: choco install llvm -y - name: Setup Python (Windows) if: matrix.os == 'windows-x64' uses: actions/setup-python@v5 From 6726ad9b8284f3bec591a9c9bf7b5f94a9cd4819 Mon Sep 17 00:00:00 2001 From: Alexander Droste Date: Tue, 16 Dec 2025 15:50:15 +0000 Subject: [PATCH 3/3] flags Signed-off-by: Alexander Droste --- vortex-duckdb/build.rs | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/vortex-duckdb/build.rs b/vortex-duckdb/build.rs index 666631f7ef8..dfa25d3f548 100644 --- a/vortex-duckdb/build.rs +++ b/vortex-duckdb/build.rs @@ -307,20 +307,32 @@ fn main() { println!("cargo:rustc-link-arg=-Wl,-rpath,{}", library_path.display()); // Compile our C++ code that exposes additional DuckDB functionality. - cc::Build::new() - .std("c++17") - // Enable compiler warnings. - .flag("-Wall") - .flag("-Wextra") - .flag("-Wpedantic") - // Allow C++20 designator syntax even with C++17 std - .flag("-Wno-c++20-designator") - // Enable C++20 extensions - .flag("-Wno-c++20-extensions") - // Unused parameter warnings are disabled as we include DuckDB - // headers with implementations that have unused parameters. - .flag("-Wno-unused-parameter") - .cpp(true) + let mut builder = cc::Build::new(); + builder.std("c++17").cpp(true); + + #[cfg(target_os = "windows")] + { + builder + // Enable C++ exception handling + .flag("/EHsc"); + } + + #[cfg(not(target_os = "windows"))] + { + builder + .flag("-Wall") + .flag("-Wextra") + .flag("-Wpedantic") + // Allow C++20 designator syntax even with C++17 std + .flag("-Wno-c++20-designator") + // Enable C++20 extensions + .flag("-Wno-c++20-extensions") + // Unused parameter warnings are disabled as we include DuckDB + // headers with implementations that have unused parameters. + .flag("-Wno-unused-parameter"); + } + + builder // We include DuckDB headers from the DuckDB extension submodule. .include(duckdb_repo.join(format!("duckdb-{}/src/include", DUCKDB_VERSION.as_str()))) .include("cpp/include")