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_extended ๐Ÿ”’

Structsยง

BuildManifest
BuiltLldWrapper
Represents a built LldWrapper, the lld-wrapper tool itself, and a directory containing a build of LLD.
BumpStage0
Cargo
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.
Rustdoc
RustdocGUITest
RustdocTheme
Rustfmt
TestFloatParse
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 ๐Ÿ”’

Staticsยง

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

Functionsยง

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_rustc_compiler ๐Ÿ”’
Handle stage-off logic for ToolRustc tools when necessary.
get_tool_target_compiler ๐Ÿ”’
Returns compiler that is able to compile a ToolTarget tool with the given mode.
prepare_tool_cargo
run_tool_build_step ๐Ÿ”’
should_run_tool_build_step ๐Ÿ”’