haskell / haskell/cabal

If there is a ghc parse error, sometimes cabal doesn't return an error

Open
#1,892 2 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I noticed this the other day at work, but I haven't had a chance to investigate it yet. This is a ticket to remind someone (or myself in a few weeks) to do so.

Basically, I had a script like this I was calling to save time:

```
cabal configure && cabal build && ./dist/some/path/foo args
```

This worked fine on type errors. `cabal configure` would pass, `cabal build` would fail and the old version of `foo` would never run. _However_, if I introduced a parse error into the source tree, I would get the errors from `cabal build` spewed to the terminal but `foo` would still run directly afterwards (`&&` wasn't short circuiting...)

The cause is most likely that cabal is not returning an error code to the shell when GHC has a parse error. Or something. Could it even be a ghc bug?

Contributor guide

Open the contributing guide

Research direction

Reproduce the reported command chain, `cabal configure && cabal build && ./dist/some/path/foo args`, using both a type error and a parse error. Check the exit status from `cabal build` and determine whether Cabal or GHC is responsible; done means a parse error prevents the following command from running.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, shell
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.