Skip to content

Commit 6b9dd46

Browse files
Auto merge of #145343 - Kobzol:dogfood-z-no-embed-metadata, r=<try>
Dogfood `-Zno-embed-metadata` in the compiler
2 parents ee361e8 + 412cf87 commit 6b9dd46

File tree

9 files changed

+17
-37
lines changed

9 files changed

+17
-37
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,7 @@ impl Step for Std {
103103

104104
let check_stamp =
105105
build_stamp::libstd_stamp(builder, build_compiler, target).with_prefix("check");
106-
run_cargo(
107-
builder,
108-
cargo,
109-
builder.config.free_args.clone(),
110-
&check_stamp,
111-
vec![],
112-
true,
113-
false,
114-
);
106+
run_cargo(builder, cargo, builder.config.free_args.clone(), &check_stamp, vec![], false);
115107

116108
drop(_guard);
117109

@@ -153,7 +145,7 @@ impl Step for Std {
153145
build_compiler,
154146
target,
155147
);
156-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
148+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
157149
check_stamp
158150
}
159151

@@ -370,7 +362,7 @@ impl Step for Rustc {
370362
let stamp =
371363
build_stamp::librustc_stamp(builder, build_compiler, target).with_prefix("check");
372364

373-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
365+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
374366

375367
stamp
376368
}
@@ -568,7 +560,7 @@ impl Step for CraneliftCodegenBackend {
568560
)
569561
.with_prefix("check");
570562

571-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
563+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
572564
}
573565

574566
fn metadata(&self) -> Option<StepMetadata> {
@@ -637,7 +629,7 @@ impl Step for GccCodegenBackend {
637629
)
638630
.with_prefix("check");
639631

640-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
632+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
641633
}
642634

643635
fn metadata(&self) -> Option<StepMetadata> {
@@ -761,7 +753,7 @@ fn run_tool_check_step(
761753
.with_prefix(&format!("{display_name}-check"));
762754

763755
let _guard = builder.msg(builder.kind, display_name, mode, build_compiler, target);
764-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
756+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
765757
}
766758

767759
tool_check_step!(Rustdoc {

src/bootstrap/src/core/build_steps/clippy.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ impl Step for Std {
215215
lint_args(builder, &self.config, IGNORED_RULES_FOR_STD_AND_RUSTC),
216216
&build_stamp::libstd_stamp(builder, build_compiler, target),
217217
vec![],
218-
true,
219218
false,
220219
);
221220
}
@@ -307,7 +306,6 @@ impl Step for Rustc {
307306
lint_args(builder, &self.config, IGNORED_RULES_FOR_STD_AND_RUSTC),
308307
&build_stamp::librustc_stamp(builder, build_compiler, target),
309308
vec![],
310-
true,
311309
false,
312310
);
313311
}
@@ -372,15 +370,7 @@ impl Step for CodegenGcc {
372370
let stamp = BuildStamp::new(&builder.cargo_out(build_compiler, Mode::Codegen, target))
373371
.with_prefix("rustc_codegen_gcc-check");
374372

375-
run_cargo(
376-
builder,
377-
cargo,
378-
lint_args(builder, &self.config, &[]),
379-
&stamp,
380-
vec![],
381-
true,
382-
false,
383-
);
373+
run_cargo(builder, cargo, lint_args(builder, &self.config, &[]), &stamp, vec![], false);
384374
}
385375

386376
fn metadata(&self) -> Option<StepMetadata> {
@@ -459,7 +449,6 @@ macro_rules! lint_any {
459449
lint_args(builder, &self.config, &[]),
460450
&stamp,
461451
vec![],
462-
true,
463452
false,
464453
);
465454
}

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ impl Step for Std {
290290
vec![],
291291
&build_stamp::libstd_stamp(builder, build_compiler, target),
292292
target_deps,
293-
self.is_for_mir_opt_tests, // is_check
294293
false,
295294
);
296295

@@ -1126,7 +1125,6 @@ impl Step for Rustc {
11261125
vec![],
11271126
&stamp,
11281127
vec![],
1129-
false,
11301128
true, // Only ship rustc_driver.so and .rmeta files, not all intermediate .rlib files.
11311129
);
11321130

@@ -1594,7 +1592,7 @@ impl Step for GccCodegenBackend {
15941592

15951593
let _guard =
15961594
builder.msg(Kind::Build, "codegen backend gcc", Mode::Codegen, build_compiler, target);
1597-
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false, false);
1595+
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false);
15981596

15991597
GccCodegenBackendOutput {
16001598
stamp: write_codegen_backend_stamp(stamp, files, builder.config.dry_run()),
@@ -1671,7 +1669,7 @@ impl Step for CraneliftCodegenBackend {
16711669
build_compiler,
16721670
target,
16731671
);
1674-
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false, false);
1672+
let files = run_cargo(builder, cargo, vec![], &stamp, vec![], false);
16751673
write_codegen_backend_stamp(stamp, files, builder.config.dry_run())
16761674
}
16771675

@@ -2392,7 +2390,6 @@ pub fn run_cargo(
23922390
tail_args: Vec<String>,
23932391
stamp: &BuildStamp,
23942392
additional_target_deps: Vec<(PathBuf, DependencyType)>,
2395-
is_check: bool,
23962393
rlib_only_metadata: bool,
23972394
) -> Vec<PathBuf> {
23982395
// `target_root_dir` looks like $dir/$target/release
@@ -2436,7 +2433,7 @@ pub fn run_cargo(
24362433
// Always keep native libraries, rust dylibs and debuginfo
24372434
keep = true;
24382435
}
2439-
if is_check && filename.ends_with(".rmeta") {
2436+
if filename.ends_with(".rmeta") {
24402437
// During check builds we need to keep crate metadata
24412438
keep = true;
24422439
} else if rlib_only_metadata {

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,7 +2358,7 @@ impl BookTest {
23582358
let stamp = BuildStamp::new(&builder.cargo_out(compiler, mode, target))
23592359
.with_prefix(PathBuf::from(dep).file_name().and_then(|v| v.to_str()).unwrap());
23602360

2361-
let output_paths = run_cargo(builder, cargo, vec![], &stamp, vec![], false, false);
2361+
let output_paths = run_cargo(builder, cargo, vec![], &stamp, vec![], false);
23622362
let directories = output_paths
23632363
.into_iter()
23642364
.filter_map(|p| p.parent().map(ToOwned::to_owned))

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,8 @@ impl Builder<'_> {
10431043
// Enable usage of unstable features
10441044
cargo.env("RUSTC_BOOTSTRAP", "1");
10451045

1046+
cargo.arg("-Zno-embed-metadata");
1047+
10461048
if self.config.dump_bootstrap_shims {
10471049
prepare_behaviour_dump_dir(self.build);
10481050

tests/ui/error-codes/E0152-duplicate-lang-items.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | | }
99
| |_^
1010
|
1111
= note: the lang item is first defined in crate `std` (which `E0152_duplicate_lang_items` depends on)
12-
= note: first definition in `std` loaded from SYSROOT/libstd-*.rlib
12+
= note: first definition in `std` loaded from SYSROOT/libstd-*.rmeta
1313
= note: second definition in the local crate (`E0152_duplicate_lang_items`)
1414

1515
error: aborting due to 1 previous error

tests/ui/error-codes/E0152.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | struct Foo<T>(T);
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: the lang item is first defined in crate `alloc` (which `std` depends on)
8-
= note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rlib
8+
= note: first definition in `alloc` loaded from SYSROOT/liballoc-*.rmeta
99
= note: second definition in the local crate (`E0152`)
1010

1111
error: aborting due to 1 previous error

tests/ui/lang-items/duplicate.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | trait Sized {}
55
| ^^^^^^^^^^^^^^
66
|
77
= note: the lang item is first defined in crate `core` (which `std` depends on)
8-
= note: first definition in `core` loaded from SYSROOT/libcore-*.rlib
8+
= note: first definition in `core` loaded from SYSROOT/libcore-*.rmeta
99
= note: second definition in the local crate (`duplicate`)
1010

1111
error: aborting due to 1 previous error

tests/ui/panic-handler/panic-handler-std.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | | }
77
| |_^
88
|
99
= note: the lang item is first defined in crate `std` (which `panic_handler_std` depends on)
10-
= note: first definition in `std` loaded from SYSROOT/libstd-*.rlib
10+
= note: first definition in `std` loaded from SYSROOT/libstd-*.rmeta
1111
= note: second definition in the local crate (`panic_handler_std`)
1212

1313
error: aborting due to 1 previous error

0 commit comments

Comments
 (0)