Skip to content

Commit d1683e7

Browse files
committed
Add metadata to Cargo and RustAnalyzer tools
1 parent c89fe80 commit d1683e7

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,14 @@ impl Step for Cargo {
886886
artifact_kind: ToolArtifactKind::Binary,
887887
})
888888
}
889+
890+
fn metadata(&self) -> Option<StepMetadata> {
891+
// FIXME: fix staging logic
892+
Some(
893+
StepMetadata::build("cargo", self.target)
894+
.built_by(self.compiler.with_stage(self.compiler.stage - 1)),
895+
)
896+
}
889897
}
890898

891899
/// Represents a built LldWrapper, the `lld-wrapper` tool itself, and a directory
@@ -1105,6 +1113,14 @@ impl Step for RustAnalyzer {
11051113
artifact_kind: ToolArtifactKind::Binary,
11061114
})
11071115
}
1116+
1117+
fn metadata(&self) -> Option<StepMetadata> {
1118+
// FIXME: fix staging logic
1119+
Some(
1120+
StepMetadata::build("rust-analyzer", self.target)
1121+
.built_by(self.compiler.with_stage(self.compiler.stage - 1)),
1122+
)
1123+
}
11081124
}
11091125

11101126
#[derive(Debug, Clone, Hash, PartialEq, Eq)]

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,8 @@ mod snapshot {
11011101
[dist] rustc <host>
11021102
[dist] rustc 1 <host> -> std 1 <host>
11031103
[dist] src <>
1104+
[build] rustc 0 <host> -> cargo 1 <host>
1105+
[build] rustc 0 <host> -> rust-analyzer 1 <host>
11041106
[build] rustc 0 <host> -> rustfmt 1 <host>
11051107
[build] rustc 0 <host> -> cargo-fmt 1 <host>
11061108
[build] rustc 0 <host> -> clippy-driver 1 <host>
@@ -1291,6 +1293,8 @@ mod snapshot {
12911293
[dist] rustc <target1>
12921294
[dist] rustc 1 <host> -> std 1 <target1>
12931295
[dist] src <>
1296+
[build] rustc 0 <host> -> cargo 1 <target1>
1297+
[build] rustc 0 <host> -> rust-analyzer 1 <target1>
12941298
[build] rustc 0 <host> -> rustfmt 1 <target1>
12951299
[build] rustc 0 <host> -> cargo-fmt 1 <target1>
12961300
[build] rustc 0 <host> -> clippy-driver 1 <target1>

0 commit comments

Comments
 (0)