Rustlers Atom 0.2 - Install: rustup and toolchains
On this page
<figure class="video" style="margin:0;">
<div style="position:relative;width:100%;padding-bottom:56.25%;height:0;overflow:hidden;">
<iframe src="https://www.youtube.com/embed/S3nqygf-qE4?si=OzevlHIOBQfPX6bh"
title="YouTube video player"
style="position:absolute;top:0;left:0;width:100%;height:100%;border:0;"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen></iframe>
</div>
</figure>
rustup is the official Rust toolchain manager. Use it because it keeps Rust in your home directory (safe, no system package churn), lets you switch between stable, beta, and nightly per project, and installs extras like rustfmt and clippy cleanly. It also supports a rust-toolchain.toml file so a repo can declare exactly which compiler it needs; when you cd into the project, the right toolchain is activated automatically. In short: predictable installs, painless updates, and reproducible environments.
Prepare your system#
On macOS, you need Apple’s command-line tools for a C compiler and linker:
xcode-select --installOn Linux, make sure you have a basic build toolchain and headers (Debian/Ubuntu example):
sudo apt update && sudo apt install -y build-essential pkg-config libssl-devOn Windows, decide your path:
- Native Windows (recommended) uses the MSVC toolchain. Install Microsoft C++ Build Tools (via the Visual Studio Installer: “Desktop development with C++”). This gives you
link.exeand friends that many Rust crates expect. - WSL treats your machine like Linux. If you live in a Unixy shell and want Linux targets, this is often the simplest route.
Install rustup and Rust#
Unix/macOS:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source "$HOME/.cargo/env"Take the default profile unless you already know you want the “minimal” one.
Windows:
Open PowerShell and install via Winget:
winget install --id Rustlang.RustupYou can also download rustup-init.exe from rust-lang.org and run it. Afterward, open a fresh PowerShell/Terminal so the updated PATH is active. If you chose native Windows, rustup defaults to the MSVC toolchain (stable-x86_64-pc-windows-msvc).
Rust ships on three channels:
- stable for production work (default),
- beta for pre-release testing,
- nightly for experimental features.
You can switch globally if you want:
rustup default stable
rustup toolchain install nightlyFor per-project pinning, create one of these in your repo root:
- Simple pin: a text file named
rust-toolchainwith the name of the channel - Rich config:
rust-toolchain.tomlwith a full configuration like this
[toolchain]
channel = "stable"
components = ["rustfmt", "clippy"]
targets = []Whenever you enter that directory, rustup activates the declared toolchain and installs missing components automatically.
A 30-second smoke test#
cargo new hello-rust
cd hello-rust
cargo runYou should see “Hello, world!” If it builds, your compiler, linker, and PATH are all behaving.
Useful links:
Install C and C++ support in Visual Studio | Microsoft Learn