Regression: no output during build step for Cabal scripts in 3.8
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
I don't see anything about this in [the changelog](https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.8.1.0.md).
`Main.hs`:
```hs
{- cabal:
build-depends: base
-}
module Main where
main = putStrLn "done"
```
```
$ cabal-3.6.2.0 run Main.hs
Resolving dependencies...
Build profile: -w ghc-9.2.3 -O1
In order, the following will be built (use -v for more details):
- fake-package-0 (exe:script) (first run)
Configuring executable 'script' for fake-package-0..
Preprocessing executable 'script' for fake-package-0..
Building executable 'script' for fake-package-0..
[1 of 1] Compiling Main ( Main.hs, /tmp/cabal-repl.-223388/dist-newstyle/build/x86_64-linux/ghc-9.2.3/fake-package-0/x/script/build/script/script-tmp/Main.o )
Linking /tmp/cabal-repl.-223388/dist-newstyle/build/x86_64-linux/ghc-9.2.3/fake-package-0/x/script/build/script/script ...
done
```
```
$ cabal-3.8.1.0 run Main.hs
done
```
This is great when nothing needs to be rebuilt (an impossible scenario before 3.8, as nothing was cached). And we do see some output if building fails. But I'd argue that it's very confusing not to see any during a successful build either. At least in the case where significant building of dependencies is necessary, it's impossible to know whether the script is hanging at run time, or useful work is being done.
It seems to me that the ideal behaviour would be for any output from the build step to go to `stderr` by default, perhaps with flags to alter behaviour.
Contributor guide
Assessment
This issue has not been assessed yet.