From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. You can help by expanding it.

Rust is a general-purpose, multi-paradigm, compiled programming language.


USE flags

A recommended use flag to enable is system-llvm, but it can lead into a failed build due to possible LLVM version differences

USE flags for dev-lang/rust Systems programming language from Mozilla

clippy Install clippy, Rust code linter
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
miri Install miri, an interpreter for Rust's mid-level intermediate representation (requires USE=nightly)
nightly Enable nightly (UNSTABLE) features
parallel-compiler Build a multi-threaded rustc (experimental, not tested by upstream)
rls Install rls, Rust Language Server (used with IDEs supporting RLS protocol)
rust-src Install rust-src, needed by developer tools and for build-std (cross)
rustfmt Install rustfmt, Rust code formatter
system-bootstrap Bootstrap using installed rust compiler
system-llvm Use the system LLVM install
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)
verify-sig Verify upstream signatures on distfiles
wasm Build support for the wasm32-unknown-unknown target


Emerge the package base

root #emerge --ask dev-lang/rust

There's also an binary package provided due to the long compile times.

root #emerge --ask dev-lang/rust-bin


Rust does not support distcc compiling and may require local package.env defined to avoid excessive IO consumption when building on distcc tuned hosts. (i.e. MAKEOPTS="-j30 -l4", 30 is great than 4 local CPU cores )

--local-load is not honoured, so you must pass an appropriate --jobs value in relation to the locally available build resources.

FILE /etc/portage/env/nodistcc-makeopts.conf
FILE /etc/portage/package.env/rust
dev-lang/rust nodistcc-makeopts.conf