Skip to content

feat(self-update): install Build Tools for the host arch on Windows - #5267

Closed
crutkas wants to merge 2 commits into
rust-lang:mainfrom
crutkas:crutkas-rustup-init-build-tools-install
Closed

crutkas wants to merge 2 commits into
rust-lang:mainfrom
crutkas:crutkas-rustup-init-build-tools-install

Conversation

@crutkas

@crutkas crutkas commented Nov 26, 2026 •

Copy link
Copy Markdown

This shifts to build tools instead of VS Community and detects Arm64 properly and make the init tool 'just work'. This will allow someone who already has VS installed to have init continue to work.

Closes #5265

Area Issue PR
Website install and Get Started pages rust-lang/www.rust-lang.org#2361 rust-lang/www.rust-lang.org#2362
rustup MSVC guide and other installation methods #5264 #5266
rustup-init automatic install #5265 this PR
Forge other installation methods rust-lang/rust-forge#1162 rust-lang/rust-forge#1163

Installed size, from Microsoft's VS package manifests (required packages only):

Machine Before (VS 2022 Community) After (Build Tools 2026)
x64 ~4.9 GB, x64/x86 tools ~3.5 GB, x64/x86 tools
ARM64 not offered ~4.8 GB, ARM64 tools

Changes in src/cli/self_update/windows.rs:

  • Download Build Tools 2026 (https://aka.ms/vs/18/stable/vs_buildtools.exe) instead of VS 2022 Community.
  • Add only the host's MSVC tools: VC.Tools.x86.x64 on x86_64/i686, VC.Tools.ARM64 on aarch64. SDK 26100 (skipped if SDK libs are found) and the English pack are unchanged.
  • Offer the automatic install on aarch64 too. Still no automatic install if any Visual Studio is found.
  • Prompt says Build Tools for Visual Studio and adds the license line and link.
  • Exit code 8001 now says "Visual Studio on ARM64 requires Windows 11" instead of "arm machine check failure".
  • -y behavior unchanged.

--wait, --add and --addProductLang are in Microsoft's command-line parameter docs; all three component IDs are in the VS 2026 Build Tools list. --focusedUi isn't publicly documented, same as before with Community; kept as-is.

Testing

On an ARM64 Windows 11 machine, native aarch64-pc-windows-msvc:

  • cargo test --lib --features test -- self_update::windows::tests: 14 passed, including 2 new tests for host-arch component selection and the aarch64 automatic plan
  • cargo fmt --check: passed
  • cargo clippy --lib --tests --features test: no warnings
  • cargo build --release --bin rustup-init: passed
  • Not run yet: end-to-end Build Tools install in a clean Windows Sandbox (this machine already has Visual Studio, so it takes the manual path). I'll add the results here.

Once this merges, the "Installing with rustup-init" section of windows-msvc.md (#5264) needs updating: say it installs Build Tools with the tools for your architecture, and drop "on ARM64" from the cases where it isn't offered.

Clint Rutkas added 2 commits November 25, 2026 22:25
Download the VS 2026 Build Tools bootstrapper instead of Visual Studio
Community, add only the MSVC tools component for the host architecture,
offer the automatic install on aarch64 hosts too, and note the Visual
Studio license requirement in the prompt.
@rustbot

rustbot commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Welcome, and thank you for contributing to rustup! A reviewer will take a look at your PR, typically within a week or two.

Please see the contribution instructions and our LLM policy for more information.

@rami3l rami3l closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rustup-init: automatic MSVC install skips ARM64 and installs full Visual Studio Community

3 participants