Skip to main content

Crate bootstrap

Crate bootstrap 

Source
Expand description

Implementation of bootstrap, 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 bootstrap are:

  • To be an easily understandable, easily extensible, and maintainable build system.
  • Leverage standard tools in the Rust ecosystem to build the compiler, aka crates.io 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/README.md file for more information.

ModulesΒ§

cli_main
bootstrap, the Rust build system
core πŸ”’
utils πŸ”’
This module contains integral components of the build and configuration process, providing support for a wide range of tasks and operations such as caching, tarballs, release channels, job management, etc.

MacrosΒ§

debug
error
forward πŸ”’
info
trace
trace_io
Create a tracing span around an I/O operation, if tracing is enabled. Note that at least one tracing value field has to be passed to this macro, otherwise it will not compile.
warn

StructsΒ§

Build
Global configuration for the build system.
Compiler
A structure representing a Rust compiler.
Crate πŸ”’
TargetAndStage πŸ”’
An alternative way of specifying what target and stage is involved in some bootstrap activity. Ideally using a Compiler directly should be preferred.

EnumsΒ§

CLang
CodegenBackendKind
Represents a codegen backend.
DependencyType
When building Rust various objects are handled differently.
FileType
GitRepo
Mode
The various β€œmodes” of invoking Cargo.
RemapScheme
When rust.rust_remap_debuginfo is requested, the compiler needs to know how to opportunistically unremap compiler vs non-compiler sources. We use two schemes, RemapScheme::Compiler and RemapScheme::NonCompiler.
TestTarget

ConstantsΒ§

EXTRA_CHECK_CFGS πŸ”’
Extra --check-cfg to add when building the compiler or tools (Mode restriction, config name, config values (if any))
LLD_FILE_NAMES πŸ”’
LLD file names for all flavors.
LLVM_TOOLS πŸ”’

FunctionsΒ§

chmod πŸ”’
envify πŸ”’
prepare_behaviour_dump_dir
Ensures that the behavior dump directory is properly initialized.