Rustlers Atom 0.2 - Install: rustup and toolchains

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 --install

On 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-dev

On 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.exe and 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.Rustup

You 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 nightly

For per-project pinning, create one of these in your repo root:

  • Simple pin: a text file named rust-toolchain with the name of the channel
  • Rich config: rust-toolchain.toml with 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 run

You 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

Rust Programming Language


You'll only receive email when they publish something new.

More from GSLF
All posts