]> git.lizzy.rs Git - rust.git/commitdiff
Only disable dialogs on CI.
authorEric Huss <eric@huss.org>
Thu, 3 Feb 2022 15:03:44 +0000 (07:03 -0800)
committerEric Huss <eric@huss.org>
Thu, 3 Feb 2022 15:03:44 +0000 (07:03 -0800)
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.

compiler/rustc_codegen_llvm/src/llvm_util.rs

index 437f9a9e4cce082b792f3497e475b5489b003a80..f91fad2d9c9635b796069fec0e32ab3820eb0486 100644 (file)
@@ -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("")