Manage Rust toolchains with OMG

Install Rust, switch between stable and nightly toolchains, use rust-toolchain.toml, and manage Cargo binaries alongside system packages.

Install Rust toolchains without rustup

OMG implements a native Rust toolchain manager in pure Rust without shell wrappers or an external rustup dependency. It downloads official release manifests and component archives directly from static.rust-lang.org, verifies SHA-256 digests against the upstream manifest, and stages components safely before publishing them to your local versions tree.

Supported targets include Linux x86_64 and Apple Silicon macOS. Supported channels include stable, beta, nightly, and exact compiler versions.

Install the stable Rust toolchain and inspect it

omg use rust stable
omg list rust
omg which rust

Running omg use rust installs the toolchain if missing, updates the current symlink, and reports the active compiler. When shell integration is enabled, the shell hook prepends that toolchain’s bin directory to PATH upon entering a directory with a matching pin.

Verify rustc and cargo at a fresh shell prompt

rustc --version
cargo --version
which -a rustc

Pin toolchains with rust-toolchain.toml

When you enter a project directory, OMG scans for toolchain pins in order: rust-toolchain, rust-toolchain.toml, and then universal .tool-versions. The parser extracts the channel, profile, components, and targets declared in the toolchain table.

Example rust-toolchain.toml configuration

[toolchain]
channel = "stable"
components = ["clippy", "rustfmt"]

Serialized mutations and integrity locking

Toolchain operations within an OMG data directory are serialized by an internal mutation lock (.mutation.lock). Only one update, installation, or removal can run at a time. The lock releases automatically when the process exits. Do not remove the lock file manually; its presence alone does not mean an operation is active.

Incremental component additions must match the installed toolchain’s recorded compiler release. If upstream manifests change, OMG rejects mismatched component additions until the toolchain is refreshed.

Inspect available upstream channels and installed toolchains

omg list rust --available
omg list rust

Precompiled developer tools versus Cargo compilation

Many popular terminal utilities (ripgrep, bat, fd, eza, starship) are written in Rust. Compiling them from crates.io with cargo install consumes significant CPU time and requires building dependencies from source.

With OMG, you can install precompiled and cryptographically verified binaries directly using your native package manager (omg install ripgrep) or from OMG’s curated tool registry (omg tool install starship), avoiding repetitive compilation overhead.

Install precompiled Rust developer utilities

omg install ripgrep
omg tool install starship
ripgrep --version

When commands resolve to an existing rustup installation

Check binary resolution across PATH

omg which rust
which -a rustc
which -a cargo

If you have an existing rustup setup (~/.cargo/bin), inspect your shell profile to ensure OMG hooks take precedence. You can leave rustup files on disk while evaluating OMG.

Consult the runtime handbook for complete toolchain lifecycle options, component targets, and host platform support.

Sources and verification

Commands and behavior are based on the references below. Source review is not a claim that every workflow has been executed on every supported platform.

Read as Markdown