From 023a9b9ab62f62606cd779ba38d039b120adb47b Mon Sep 17 00:00:00 2001 From: Satoshi Terasaki Date: Sun, 26 Apr 2026 18:09:31 +0900 Subject: [PATCH] Document Windows build tools setup --- README.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc63dd8..5d06c6e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,18 @@ RustToolChain.jl is a Julia package that provides Rust toolchains (especially `c - **Linux**: x86_64 (glibc, musl), aarch64 (glibc, musl), i686 (glibc, musl) - **macOS**: x86_64, aarch64 -- **Windows**: x86_64, aarch64 +- **Windows**: x86_64 + +### Preparation (Windows users only) + +Windows users need to run the following in an Administrator PowerShell to install the required build tools: + +```ps +winget install -e --id Microsoft.VisualStudio.2022.BuildTools ` + --accept-source-agreements ` + --accept-package-agreements ` + --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended" +``` ## Installation @@ -87,9 +98,12 @@ run(`$(cargo()) build --release`) This package uses Julia's Artifacts system to automatically download and manage Rust toolchains on Unix-like platforms. On first use, the appropriate Rust toolchain for your platform will be automatically downloaded. +The `cargo()` and `rustc()` functions return commands that use the isolated Windows toolchain when no system `cargo` or `rustc` is available. + +### Note for Windows Users + Windows uses a different installation path. Instead of installing the large Rust distribution tarball through Julia Artifacts, RustToolChain.jl downloads `rustup-init.exe` from `https://win.rustup.rs` and installs the Rust version recorded in `Artifacts.toml` with `rustup toolchain install --profile default`. The installation is isolated under this package's Julia scratchspace by setting package-local `RUSTUP_HOME` and `CARGO_HOME` directories. It does not modify the user's `PATH` or the user's existing Rust installation. -The `cargo()` and `rustc()` functions return commands that use the isolated Windows toolchain when no system `cargo` or `rustc` is available. ## Development