#1060·OpenJarvis

Windows installer never installs or checks for MSVC, so the mandatory Rust extension fails to build

Author: srcreativepro-artCreated Sep 28, 2026Updated Sep 28, 2026

Component: deploy/windows/install.ps1 step 6 (uv sync --extra desktop --group desktop-native) Severity: blocks installation entirely on any machine without Visual Studio

Environment

OS Windows 11 Home Single Language, build 26200
Python 3.12.10
uv 0.12.19
Commit 8acafed2
Visual Studio none installed (the interesting part)

What happens

Step 6 runs for several minutes and then collapses with a wall of cargo build-script failures:

error: could not compile `serde_json` (build script) due to 1 previous error
...
maturin failed
Caused by: Cargo build finished with "exit code: 101"
[fail]  uv sync failed with exit code 1.

The actual cause is buried far above the tail that's visible on screen:

error: linker `link.exe` not found
  = note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that Visual Studio 2017 or later, or Build Tools for
      Visual Studio were installed with the Visual C++ option.

Root cause

Two things combine to make this both inevitable and confusing.

1. The Rust extension is mandatory, so it can't be skipped.

pyproject.toml pins it to a local path (it is deliberately not on PyPI):

toml
openjarvis-rust = { path = "rust/crates/openjarvis-python" }   # line 232
desktop-native  = ["openjarvis-rust"]                          # line 305

and src/openjarvis/_rust_bridge.py is explicit that there is no way around it:

The Rust backend is mandatory — if it cannot be imported, a hard ImportError is raised.

So --group desktop-native always compiles from source, and dropping the group is not a viable fallback for a user who just wants the thing to install.

2. maturin bootstraps Rust, which disguises the real missing dependency.

The log contains:

Rust not found, installing into a temporary directory

So cargo appears out of nowhere and runs happily on a machine with no Rust toolchain at all — which strongly suggests the toolchain is fine and something in the crates is broken. It isn't. x86_64-pc-windows-msvc needs the MSVC linker, and maturin does not (and cannot) bootstrap that.

Nothing in the installer installs, checks for, or documents a C++ toolchain. Grepping the whole script for rust|cargo|maturin|Visual|MSVC|link\.exe matches only the uv sync line itself.

Suggested fix

Add a step between the clone and uv sync that detects the linker and installs the VC tools workload. Detection has to use vswhere, because link.exe is only on PATH inside a Developer Command Prompt:

powershell
function Test-MsvcLinker {
    if (Get-Command link.exe -ErrorAction SilentlyContinue) { return $true }
    $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
    if (-not (Test-Path -LiteralPath $vswhere)) { return $false }
    $found = & $vswhere -latest -products * `
        -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
        -property installationPath 2>$null
    return [bool]$found
}

and on failure:

powershell
& winget install --id Microsoft.VisualStudio.2022.BuildTools `
    --silent --accept-source-agreements --accept-package-agreements `
    --override '--wait --quiet --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended'

--override is required — a default Build Tools install ships no workload at all, so VCTools must be requested explicitly or the install succeeds and still leaves no linker.

Failing early with an actionable message would be a large improvement even without the auto-install, since the current failure mode is a multi-minute build that ends in an unrelated-looking error.

Worth noting for the docs either way: this is a multi-GB download and triggers a UAC prompt, which is a meaningful surprise in a one-liner irm | iex installer.

Verified fix on this machine

powershell
winget install --id Microsoft.VisualStudio.2022.BuildTools `
  --override "--wait --quiet --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"

MSVC 14.44.35207 installed → uv sync --extra desktop --group desktop-native exits 0 → import openjarvis_rust succeeds.

A fix is proposed in #1056.