Module tool

Source
Expand description

This module handles building and managing various tools in bootstrap build system.

What It Does

  • Defines how tools are built, configured and installed.
  • Manages tool dependencies and build steps.
  • Copies built tool binaries to the correct locations.

Each Rust tool MUST utilize ToolBuild inside their Step logic, return ToolBuildResult and should never prepare cargo invocations manually.

Macrosยง

bootstrap_tool ๐Ÿ”’
tool_rustc_extended ๐Ÿ”’
Creates a step that builds an extended Mode::ToolRustcPrivate tool and installs it into the sysroot of a corresponding compiler.

Structsยง

BuildManifest
BuiltLldWrapper
Represents a built LldWrapper, the lld-wrapper tool itself, and a directory containing a build of LLD.
BumpStage0
Cargo
Builds the cargo tool. Note that it can be built using a stable compiler.
CargoClippy
CargoMiri
CargoTest
Cargofmt
Clippy
CollectLicenseMetadata
Compiletest
CoverageDump
ErrorIndex
FeaturesStatusDump
GenerateCopyright
GenerateWindowsSys
HtmlChecker
JsonDocCk
JsonDocLint
LibcxxVersionTool
Linkchecker
LintDocs
LldWrapper
LlvmBitcodeLinker
Miri
OptimizedDist
RemoteTestClient
RemoteTestServer
ReplaceVersionPlaceholder
RunMakeSupport
RustAnalyzer
RustAnalyzerProcMacroSrv
RustInstaller
Rustbook
RustcPerf
The rustc-perf benchmark suite, which is added as a submodule at src/tools/rustc-perf.
RustcPrivateCompilers
Represents which compilers are involved in the compilation of a tool that depends on compiler internals (rustc_private). Their compilation looks like this:
Rustdoc
Represents Rustdoc that either comes from the external stage0 sysroot or that is built locally. Rustdoc is special, because it both essentially corresponds to a Compiler (that can be externally provided), but also to a ToolRustcPrivate tool.
RustdocGUITest
RustdocTheme
Rustfmt
Tidy
ToolBuild ๐Ÿ”’
ToolBuildResult
Result of the tool build process. Each Step in this module is responsible for using this type as type Output = ToolBuildResult;
UnicodeTableGenerator
UnstableBookGen
WasmComponentLd
Builds the wasm-component-ld linker wrapper, which is shipped with rustc to be executed on the host platform where rustc runs.

Enumsยง

LibcxxVersion
SourceType
Tool
ToolArtifactKind
ToolTargetBuildMode
Determines how to build a ToolTarget, i.e. which compiler should be used to compile it. The compiler stage is automatically bumped if we need to cross-compile a stage 1 tool.

Constantsยง

COMPILETEST_ALLOW_FEATURES ๐Ÿ”’
TEST_FLOAT_PARSE_ALLOW_FEATURES

Staticsยง

SUBMODULES_FOR_RUSTBOOK
These are the submodules that are required for rustbook to work due to depending on mdbook plugins.

Functionsยง

build_extended_rustc_tool ๐Ÿ”’
copy_link_tool_bin ๐Ÿ”’
Links a built tool binary with the given name from the build directory to the tools directory.
copy_lld_artifacts ๐Ÿ”’
get_tool_target_compiler ๐Ÿ”’
Returns compiler that is able to compile a ToolTarget tool with the given mode.
prepare_tool_cargo
should_run_extended_rustc_tool ๐Ÿ”’