Skip to content

Commit 848ec58

Browse files
authored
Rollup merge of #139894 - Kobzol:opt-dist-fixes, r=lqd
Fix `opt-dist` CLI flag and make it work without LLD Suggested in https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/experiment.20with.20.60opt-dist.20local.60.20in.20MSYS2/with/512456991. r? `@jieyouxu`
2 parents afb60d3 + 6f386e7 commit 848ec58

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/tools/opt-dist/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ enum EnvironmentCmd {
7676
rustc_perf_checkout_dir: Option<Utf8PathBuf>,
7777

7878
/// Is LLVM for `rustc` built in shared library mode?
79-
#[arg(long, default_value_t = true)]
79+
#[arg(long, default_value_t = true, action(clap::ArgAction::Set))]
8080
llvm_shared: bool,
8181

8282
/// Should BOLT optimization be used? If yes, host LLVM must have BOLT binaries

src/tools/opt-dist/src/utils/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ pub fn clear_llvm_files(env: &Environment) -> anyhow::Result<()> {
3636
// directories ourselves.
3737
log::info!("Clearing LLVM build files");
3838
delete_directory(&env.build_artifacts().join("llvm"))?;
39-
delete_directory(&env.build_artifacts().join("lld"))?;
39+
if env.build_artifacts().join("lld").is_dir() {
40+
delete_directory(&env.build_artifacts().join("lld"))?;
41+
}
4042
Ok(())
4143
}
4244

0 commit comments

Comments
 (0)