This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1+ //! This module handles building and managing various tools in bootstrap
2+ //! build system.
3+ //!
4+ //! **What It Does**
5+ //! - Defines how tools are built, configured and installed.
6+ //! - Manages tool dependencies and build steps.
7+ //! - Copies built tool binaries to the correct locations.
8+ //!
9+ //! Each Rust tool **MUST** utilize `ToolBuild` inside their `Step` logic,
10+ //! return `ToolBuildResult` and should never prepare `cargo` invocations manually.
11+
112use std:: path:: PathBuf ;
213use std:: { env, fs} ;
314
@@ -64,10 +75,16 @@ impl Builder<'_> {
6475 }
6576}
6677
78+ /// Result of the tool build process. Each `Step` in this module is responsible
79+ /// for using this type as `type Output = ToolBuildResult;`
6780#[ derive( Clone ) ]
6881pub struct ToolBuildResult {
82+ /// Executable path of the corresponding tool that was built.
6983 pub tool_path : PathBuf ,
84+ /// Compiler used to build the tool. For non-`ToolRustc` tools this is equal to `target_compiler`.
85+ /// For `ToolRustc` this is one stage before of the `target_compiler`.
7086 pub build_compiler : Compiler ,
87+ /// Target compiler passed to `Step`.
7188 pub target_compiler : Compiler ,
7289}
7390
@@ -274,6 +291,7 @@ pub fn prepare_tool_cargo(
274291 cargo
275292}
276293
294+ /// Handle stage-off logic for `ToolRustc` tools when necessary.
277295pub ( crate ) fn get_tool_rustc_compiler (
278296 builder : & Builder < ' _ > ,
279297 target_compiler : Compiler ,
You can’t perform that action at this time.
0 commit comments