Split ignoreException to avoid suppressing CTRL-C

This splits `ignoreException` into `ignoreExceptionExceptInterrupt`
(which ignores all exceptions except `Interrupt`, which indicates a
SIGINT/CTRL-C) and `ignoreExceptionInDestructor` (which ignores all
exceptions, so that destructors do not throw exceptions).

This prevents many cases where Nix ignores CTRL-C entirely.
See: https://github.com/NixOS/nix/issues/7245

Upstream-PR: https://github.com/NixOS/nix/pull/11618
Change-Id: Ie7d2467eedbe840d1b9fa2e88a4e88e4ab26a87b
This commit is contained in:
Robert Hensing
2024-10-01 15:49:56 -07:00
committed by Rebecca Turner
parent 7752927660
commit ee0c195eba
28 changed files with 76 additions and 43 deletions
+1 -1
View File
@@ -639,7 +639,7 @@ struct CmdDevelop : Common, MixEnvironment
throw Error("package 'nixpkgs#bashInteractive' does not provide a 'bin/bash'");
} catch (Error &) {
ignoreException();
ignoreExceptionExceptInterrupt();
}
// Override SHELL with the one chosen for this environment.