Skip to content

Commit

Permalink
WIP: Non-zero windows exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo committed Sep 1, 2024
1 parent 4aade2d commit 4e7c1d9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cabal-testsuite/src/Test/Cabal/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Foreign.C.Error (Errno (..), ePIPE)

import qualified GHC.IO.Exception as GHC

import Distribution.System
import Distribution.Verbosity

import System.Process.Internals
Expand Down Expand Up @@ -306,7 +307,13 @@ stopServer s = do
-- will actually die, and then hClose will fail because
-- the ":quit" command was buffered up but never got
-- flushed.
interruptProcessGroupOf (serverProcessHandle s)
--
-- On the "happy path" which is this soft killer, interrupting the
-- process on Windows would be an actual abortion of the program,
-- with a non-zero exit-code. Not doing this on Windows ensures that
-- the "happy path" if chosen, would exit with exit-code zero.
when (not (buildOS == Windows)) $

Check warning on line 315 in cabal-testsuite/src/Test/Cabal/Server.hs

View workflow job for this annotation

GitHub Actions / hlint

Warning in stopServer in module Test.Cabal.Server: Use /= ▫︎ Found: "not (buildOS == Windows)" ▫︎ Perhaps: "buildOS /= Windows" ▫︎ Note: incorrect if either value is NaN
interruptProcessGroupOf (serverProcessHandle s)

log ServerMeta s $ "Waiting..."
-- Close input BEFORE waiting, close output AFTER waiting.
Expand Down

0 comments on commit 4e7c1d9

Please sign in to comment.