Description
Describe the bug
When investigating the failure of the cabal-install-3.6
release CI pipeline on ARMv7, I noticed that cabal-install
eats useful output from GHC upon failure. Specifically, the CI log ends with:
Completed edit-distance-0.2.2.1 (lib)
Installing HTTP-4000.3.16 (lib)
Completed HTTP-4000.3.16 (lib)
cabal: Failed to build Cabal-3.6.2.0 (which is required by exe:cabal from
cabal-install-3.6.2.0). The build process terminated with exit code 251
What went wrong? It's not at all clear from this error and if I didn't happen to stumble upon the fact that code 251 is GHC's exit code on heap overflow I wouldn't have known myself.
Looking at $CABAL_DIR/logs/ghc-8.10.7/Cabal-3.6.2.0-aa3b9fb077a93a7005de5308fb10da5d3f4036f77770639c1dad2871dc1f6799.log
removes any doubt:
[177 of 247] Compiling Distribution.Simple.Program.Db ( src/Distribution/Simple/Program/Db.hs, dist/build/Distribution/Simple/Program/Db.o, dist/build/Distribution/Simple/Program/Db.dyn_o )
[178 of 247] Compiling Distribution.Simple.Program ( src/Distribution/Simple/Program.hs, dist/build/Distribution/Simple/Program.o, dist/build/Distribution/Simple/Program.dyn_o )
[179 of 247] Compiling Distribution.Simple.Program.Strip ( src/Distribution/Simple/Program/Strip.hs, dist/build/Distribution/Simple/Program/Strip.o, dist/build/Distribution/Simple/Program/Strip.dyn_o )
[180 of 247] Compiling Distribution.Simple.Command ( src/Distribution/Simple/Command.hs, dist/build/Distribution/Simple/Command.o, dist/build/Distribution/Simple/Command.dyn_o )
[181 of 247] Compiling Distribution.Simple.Setup ( src/Distribution/Simple/Setup.hs, dist/build/Distribution/Simple/Setup.o, dist/build/Distribution/Simple/Setup.dyn_o )
ghc: out of memory (requested 2097152 bytes)
This output should have been reported to the user.
To Reproduce
Steps to reproduce the behavior:
Run a build that fails. Observe that the error is less than helpful
Expected behavior
The error output from GHC is passed on to the user.
System information
- Operating system: Linux/ARMv7
cabal-install-3.4.0.0
,ghc-8.10.7
Additional context
Add any other context about the problem here.