cabal-install suppresses errors when asked to build extra-packages
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
Apparently, if cabal is asked to build a package listed in `extra-packages` and the package fails with compiler errors, no error is printed to stderr.
To reproduce, create this minimal `cabal.project` file in an empty folder.
```
allow-newer:
*:*
extra-packages: bytestring-show-0.3.5.6
```
Now build with a sufficiently recent compiler
```
$ nix-shell -p haskell.compiler.ghc925 --run "cabal v2-build bytestring-show"
Warning: There are no packages or optional-packages in the project
Resolving dependencies...
Build profile: -w ghc-9.2.5 -O1
In order, the following will be built (use -v for more details):
- bytestring-show-0.3.5.6 (lib:bytestring-show) (requires build)
Starting bytestring-show-0.3.5.6 (all, legacy fallback)
Building bytestring-show-0.3.5.6 (all, legacy fallback)
$ echo $?
1
$ nix-shell -p haskell.compiler.ghc925 --run "cabal v2-build -v bytestring-show"
...
Redirecting build log to {handle:
.../.cabal/logs/ghc-9.2.5/bytestring-show-0.3.5.6-dbe534bc8e71b94be62f196e80dd86d861c5bd959e0576f990401ab7423b16b9.log}
$ tail ...23b16b9.log
Text/Show/ByteString/Util.hs:64:37: error:
• Couldn't match expected type ‘Word8#’ with actual type ‘Word#’
• In the first argument of ‘W8#’, namely
‘(w# `plusWord#` int2Word# 48#)’
In the first argument of ‘putWord8’, namely
‘(W8# (w# `plusWord#` int2Word# 48#))’
In the expression: putWord8 (W8# (w# `plusWord#` int2Word# 48#))
|
64 | unsafePutDigit# w# = putWord8 (W8# (w# `plusWord#` int2Word# 48#))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
```
$ cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
```
I would expect the compiler errors to be printed to stderr.
Contributor guide
Assessment
This issue has not been assessed yet.