Skip to content

Shake cmd does not deal with async exceptions #538

@facundominguez

Description

@facundominguez

The following program terminates when the action for a produces a failure, without waiting for action b to finish. Shouldn't shake wait until b completes?

$ cat test.hs
import Control.Concurrent
import Development.Shake
import System.Environment

main = withArgs ["-j"] $ shakeArgs shakeOptions $ do
    want ["a", "b"]
    "a" %> \_out -> do
      liftIO $ threadDelay (100 * 1000)
      fail "ugh"
    "b" %> \_out ->
      cmd Shell "sleep 3 && echo hello"

$ ghc-8.0.2 --make -threaded test.hs
[1 of 1] Compiling Main             ( test.hs, test.o )
Linking test ...
$ ./test
# sleep (for b)
Error when running Shake build system:
* a
ugh

$ hello

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions