docs: add native Windows MSVC build guide (no Docker / no WSL2)#455
docs: add native Windows MSVC build guide (no Docker / no WSL2)#455grimmjoww wants to merge 1 commit intotensorchord:mainfrom
Conversation
Documents the toolchain and steps for producing a working `vchord.dll` on Windows without Docker or WSL2. The codebase already lists `x86_64-pc-windows-msvc` as a default cargo target in `xtask`; this just fills in the gap so anyone with PostgreSQL on Windows can reproduce the build. Verified end-to-end on Windows 11 + VS2022 + LLVM 22.1.4 + Rust 1.95.0 + cargo-pgrx 0.17.0 + PostgreSQL 17.9. Output is a 9.4 MB PE32+ DLL that imports symbols from `postgres.exe` exactly the way pgvector's Windows extension does (verified via `dumpbin /dependents`). Key gotchas captured: - Rust 1.95+ required (1.93/1.94 fail on `stdarch_x86_avx512_f16` in `crates/simd/src/floating_f16.rs`; that feature was stabilized in 1.95) - `cargo pgrx init` does not auto-download Postgres on Windows - `xtask build` requires `PG_CONFIG` env var - vcvars64.bat env doesn't propagate to bash sessions No source-code changes required — purely documentation. The only behaviorally-relevant follow-up would be adding a Windows runner to `.github/workflows/release.yml` so users get a prebuilt `vchord-pg17-x86_64-windows-msvc.zip` artifact alongside the existing Linux .deb / .zip outputs. Happy to follow up with that PR if maintainers want it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
Closing this PR. After reading the CLA, the clauses granting TensorChord an irrevocable, transferable, sublicensable license — explicitly including the right to relicense contributions under "commercial, or proprietary license" and to "change or modify the license... from time to time" — go further than I'm comfortable with as a default for my contributions. I keep my work open and don't want to set a precedent of granting anyone the perpetual right to relicense it as proprietary later. That's a personal stance about how I license my own work, not a knock on vchord — the build itself was great and just worked once the toolchain was in place. The Windows build documentation and helper scripts remain available at https://github.com/grimmjoww/vchord-windows-port under MIT for the community. If anyone at TensorChord wants to incorporate the content into the official repo, please feel free to rewrite under your CLA — it documents an existing build path you already support, not novel IP. Happy to answer questions or clarify any of the build steps. Thanks for vchord. The Windows-native build genuinely works; just sharing the toolchain notes openly without the CLA gate. |
|
It's already documented in Installation that x86_64 Windows is supported and tested. Source lists the environment requirements of building from source and installation steps.
It's expected. We will raise the required Rust version with each new release. The
We don't build precompiled binaries unless strictly necessary. Mismatches between the ABIs of a precompiled VectorChord and the user's PostgreSQL can lead to critical failures. We only provide precompiled PostgreSQL packages for Debian/Linux that depend on the |
TL;DR
Decided to fuck around and find out — vchord builds natively on Windows MSVC. No Docker, no WSL2. This PR is documentation only; the codebase already supports
x86_64-pc-windows-msvcas a target inxtask, just nobody had written the toolchain doc yet.Result
Built a working
vchord.dllon Windows 11 with:pgrx-pg-sysbindgen)pgrxpin)Output:
vchord.dll9.4 MB PE32+ x64.dumpbin /dependentsshows imports againstpostgres.exe, KERNEL32, ntdll, VCRUNTIME140, UCRT — exactly the same shape as pgvector's Windows DLL.What changed
docs/WINDOWS.md— new file with full toolchain + build + install + verification steps, and a "Pitfalls" section documenting the things that bit meREADME.md— one line under Quick Start pointing Windows users at the new docNo source-code changes needed at all. The build "just worked" once the toolchain was set up.
The one gotcha worth highlighting
Rust 1.93 and 1.94 fail to build with
E0658: use of unstable library feature 'stdarch_x86_avx512_f16'incrates/simd/src/floating_f16.rs:2014+. Those AVX-512 FP16 intrinsics (_mm512_fmadd_ph,_mm512_castsi512_ph, etc.) were stabilized in Rust 1.95.0 (April 2026). Afterrustup update, the build is clean — zero warnings, zero errors.Worth noting in case anyone else hits this on slightly-older nightly/stable channels. The Linux CI didn't catch it because their
rustup updatestep pulls latest stable.Suggested follow-up (separate PR if you want it)
Add a Windows runner to
.github/workflows/release.ymlso users get a prebuiltvchord-pg17-x86_64-windows-msvc.zipartifact alongside the existing Linux.deb/.zip. Happy to draft that if there's interest.Test plan
cargo run -p xtask --release -- buildproducesbuild\pkglibdir\vchord.dll+ extension SQL + control filedumpbin /dependents vchord.dllshows clean Windows dependency graphVibe-coded. 0% code from me, all from Claude. Co-author credit on the commit because I wanted it. We're shipping unlimited embeddings/vectors energy. 🚀
Closes the gap on Windows-native builds without changing your build system at all — just documenting what already works.