Skip to content

Rust ​

Catalog v8.

Installs rustup with the Cargo, rustc, rustfmt, Clippy, and rust-analyzer commands, plus GCC, pkg-config, and GDB. rustup downloads the Rust toolchains themselves.

Select ​

toml
[toolchains]
rust = "stable"

Set the default toolchain in the [toolchains] table of limanix.toml and apply the change. The client guide describes the [toolchains] table.

Toolchains ​

The value names the default toolchain of the development account:

ValueToolchain
stable, beta, nightlyThe newest release of the channel at install time
nightly-2026-10-01A channel as it was on that date
1.90, 1.90.0A Rust release

A user service installs the toolchain with the rustfmt, Clippy, rust-analyzer, and rust-src components, then makes it the default. It runs when the VM starts after the value changes, and needs network access to static.rust-lang.org. Until it finishes, Cargo reports that no default toolchain is configured. Follow it with:

console
systemctl --user status rust-toolchain

A failed download is tried again, after ten seconds at first and then at most every ten minutes. The toolchain uses the minimal profile. The local documentation from rust-docs is not installed.

rustup keeps toolchains in ~/.rustup and Cargo keeps downloaded crates in ~/.cargo; both stay across VM updates. A channel does not move on its own: run rustup update to fetch its newest release. A default that you set with rustup default stays until the value in limanix.toml changes.

Project toolchains ​

A project selects its own toolchain with a rust-toolchain.toml file, which rustup installs on first use:

toml
[toolchain]
channel = "1.89.0"
components = ["rustfmt", "clippy"]

See overrides for the order in which rustup chooses a toolchain.

Use ​

Inside the VM, run from a directory that contains Cargo.toml:

console
cargo build
cargo test
cargo fmt
cargo clippy

Debug the resulting programs with rust-gdb. Commands from cargo install go to ~/.cargo/bin, which comes first on PATH.

Native dependencies ​

Crates that bind to system libraries, such as openssl-sys, build with the included GCC and pkg-config. They also need the library's headers and a pkg-config search path; see Handle native dependencies.

Editor support ​

The module offers rust-analyzer to editors that support the Language Server Protocol. rustup runs the rust-analyzer of the project's toolchain. The server matches the compiler. See Editor integration and the rust-analyzer editor setup.

Configuration and integration
BoundaryContract
Public optionlmx.rust.toolchain, default stable; the client sets it from [toolchains] rust
Public capabilitylmx.capabilities.languageSupport.tools.rust-analyzer; Rust parser
Personal state~/.rustup toolchains, ~/.cargo crates and commands, project build output
IntegrationDeclares rust-analyzer without enabling an editor; a user-supplied provider replaces the rustup proxy
Servicesrust-toolchain, a user service of the development account that installs the declared toolchain

Corner cases ​

CaseBehavior or next step
No network when the VM startsCargo has no default toolchain; the service retries, or restart it with systemctl --user restart rust-toolchain
Project needs another toolchainAdd rust-toolchain.toml; rustup installs that toolchain on first use
A channel should moveRun rustup update; the module installs a toolchain only when the value changes
Native dependency failsGCC and pkg-config are present; provide the required library and its search path
Disk fills with toolchainsList them with rustup toolchain list, remove one with rustup toolchain uninstall

Free and open source under the Apache License 2.0.