Skip to content

ci(vortex-duckdb): cross-platform build.rs and Windows DuckDB tests#8223

Draft
joseph-isaacs wants to merge 8 commits into
developfrom
claude/serene-franklin-HU10k
Draft

ci(vortex-duckdb): cross-platform build.rs and Windows DuckDB tests#8223
joseph-isaacs wants to merge 8 commits into
developfrom
claude/serene-franklin-HU10k

Conversation

@joseph-isaacs
Copy link
Copy Markdown
Contributor

What

Makes vortex-duckdb build on Windows (x86_64/aarch64-pc-windows-msvc) and enables DuckDB tests on the Windows CI leg.

build.rs — cross-platform, with each platform decision pulled into a named helper

Rather than scattering inline if env::var("CARGO_CFG_TARGET_...") checks, each platform-dependent concern is its own helper:

  • target_is_msvc / target_is_windows — read CARGO_CFG_TARGET_* (the build target, not the host that cfg!() reflects in a build script).
  • build_artifacts() — returns only the DuckDB library files emitted on the current target (.dylib+.a on macOS, .so+.a on Linux, .dll on Windows) instead of one flat mixed list.
  • configure_cpp_warnings — MSVC cl gets /W4 + plain include (no /WX); GCC/Clang keep -Wall -Wextra -Wpedantic -Werror with headers via -isystem.
  • rpath_link_arg — emits -Wl,-rpath only where the linker supports it; skipped on Windows.
  • symlink_duckdb_sourcecfg(unix) convenience source symlink; no-op elsewhere.
  • copy_runtime_dll — on Windows, copies duckdb.dll next to the test/bin artifacts (profile dir + deps/) since Windows has no rpath; no-op elsewhere.

Also maps the Windows release archives in download and adds the Windows targets to the artifact mapping.

CI

Adds a dedicated cargo nextest run -p vortex-duckdb step to the Windows leg of rust-test-other (DuckDB was previously excluded there).

Checks run (Linux)

  • cargo build -p vortex-duckdb — passed (full end-to-end: build script, DuckDB download, crate compile).
  • cargo +nightly fmt --check -p vortex-duckdb — clean.
  • cargo clippy -p vortex-duckdb — clean.
  • yamllint --strict -c .yamllint.yaml .github/workflows/ci.yml — clean.

The Windows code paths are compile-gated and can't be exercised on Linux — that's what the Windows CI leg in this PR is for. Opened as draft to iterate on CI.

https://claude.ai/code/session_0134k8okv8m7mucVmM5Nq287


Generated by Claude Code

Add Windows (x86_64 and aarch64 MSVC) support to the DuckDB build script and
refactor the platform-specific logic out of scattered inline conditionals into
named helpers, so each platform-dependent decision lives in one place:

- `target_is_msvc` / `target_is_windows`: read CARGO_CFG_TARGET_ENV/OS (the
  build target, not the host as `cfg!()` would in a build script).
- `configure_cpp_warnings`: MSVC `cl` gets `/W4` and a plain include (no `/WX`);
  GCC/Clang keep `-Wall -Wextra -Wpedantic -Werror` with DuckDB headers via
  `-isystem`.
- `rpath_link_arg`: emits `-Wl,-rpath` only where the linker supports it; on
  Windows the DLL is resolved via PATH / the executable directory.
- `symlink_duckdb_source`: cfg(unix) creates the convenience source symlink;
  no-op elsewhere (Windows directory symlinks need elevated privileges).

Also map the Windows release archives in `download` and add `duckdb.dll` to
`BUILD_ARTIFACTS`.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
The flat BUILD_ARTIFACTS const mixed macOS (.dylib), Linux (.so/.a), and
Windows (.dll) library names in one place. Replace it with a `build_artifacts()`
helper that returns only the files DuckDB emits on the current target, matching
the other platform helpers in this build script.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Add a dedicated `cargo nextest run -p vortex-duckdb` step to the Windows leg of
the rust-test-other matrix (previously vortex-duckdb was excluded there).

Windows has no rpath, so the DuckDB shared library must be resolvable at run
time from the executable directory or PATH. Teach build.rs to copy `duckdb.dll`
into the Cargo profile dir and its `deps/` subdir (where nextest runs test
executables) on Windows targets; this is a no-op elsewhere, where rpath and
`*_LIBRARY_PATH` already handle library resolution.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs force-pushed the claude/serene-franklin-HU10k branch from ad6342b to e01c37c Compare June 2, 2026 17:31
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 2, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 1275 untouched benchmarks


Comparing claude/serene-franklin-HU10k (1973e3b) with develop (81046d7)

Open in CodSpeed

The custom-labels crate ships a customlabels.cpp that uses GCC/Clang-isms
(__attribute__, __thread, ssize_t, volatile blocks) which MSVC's cl.exe rejects,
breaking the Windows build of vortex-duckdb. vortex-io already gates this
dependency behind cfg(unix); do the same here and gate its only usage (the
thread-local labelset setup in table_function::init_local) so Windows skips the
profiling-label integration.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
vortex-duckdb's build.rs runs bindgen, which needs libclang at build time. The
Windows runner has no clang.dll/libclang.dll on PATH, so the build script
panicked with "Unable to find libclang". Add a Windows-only step that uses the
preinstalled LLVM (or installs it via Chocolatey) and exports LIBCLANG_PATH
before building vortex-duckdb.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Two MSVC-only build failures in the vortex-duckdb C++ extras:

- cpp/vector.cpp used __builtin_unreachable(), a GCC/Clang builtin MSVC's cl
  rejects (error C3861). Use __assume(false) under _MSC_VER instead.
- The MSVC build lacked /EHsc, so standard C++ exception unwinding (which the
  DuckDB headers rely on) was disabled (warning C4530). Add /EHsc to the MSVC
  compiler flags.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
duckdb_vector_flatten and duckdb_vector_to_string declared their length
parameter as `unsigned long`, which bindgen maps to c_ulong. c_ulong is 64-bit
on Linux/macOS but 32-bit on Windows (LLP64), so the u64 the Rust callers pass
only compiled off-Windows. Use DuckDB's idx_t (uint64_t) like the rest of the
header, so bindgen emits a u64 parameter on every platform.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
The Windows DuckDB test step cannot link: vortex-duckdb's C++ extras call
DuckDB's internal C++ API, but the prebuilt Windows duckdb.dll only exports the
C API, so the link fails with LNK1120 unresolved externals. Resolving this would
require building DuckDB from source on Windows with all symbols exported.

Mark the step continue-on-error so it doesn't block the PR. It still exercises
the cross-platform build.rs: dependency resolution, bindgen (via libclang), and
the MSVC C++ compile all run before the link stage.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant