Skip to content

Commit 648d6ce

Browse files
committed
Remove compiler_for from dist::Cargo
1 parent 172c6f5 commit 648d6ce

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};
@@ -1293,10 +1295,9 @@ impl Step for Cargo {
12931295

12941296
fn make_run(run: RunConfig<'_>) {
12951297
run.builder.ensure(Cargo {
1296-
build_compiler: run.builder.compiler_for(
1297-
run.builder.top_stage,
1298-
run.builder.config.host_target,
1299-
run.target,
1298+
build_compiler: get_tool_target_compiler(
1299+
run.builder,
1300+
ToolTargetBuildMode::Build(run.target),
13001301
),
13011302
target: run.target,
13021303
});
@@ -1327,6 +1328,10 @@ impl Step for Cargo {
13271328

13281329
Some(tarball.generate())
13291330
}
1331+
1332+
fn metadata(&self) -> Option<StepMetadata> {
1333+
Some(StepMetadata::dist("cargo", self.target).built_by(self.build_compiler))
1334+
}
13301335
}
13311336

13321337
#[derive(Debug, 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
@@ -1201,6 +1201,7 @@ mod snapshot {
12011201
[dist] rustc 1 <host> -> analysis 2 <host>
12021202
[dist] src <>
12031203
[build] rustc 1 <host> -> cargo 2 <host>
1204+
[dist] rustc 1 <host> -> cargo 2 <host>
12041205
[build] rustc 1 <host> -> rust-analyzer 2 <host>
12051206
[build] rustc 1 <host> -> rustfmt 2 <host>
12061207
[build] rustc 1 <host> -> cargo-fmt 2 <host>
@@ -1530,6 +1531,7 @@ mod snapshot {
15301531
[dist] rustc 1 <host> -> analysis 2 <target1>
15311532
[dist] src <>
15321533
[build] rustc 1 <host> -> cargo 2 <target1>
1534+
[dist] rustc 1 <host> -> cargo 2 <target1>
15331535
[build] rustc 1 <host> -> rust-analyzer 2 <target1>
15341536
[build] rustc 1 <host> -> rustfmt 2 <target1>
15351537
[build] rustc 1 <host> -> cargo-fmt 2 <target1>

0 commit comments

Comments
 (0)