Skip to content

Commit 8d6ab11

Browse files
committed
Use -Zno-embed-metadata in bootstrap
1 parent c26ea4f commit 8d6ab11

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl Step for Std {
116116
);
117117

118118
let stamp = build_stamp::libstd_stamp(builder, compiler, target).with_prefix("check");
119-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
119+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
120120

121121
// We skip populating the sysroot in non-zero stage because that'll lead
122122
// to rlib/rmeta conflicts if std gets built during this session.
@@ -165,7 +165,7 @@ impl Step for Std {
165165

166166
let stamp = build_stamp::libstd_stamp(builder, compiler, target).with_prefix("check-test");
167167
let _guard = builder.msg_check("library test/bench/example targets", target, Some(stage));
168-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
168+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
169169
}
170170
}
171171

@@ -252,7 +252,7 @@ impl Step for Rustc {
252252

253253
let stamp = build_stamp::librustc_stamp(builder, compiler, target).with_prefix("check");
254254

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

257257
let libdir = builder.sysroot_target_libdir(compiler, target);
258258
let hostdir = builder.sysroot_target_libdir(compiler, compiler.host);
@@ -313,7 +313,7 @@ impl Step for CodegenBackend {
313313
let stamp = build_stamp::codegen_backend_stamp(builder, compiler, target, backend)
314314
.with_prefix("check");
315315

316-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
316+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
317317
}
318318
}
319319

@@ -371,7 +371,7 @@ impl Step for RustAnalyzer {
371371
.with_prefix("rust-analyzer-check");
372372

373373
let _guard = builder.msg_check("rust-analyzer artifacts", target, None);
374-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
374+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
375375
}
376376
}
377377

@@ -430,7 +430,7 @@ impl Step for Compiletest {
430430
.with_prefix("compiletest-check");
431431

432432
let _guard = builder.msg_check("compiletest artifacts", self.target, None);
433-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
433+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
434434
}
435435
}
436436

@@ -504,7 +504,7 @@ fn run_tool_check_step(
504504
.with_prefix(&format!("{}-check", step_type_name.to_lowercase()));
505505

506506
let _guard = builder.msg_check(format!("{display_name} artifacts"), target, None);
507-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
507+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
508508
}
509509

510510
tool_check_step!(Rustdoc { path: "src/tools/rustdoc", alt_path: "src/librustdoc" });
@@ -589,6 +589,6 @@ impl Step for CoverageDump {
589589
&compiler.host,
590590
&target,
591591
);
592-
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], true, false);
592+
run_cargo(builder, cargo, builder.config.free_args.clone(), &stamp, vec![], false);
593593
}
594594
}

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ impl Step for Std {
168168
lint_args(builder, &self.config, IGNORED_RULES_FOR_STD_AND_RUSTC),
169169
&build_stamp::libstd_stamp(builder, compiler, target),
170170
vec![],
171-
true,
172171
false,
173172
);
174173
}
@@ -246,7 +245,6 @@ impl Step for Rustc {
246245
lint_args(builder, &self.config, IGNORED_RULES_FOR_STD_AND_RUSTC),
247246
&build_stamp::librustc_stamp(builder, compiler, target),
248247
vec![],
249-
true,
250248
false,
251249
);
252250
}
@@ -320,7 +318,6 @@ macro_rules! lint_any {
320318
lint_args(builder, &self.config, &[]),
321319
&stamp,
322320
vec![],
323-
true,
324321
false,
325322
);
326323
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ impl Step for Std {
295295
vec![],
296296
&build_stamp::libstd_stamp(builder, compiler, target),
297297
target_deps,
298-
self.is_for_mir_opt_tests, // is_check
299298
false,
300299
);
301300

@@ -609,6 +608,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
609608
features += "compiler-builtins-no-f16-f128 ";
610609
}
611610

611+
cargo.arg("-Zno-embed-metadata");
612+
612613
if builder.no_std(target) == Some(true) {
613614
features += " compiler-builtins-mem";
614615
if !target.starts_with("bpf") {
@@ -1154,7 +1155,6 @@ impl Step for Rustc {
11541155
vec![],
11551156
&stamp,
11561157
vec![],
1157-
false,
11581158
true, // Only ship rustc_driver.so and .rmeta files, not all intermediate .rlib files.
11591159
);
11601160

@@ -1208,6 +1208,7 @@ pub fn rustc_cargo(
12081208
.arg(builder.src.join("compiler/rustc/Cargo.toml"));
12091209

12101210
cargo.rustdocflag("-Zcrate-attr=warn(rust_2018_idioms)");
1211+
cargo.arg("-Zno-embed-metadata");
12111212

12121213
// If the rustc output is piped to e.g. `head -n1` we want the process to be killed, rather than
12131214
// having an error bubble up and cause a panic.
@@ -1691,7 +1692,7 @@ impl Step for CodegenBackend {
16911692
let tmp_stamp = BuildStamp::new(&out_dir).with_prefix("tmp");
16921693

16931694
let _guard = builder.msg_build(compiler, format_args!("codegen backend {backend}"), target);
1694-
let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false, false);
1695+
let files = run_cargo(builder, cargo, vec![], &tmp_stamp, vec![], false);
16951696
if builder.config.dry_run() {
16961697
return;
16971698
}
@@ -2341,7 +2342,6 @@ pub fn run_cargo(
23412342
tail_args: Vec<String>,
23422343
stamp: &BuildStamp,
23432344
additional_target_deps: Vec<(PathBuf, DependencyType)>,
2344-
is_check: bool,
23452345
rlib_only_metadata: bool,
23462346
) -> Vec<PathBuf> {
23472347
// `target_root_dir` looks like $dir/$target/release
@@ -2381,7 +2381,7 @@ pub fn run_cargo(
23812381
// Always keep native libraries, rust dylibs and debuginfo
23822382
keep = true;
23832383
}
2384-
if is_check && filename.ends_with(".rmeta") {
2384+
if filename.ends_with(".rmeta") {
23852385
// During check builds we need to keep crate metadata
23862386
keep = true;
23872387
} 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
@@ -2227,7 +2227,7 @@ impl BookTest {
22272227
let stamp = BuildStamp::new(&builder.cargo_out(compiler, mode, target))
22282228
.with_prefix(PathBuf::from(dep).file_name().and_then(|v| v.to_str()).unwrap());
22292229

2230-
let output_paths = run_cargo(builder, cargo, vec![], &stamp, vec![], false, false);
2230+
let output_paths = run_cargo(builder, cargo, vec![], &stamp, vec![], false);
22312231
let directories = output_paths
22322232
.into_iter()
22332233
.filter_map(|p| p.parent().map(ToOwned::to_owned))

0 commit comments

Comments
 (0)