Closed bgamari closed 2 years ago
I am validating this in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/7722.
Better yet, instead of exec
, apply this patch:
diff --git a/tests/process011.hs b/tests/process011.hs
index 83e2030..b711fe4 100644
--- a/tests/process011.hs
+++ b/tests/process011.hs
@@ -15,7 +15,7 @@ main = do
-- shell kills itself with SIGINT,
-- delegation off, exit code (death by signal) reported as normal
do let script = "./process011_c"
- (_,_,_,p) <- createProcess (shell script) { delegate_ctlc = False }
+ (_,_,_,p) <- createProcess (proc script []) { delegate_ctlc = False }
waitForProcess p >>= print
putStrLn "===================== test 2"
@@ -23,7 +23,7 @@ main = do
-- shell kills itself with SIGINT,
-- delegation on, so expect to throw UserInterrupt
do let script = "./process011_c"
- (_,_,_,p) <- createProcess (shell script) { delegate_ctlc = True }
+ (_,_,_,p) <- createProcess (proc script []) { delegate_ctlc = True }
(waitForProcess p >>= print)
`catchUserInterrupt` \e -> putStrLn $ "caught: " ++ show e
Thanks @blackgnezdo !
The refactor of
process011
performed in 8cd7e04, where the test is taught to usepython3
instead ofsh
, has broken the test on Debian 10. Specifically, for reasons that I don't yet understand,python3
exits with code 1 not code 2 when killing itself with signal 2. Strangely, my tests on other distributions (e.g. NixOS) suggest that Python's behavior in this case is rather inconsistent.To avoid this, we now rather use a dedicated C program instead of Python.
Fixes #241.