Skip to content

Commit cdf54bb

Browse files
committed
Remove compiler_for from dist::Cargo
1 parent 1ec9519 commit cdf54bb

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ use tracing::instrument;
2121

2222
use crate::core::build_steps::compile::{get_codegen_backend_file, normalize_codegen_backend_name};
2323
use crate::core::build_steps::doc::DocumentationFormat;
24-
use crate::core::build_steps::tool::{self, RustcPrivateCompilers, Tool};
24+
use crate::core::build_steps::tool::{
25+
self, RustcPrivateCompilers, Tool, ToolTargetBuildMode, get_tool_target_compiler,
26+
};
2527
use crate::core::build_steps::vendor::{VENDOR_DIR, Vendor};
2628
use crate::core::build_steps::{compile, llvm};
2729
use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step, StepMetadata};
@@ -1284,10 +1286,9 @@ impl Step for Cargo {
12841286

12851287
fn make_run(run: RunConfig<'_>) {
12861288
run.builder.ensure(Cargo {
1287-
build_compiler: run.builder.compiler_for(
1288-
run.builder.top_stage,
1289-
run.builder.config.host_target,
1290-
run.target,
1289+
build_compiler: get_tool_target_compiler(
1290+
run.builder,
1291+
ToolTargetBuildMode::Build(run.target),
12911292
),
12921293
target: run.target,
12931294
});
@@ -1318,6 +1319,10 @@ impl Step for Cargo {
13181319

13191320
Some(tarball.generate())
13201321
}
1322+
1323+
fn metadata(&self) -> Option<StepMetadata> {
1324+
Some(StepMetadata::dist("cargo", self.target).built_by(self.build_compiler))
1325+
}
13211326
}
13221327

13231328
#[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)]

src/bootstrap/src/core/builder/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,7 @@ mod snapshot {
11241124
[dist] rustc 1 <host> -> analysis 2 <host>
11251125
[dist] src <>
11261126
[build] rustc 1 <host> -> cargo 2 <host>
1127+
[dist] rustc 1 <host> -> cargo 2 <host>
11271128
[build] rustc 1 <host> -> rust-analyzer 2 <host>
11281129
[build] rustc 1 <host> -> rustfmt 2 <host>
11291130
[build] rustc 1 <host> -> cargo-fmt 2 <host>
@@ -1453,6 +1454,7 @@ mod snapshot {
14531454
[dist] rustc 1 <host> -> analysis 2 <target1>
14541455
[dist] src <>
14551456
[build] rustc 1 <host> -> cargo 2 <target1>
1457+
[dist] rustc 1 <host> -> cargo 2 <target1>
14561458
[build] rustc 1 <host> -> rust-analyzer 2 <target1>
14571459
[build] rustc 1 <host> -> rustfmt 2 <target1>
14581460
[build] rustc 1 <host> -> cargo-fmt 2 <target1>

0 commit comments

Comments
 (0)