Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Parallel cabal install loses compiler warnings. #1679

Closed
yav opened this Issue · 5 comments

4 participants

Iavor S. Diatchki Duncan Coutts Brent Yorgey Mikhail Glushenkov
Iavor S. Diatchki

When building in parallel, cabal loses the warnings generated by the compiler.

Here is an example, to illustrate the problem. First, we build a package using just a single instance of Cabal:

 > cabal install -j1
 Resolving dependencies...

 (... truncated cabal chatter ..)

Building cab-0.1.0.0...
Preprocessing library cab-0.1.0.0...
 [1 of 1] Compiling A                ( A.hs, dist/build/A.o ) 

A.hs:5:1: Warning:
    Top-level binding with no type signature: a :: Integer

In-place registering cab-0.1.0.0...
 Installing library in
 /home/diatchki/.cabal/lib/x86_64-linux-ghc-7.6.3/cab-0.1.0.0
Registering cab-0.1.0.0...
Installed cab-0.1.0.0

Building the program contains a warning. Next we clean the package and rebuild, this time in parallel:

> cabal install -j2
Resolving dependencies...
In order, the following will be installed:
cab-0.1.0.0 (latest: 0.2.7) (reinstall)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring cab-0.1.0.0...
Building cab-0.1.0.0...
Installed cab-0.1.0.0

So far so good. Let's see what actually happened during compilation:

> cat ~/.cabal/logs/cab-0.1.0.0.log 
Installing library in
/home/diatchki/.cabal/lib/x86_64-linux-ghc-7.6.3/cab-0.1.0.0
Registering cab-0.1.0.0...

The warnings have been lost: they were not shown during the build process, and they are not in the log file.

This report is for this version of Cabal:

cabal-install version 1.18.0.2
using version 1.18.1 of the Cabal library 
Duncan Coutts
Collaborator

So clearly they should appear in the log file, and at a minimum we should also get an indication on the console that there were in fact warnings. May also want to look at whether we can dump warnings to the console at an appropriate point, much like we do with the tail end of log files on error.

Brent Yorgey
Collaborator

I have noticed that after successfully building a package, the log file gets cleared out and then the result of installing it get written in the log. So I'm guessing that the warning did appear in the log file, but then got overwritten once the package was finished building. It would be nice if the logs didn't get overwritten like this.

Mikhail Glushenkov
Collaborator

@byorgey

I have noticed that after successfully building a package, the log file gets cleared out and then the result of installing it get written in the log.

IIRC that was fixed some time ago.

@yav @dcoutts

I suspect that this issue is fixed in HEAD.

Mikhail Glushenkov
Collaborator

Related: #1062

Mikhail Glushenkov
Collaborator

Verified that this is fixed in HEAD:

$ cabal install -j2 cab
$ grep Warning .cabal-sandbox/logs/*.log | wc -l
5
Mikhail Glushenkov 23Skidoo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.