Adding loading indicators to the build command
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
I have been asked for some time now if `cabal build` could display loading indicators like other project managers do.
The ideal would be to have such a result:
```
❯ cabal build Cabal
Build profile: -w ghc-9.4.4 -O1
In order, the following will be built (use -v for more details):
- Cabal-syntax-3.11.0.0 (lib) (first run)
- Cabal-3.11.0.0 (lib) (first run)
Configuring library for Cabal-syntax-3.11.0.0..
Preprocessing library for Cabal-syntax-3.11.0.0..
Building library for Cabal-syntax-3.11.0.0..
[ 1 of 137] Compiling Distribution.Compat.Binary ( src/Distribution/Compat/Binary.hs, /home/hecate/Contrib/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.4/Cabal-syntax-3.11.0.0/build/Distribution/Compat/Binary.o, /home/hecate/Contrib/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.4/Cabal-syntax-3.11.0.0/build/Distribution/Compat/Binary.dyn_o )
[ 2 of 137] Compiling Distribution.Compat.Exception ( src/Distribution/Compat/Exception.hs, /home/hecate/Contrib/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.4/Cabal-syntax-3.11.0.0/build/Distribution/Compat/Exception.o, /home/hecate/Contrib/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.4/Cabal-syntax-3.11.0.0/build/Distribution/Compat/Exception.dyn_o )
[ 3 of 137] Compiling Distribution.Compat.MonadFail ( src/Distribution/Compat/MonadFail.hs, /home/hecate/Contrib/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.4/Cabal-syntax-3.11.0.0/build/Distribution/Compat/MonadFail.o, /home/hecate/Contrib/cabal/dist-newstyle/build/x86_64-linux/ghc-9.4.4/Cabal-syntax-3.11.0.0/build/Distribution/Compat/MonadFail.dyn_o )
Progress: [ 2%] [##..................................................................................................]
```
Personally I think it would be a nice breeze of fresh air, and perhaps also the opportunity to declutter the default output. The current output could be still made available if the terminal declares not to support ANSI or be "tty".
---
## Implementation
There is a library that implements such spinners ([spin](https://github.com/alexanderGugel/spin)) which we can easily vendor since it's quite stable and very small.
Contributor guide
Assessment
This issue has not been assessed yet.