%general-entities; ]> $LastChangedBy$ $Date$ Rustc-&rust-version; Rust 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. &lfs81_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &rust-md5sum; Download size: &rust-size; Estimated disk space required: &rust-buildsize; Estimated build time: &rust-time; Rust Dependencies Required , , Optional (used by debuginfo-gdb in the testsuite) 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 [llvm] targets = "X86" [build] # install cargo as well as rust extended = true [install] prefix = "/usr" docdir = "share/doc/rustc-1.19.0" channel = "stable" EOF Now install Rust by running the following commands: ./x.py build To run the tests issue ./x.py test --verbose --no-fail-fast >../rustc-testlog: as with the build, that will use all available CPUs. This runs many suites of tests (in an apparently random order), three may fail: compile-fail/issue-37131.rs 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: ./x.py 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. Contents Installed Programs Installed Libraries Installed Directories cargo, rust-gdb, rust-lldb, rustc, rustdoc. Many lib*<16-byte-hash>.so libraries. ~/.cargo, /usr/lib/rustlib, /usr/share/doc/rustc-&rust-version;, and /usr/share/zsh/site-functions/ Short Descriptions cargo is the Package Manager for Rust. cargo rust-gdb is a Python wrapper script for gdb. rust-gdb rust-lldb is a Python wrapper script for LLDB (the LLVM debugger). rust=lldb rustc is the rust compiler. rustc rustdoc generates documentation from rust source code. rustdoc libstd-<16-byte-hash>.so is the Rust Standard Library, the foundation of portable Rust software. libstd-<16-byte-hash>.so