Skip to content

fix(vortex-duckdb): make build.rs cross-platform for Windows#8206

Draft
joseph-isaacs wants to merge 2 commits into
developfrom
feat/windows-arm64-build
Draft

fix(vortex-duckdb): make build.rs cross-platform for Windows#8206
joseph-isaacs wants to merge 2 commits into
developfrom
feat/windows-arm64-build

Conversation

@joseph-isaacs
Copy link
Copy Markdown
Contributor

What

Makes vortex-duckdb's build.rs build on Windows (x86_64-pc-windows-msvc and aarch64-pc-windows-msvc). Today it is unix-only, so the duckdb-vortex DuckDB extension can't be built for Windows — the build fails with error[E0433]: failed to resolve: could not find unixinos``.

Changes (all in vortex-duckdb/build.rs)

  • Symlink: drop the unconditional use std::os::unix::fs::symlink. The crate_dir/duckdb symlink is only a dev/tooling convenience — the build uses the extracted inner_dir directly — so it now lives in a #[cfg(unix)] helper that is a no-op on other platforms.
  • Prebuilt libraries: add x86_64-pc-windows-msvc → windows/amd64 and aarch64-pc-windows-msvc → windows/arm64 to the download match (DuckDB ships libduckdb-windows-amd64.zip / libduckdb-windows-arm64.zip), and recognise duckdb.dll as a build artifact.
  • C++ compile flags: gate the GCC/Clang -Wall -Wextra -Wpedantic -Werror / -isystem flags behind a non-MSVC check; on MSVC use /W4 + a normal include (cl rejects the GNU-style flags).
  • rpath: skip the -Wl,-rpath link arg on Windows (MSVC's linker rejects it; the DLL is resolved via PATH instead).

Platform conditionals read CARGO_CFG_TARGET_OS / CARGO_CFG_TARGET_ENV (the build target) rather than cfg!(), which in a build script reflects the host.

Context / why now

The duckdb-vortex repo is enabling Windows CI. windows_amd64 got as far as compiling before hitting this build script; windows_arm64 previously also hit an aws-lc-sys ARM64 assembly link failure (LNK1181), but that no longer applies on current develop — the TLS stack resolves to rustls + ring (ring v0.17), not aws-lc-rs.

Testing

Formatting + type review done locally; -W/rpath/MSVC branches are runtime conditionals that compile on every host (only the trivial symlink helper is cfg-gated). The authoritative Windows build is this PR's CI. Opened as a draft for that reason — once green, duckdb-vortex can bump its vortex submodule and opt the windows_* archs back into its matrix.

The DuckDB extension build script was unix-only, which broke the Windows
build of the duckdb-vortex extension (E0433: `std::os::unix` not found):

- Drop the unconditional `use std::os::unix::fs::symlink`. The symlink of
  the extracted source into `crate_dir/duckdb` is only a dev/tooling
  convenience (the build uses the extracted `inner_dir` directly), so move
  it into a `#[cfg(unix)]` helper that is a no-op elsewhere.
- Add the Windows targets (x86_64/aarch64-pc-windows-msvc) to the
  prebuilt-libduckdb download match; DuckDB ships libduckdb-windows-amd64
  /-arm64.zip. Recognise duckdb.dll as a build artifact.
- In compile_cpp, gate the GCC/Clang `-W*`/`-isystem` flags behind a
  non-MSVC check and use `/W4` + a normal include on MSVC (`cl` rejects
  the GNU-style flags).
- Skip the `-Wl,-rpath` link arg on Windows (MSVC's linker rejects it;
  the DLL is resolved via PATH instead).

Platform conditionals use CARGO_CFG_TARGET_OS/ENV (the build target),
not `cfg!()`, which in a build script reflects the host.

This lets vortex-duckdb build on windows_amd64 and windows_arm64 so the
duckdb-vortex extension can opt those CI targets in. (The aws-lc-sys
ARM64 assembly link failure that previously blocked windows_arm64 no
longer applies: the TLS stack now resolves to rustls + ring.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs added the changelog/fix A bug fix label Jun 1, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 1, 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.

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 1273 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_canonical_into[(1000, 10)] 162.1 µs 198 µs -18.12%
Simulation chunked_varbinview_canonical_into[(100, 100)] 309.2 µs 273.2 µs +13.16%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing feat/windows-arm64-build (4cd6b6b) with develop (326b475)

Open in CodSpeed

Use a #[cfg(unix)] import for std::os::unix::fs::symlink instead of the
fully-qualified path, which tripped the repo's denied clippy::absolute_paths
lint. The cfg gate keeps the symbol out of the Windows build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant