Crate bootstrap

source ·
Expand description

Implementation of rustbuild, the Rust build system.

This module, and its descendants, are the implementation of the Rust build system. Most of this build system is backed by Cargo but the outer layer here serves as the ability to orchestrate calling Cargo, sequencing Cargo builds, building artifacts like LLVM, etc. The goals of rustbuild are:

  • To be an easily understandable, easily extensible, and maintainable build system.
  • Leverage standard tools in the Rust ecosystem to build the compiler, aka and Cargo.
  • A standard interface to build across all platforms, including MSVC

Further information

More documentation can be found in each respective module below, and you can also check out the src/bootstrap/ file for more information.


  • builder 🔒
  • cache 🔒
  • cc_detect 🔒
    C-compiler probing and detection.
  • channel 🔒
    Build configuration for Rust’s release channels.
  • check 🔒
    Implementation of compiling the compiler and standard library, in “check”-based modes.
  • clean 🔒
    Implementation of make clean in rustbuild.
  • compile 🔒
    Implementation of compiling various phases of the compiler and standard library.
  • config 🔒
    Serialized configuration of a build.
  • dist 🔒
    Implementation of the various distribution aspects of the compiler.
  • doc 🔒
    Documentation generation for rustbuilder.
  • download 🔒
  • flags 🔒
    Command-line interface of the rustbuild build system.
  • format 🔒
    Runs rustfmt on the repository.
  • install 🔒
    Implementation of the install aspects of the compiler.
  • job 🔒
  • llvm 🔒
    Compilation of native dependencies like LLVM.
  • metadata 🔒
  • This module renders the JSON output of libtest into a human-readable form, trying to be as similar to libtest’s native output as possible.
  • run 🔒
  • sanity 🔒
    Sanity checking performed by rustbuild before actually executing anything.
  • setup 🔒
  • suggest 🔒
  • In some cases, parts of bootstrap need to change part of a target spec just for one or a few steps. Adding these targets to rustc proper would “leak” this implementation detail of bootstrap, and would make it more complex to apply additional changes if the need arises.
  • tarball 🔒
  • test 🔒
    Implementation of the test-related targets of the build system.
  • tool 🔒
  • toolstate 🔒
  • Various utility functions used throughout rustbuild.


  • forward 🔒
  • A helper macro to unwrap a result except also print out details like:


  • Global configuration for the build system.
  • A structure representing a Rust compiler.
  • Global configuration for the entire build and/or bootstrap.
  • Crate 🔒