Introduction to Rust

The Rust programming language is designed to be a safe, concurrent, practical language.

As with many other programming languages, rustc (the rust compiler) needs a binary from which to bootstrap. It will download a stage0 binary, and several cargo files (these are actually .tar.gz source archives) at the start of the build, so you cannot compile it without an internet connection.

The current rustbuild build-system will use all available processors, although it does not scale well and often falls back to just using one core while waiting for a library to compile.

At the moment Rust does not provide any guarantees of a stable ABI.

This package is known to build and work properly using an LFS-8.1 platform.

Package Information

  • Download (HTTP):

  • Download (FTP):

  • Download MD5 sum: 75e779670ac79edf023497a9c37eb35d

  • Download size: 48 MB

  • Estimated disk space required: 4.2 GB (362 MB installed), (add 0.6GB for tests) plus 273MB for ~/.cargo files

  • Estimated build time: 33 SBU (add 14 SBU for tests, both with 4 processors)

Rust Dependencies


cURL-7.55.1, CMake-3.9.1, Python-2.7.13


GDB-8.0 (used by debuginfo-gdb in the testsuite), Ninja-1.7.2

User Notes:

Installation of Rust



This package is updated on a six-weekly release cycle. Because it is such a large and slow package to build, and is at the moment only used by one package in this book, the BLFS editors take the view that it should only be updated when that is necessary.

First create a suitable config.toml file which will configure the build :

cat <<EOF > config.toml
# see src/bootstrap/config.toml.example for more possible options
targets = "X86"

# install cargo as well as rust
extended = true

prefix = "/usr"
docdir = "share/doc/rustc-1.19.0"
channel = "stable"

Now install Rust by running the following commands:

./ build

To run the tests issue ./ test --verbose --no-fail-fast >../rustc-testlog: as with the build, that will use all available CPUs. This runs maniy suites of tests (in an apparently random order), three may fail: compile-fail/ and run-make/target-without-atomics both try to compile for the thumbv6m-none-eabi target, but the BLFS build does not cater for that, and all 105 tests in debuginfo-gdb will fail if gdb has not been installed.

If you wish to look at the numbers for the results, you can find the total number of tests which were considered by running:

grep 'running .* tests' ../rustc-testlog | awk '{ sum += $2 } END { print sum }'

That should report 14029 tests. Similarly, the total tests which failed can be found by running:

grep '^test result:' ../rustc-testlog | awk  '{ sum += $6 } END { print sum }'

And similarly for the tests which passed use $4, for those which were ignored (i.e. skipped) use $8 (and $10 for 'measured', $12 for 'filtered out' but both are probably zero). The breakdown does not match the overall total.

Now, as the root user:

./ install

Command Explanations

targets = "X86": this avoids building all the available linux cross-compilers (Aarch64, MIPS, PowerPC, SystemZ, etc).

extended = true: this installs Cargo alongside Rust.

channel = "stable": this ensures only stable features can be used, the default in config.toml is to use development features, which is not appropriate for a released version.

--verbose: this switch can sometimes provide more information about a test which fails.

--no-fail-fast: this switch ensures that the testsuite will not stop at the first error.


Installed Programs: cargo, rust-gdb, rust-lldb, rustc, rustdoc.
Installed Libraries: Many lib*<16-byte-hash>.so libraries.
Installed Directories: ~/.cargo, /usr/lib/rustlib, /usr/share/doc/rustc-1.19.0, and /usr/share/zsh/site-functions/

Short Descriptions


is the Package Manager for Rust.


is a Python wrapper script for gdb.


is a Python wrapper script for LLDB (the LLVM debugger).


is the rust compiler.


generates documentation from rust source code.


is the Rust Standard Library, the foundation of portable Rust software.

Last updated on 2017-08-29 11:35:03 -0700