Rollup merge of #139894 - Kobzol:opt-dist-fixes, r=lqd

Fix `opt-dist` CLI flag and make it work without LLD

Suggested in 512456991.

r? `@jieyouxu`
This commit is contained in:
Matthias Krüger 2025-04-17 00:16:23 +02:00 committed by GitHub
commit 848ec5888f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -76,7 +76,7 @@ enum EnvironmentCmd {
rustc_perf_checkout_dir: Option<Utf8PathBuf>,
/// Is LLVM for `rustc` built in shared library mode?
#[arg(long, default_value_t = true)]
#[arg(long, default_value_t = true, action(clap::ArgAction::Set))]
llvm_shared: bool,
/// Should BOLT optimization be used? If yes, host LLVM must have BOLT binaries

View file

@ -36,7 +36,9 @@ pub fn clear_llvm_files(env: &Environment) -> anyhow::Result<()> {
// directories ourselves.
log::info!("Clearing LLVM build files");
delete_directory(&env.build_artifacts().join("llvm"))?;
delete_directory(&env.build_artifacts().join("lld"))?;
if env.build_artifacts().join("lld").is_dir() {
delete_directory(&env.build_artifacts().join("lld"))?;
}
Ok(())
}