Skip to content

Commit 14017fc

Browse files
committed
Pass -Zno-embed-metadata in run_cargo
1 parent b6605c3 commit 14017fc

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,7 @@ pub enum ArtifactKeepMode {
26612661

26622662
pub fn run_cargo(
26632663
builder: &Builder<'_>,
2664-
cargo: Cargo,
2664+
mut cargo: Cargo,
26652665
tail_args: Vec<String>,
26662666
stamp: &BuildStamp,
26672667
additional_target_deps: Vec<(PathBuf, DependencyType)>,
@@ -2679,6 +2679,16 @@ pub fn run_cargo(
26792679
.unwrap() // chop off `$target`
26802680
.join(target_root_dir.file_name().unwrap());
26812681

2682+
match artifact_keep_mode {
2683+
ArtifactKeepMode::OnlyDylib
2684+
| ArtifactKeepMode::OnlyRmeta
2685+
| ArtifactKeepMode::BothRlibAndRmeta
2686+
| ArtifactKeepMode::Custom(_) => {
2687+
cargo.arg("-Zno-embed-metadata");
2688+
}
2689+
ArtifactKeepMode::OnlyRlib => {}
2690+
}
2691+
26822692
// Spawn Cargo slurping up its JSON output. We'll start building up the
26832693
// `deps` array of all files it generated along with a `toplevel` array of
26842694
// files we need to probe for later.

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,10 +1095,6 @@ impl Builder<'_> {
10951095
// Enable usage of unstable features
10961096
cargo.env("RUSTC_BOOTSTRAP", "1");
10971097

1098-
if matches!(mode, Mode::Std | Mode::Rustc | Mode::Codegen) {
1099-
cargo.arg("-Zno-embed-metadata");
1100-
}
1101-
11021098
if self.config.dump_bootstrap_shims {
11031099
prepare_behaviour_dump_dir(self.build);
11041100

0 commit comments

Comments
 (0)