Skip to content

Commit 66a44d8

Browse files
authored
Unrolled build for #154428
Rollup merge of #154428 - davidtwco:json-target-spec-synthetic-targets, r=jieyouxu bootstrap: `-Zjson-target-spec` for synthetic targets Fixes #154340 Synthetic targets for mir-opt tests build a standard library using a `.json` target, which now requires `-Zjson-target-spec` r? @jieyouxu
2 parents fda6d37 + 8fc0581 commit 66a44d8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ impl Cargo {
122122
cmd_kind: Kind,
123123
) -> Cargo {
124124
let mut cargo = builder.cargo(compiler, mode, source_type, target, cmd_kind);
125+
if target.synthetic {
126+
cargo.arg("-Zjson-target-spec");
127+
}
125128

126129
match cmd_kind {
127130
// No need to configure the target linker for these command types.
@@ -165,7 +168,11 @@ impl Cargo {
165168
target: TargetSelection,
166169
cmd_kind: Kind,
167170
) -> Cargo {
168-
builder.cargo(compiler, mode, source_type, target, cmd_kind)
171+
let mut cargo = builder.cargo(compiler, mode, source_type, target, cmd_kind);
172+
if target.synthetic {
173+
cargo.arg("-Zjson-target-spec");
174+
}
175+
cargo
169176
}
170177

171178
pub fn rustdocflag(&mut self, arg: &str) -> &mut Cargo {

0 commit comments

Comments
 (0)