# Windows setup

`make dev` runs on Windows natively through Git Bash, once a few toolchain quirks are handled. After setup, the same `make` targets work as on macOS. Start with [development setup](/docs/contributing/development-setup/) if you haven't installed the shared prerequisites yet.

1. Install the required tools via Chocolatey, from an elevated PowerShell:

   ```powershell
   choco install -y git make rustup.install nodejs-lts cmake llvm `
                     visualstudio2022buildtools visualstudio2022-workload-vctools `
                     bats-core
   ```

   This installs GNU Make 4.4, not GnuWin32 make 3.81, which mishandles `$(VAR)` expansion and `\` line continuations in recipes.

2. Pin the MSVC linker. Create `.cargo/config.toml` in the repo root (gitignored) pointing at the MSVC `link.exe` for the version VS Build Tools installed. Without this, cargo on Git Bash finds Cygwin's `link` before MSVC's, and the build fails with `LNK1146`, `LNK1170`, or `LNK1206` errors.

3. Source the MSVC environment before cargo runs. Generate a variable snapshot once from `vcvars64.bat`, save it as a bash-sourceable script, and source it from `~/.bashrc`, with the MSVC bin path ahead of `/usr/bin` on `PATH` so cargo's child processes find `cl.exe` and `dumpbin.exe` there first.

4. Run from an interactive Git Bash session, not over SSH and not from `cmd.exe` or PowerShell:

   ```bash
   cd ~/Projects/speedwave
   make setup-dev
   make dev
   ```

   Over SSH, `make setup-dev` is known to skip a `node_modules/.bin/` symlink step, which later breaks `npx ng serve`.

See [testing](/docs/contributing/testing/) once you're building, to run the Windows-side test targets.