Refactor setupMessage use in Cabal library.
I noticed that I was repeatedly writing the same code
to print out more elaborate information when we do builds,
so I refactored it all into one place. In the process,
I think that I have made the build output more generally
useful.
The key changes:
- There is a new function setupMessage' which takes in
more information than the conventional setupMessage
does, and prints a more informative message: whereas
setupMessage will only tell you about the package
it is being run in, setupMessage' will also tell
you about the component and instantiation.
- I applied this function to applicable sites, in some
cases moving around messages to be closer to the place
where an actual operation takes place. For example,
the 'Building' message previously only was triggered
at the beginning of the build process; now it is
emitted immediately before we call out to GHC. This
is a lot more informative, and avoids people thinking
that we are slow because of preprocessing (we're not.)
Something similar happened for Haddock as well.
Before:
Preprocessing library 'spider' for reflex-backpack-0.5.0..
[1 of 1] Compiling Reflex.Spider.Backpack ( src/Reflex/Spider/Backpack.hs, /srv/code/reflex-backpack/dist-newstyle/build/x86_64-linux/ghc-8.1.20170123/reflex-backpack-0.5.0/c/spider/build/spider/Reflex/Spider/Backpack.o )
After:
Preprocessing library 'host' for reflex-backpack-0.5.0..
Building library 'host' instantiated with
Reflex.Host.Sig = reflex-backpack-0.5.0-inplace-spider:Reflex.Spider.Backpack
Reflex.Sig = reflex-backpack-0.5.0-inplace-spider:Reflex.Spider.Backpack
for reflex-backpack-0.5.0..
[1 of 8] Compiling Reflex.Host.Sig[sig] ( host/Reflex/Host/Sig.hsig, /srv/code/reflex-backpack/dist-newstyle/build/x86_64-linux/ghc-8.1.20170123/reflex-backpack-0.5.0/c/host/reflex-backpack-0.5.0-inplace-host+FDoWUmUc0MMBtBRwItgjj9/build/reflex-backpack-0.5.0-inplace-host+FDoWUmUc0MMBtBRwItgjj9/Reflex/Host/Sig.o ) [Reflex.Basics changed]
Signed-off-by:
Edward Z. Yang <ezyang@cs.stanford.edu>
Showing
- Cabal/Cabal.cabal 1 addition, 0 deletionsCabal/Cabal.cabal
- Cabal/Distribution/Backpack/DescribeUnitId.hs 61 additions, 0 deletionsCabal/Distribution/Backpack/DescribeUnitId.hs
- Cabal/Distribution/Simple/Build.hs 14 additions, 8 deletionsCabal/Distribution/Simple/Build.hs
- Cabal/Distribution/Simple/Configure.hs 4 additions, 10 deletionsCabal/Distribution/Simple/Configure.hs
- Cabal/Distribution/Simple/Haddock.hs 13 additions, 4 deletionsCabal/Distribution/Simple/Haddock.hs
- Cabal/Distribution/Simple/PreProcess.hs 10 additions, 10 deletionsCabal/Distribution/Simple/PreProcess.hs
- Cabal/Distribution/Simple/Register.hs 7 additions, 3 deletionsCabal/Distribution/Simple/Register.hs
- Cabal/Distribution/Simple/Utils.hs 1 addition, 1 deletionCabal/Distribution/Simple/Utils.hs
- Cabal/Distribution/Types/ComponentLocalBuildInfo.hs 6 additions, 0 deletionsCabal/Distribution/Types/ComponentLocalBuildInfo.hs
- Cabal/Distribution/Types/ComponentName.hs 7 additions, 0 deletionsCabal/Distribution/Types/ComponentName.hs
Loading
Please register or sign in to comment