Skip to content

Commit

Permalink
Only disable dialogs on CI.
Browse files Browse the repository at this point in the history
The "CI" environment var isn't universal (for example, I think Azure
uses TF_BUILD). However, we are mostly concerned with rust-lang/rust's
own CI which currently is GitHub Actions which does set "CI". And I
think most other providers use "CI" as well.
  • Loading branch information
ehuss committed Feb 3, 2022
1 parent e1eff1b commit c64d6bf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ unsafe fn configure_llvm(sess: &Session) {
let mut llvm_args = Vec::with_capacity(n_args + 1);

llvm::LLVMRustInstallFatalErrorHandler();
llvm::LLVMRustDisableSystemDialogsOnCrash();
// On Windows, an LLVM assertion will open an Abort/Retry/Ignore dialog
// box for the purpose of launching a debugger. However, on CI this will
// cause it to hang until it times out, which can take several hours.
if std::env::var_os("CI").is_some() {
llvm::LLVMRustDisableSystemDialogsOnCrash();
}

fn llvm_arg_to_arg_name(full_arg: &str) -> &str {
full_arg.trim().split(|c: char| c == '=' || c.is_whitespace()).next().unwrap_or("")
Expand Down

0 comments on commit c64d6bf

Please sign in to comment.