#2169: Compilation fails first time without giving an error, later succeeds
without changing code
----------------------+-----------------------------------------------------
 Reporter:  nccb      |          Owner:                
     Type:  bug       |         Status:  new           
 Priority:  normal    |      Milestone:  6.8.3         
Component:  Compiler  |        Version:  6.8.2         
 Severity:  normal    |     Resolution:                
 Keywords:            |     Difficulty:  Unknown       
 Testcase:            |   Architecture:  x86_64 (amd64)
       Os:  Linux     |  
----------------------+-----------------------------------------------------
Comment (by nccb):

 I'm having real trouble slimming down the testcase.  If I remove modules
 from the build process, the error goes away.  If I remove some functions,
 it also disappears.  Here is what I am fairly certain of:

 * Options in an OPTIONS_GHC pragma in data/OrdAST.hs are being applied to
 flow/FlowGraph.hs, as long as it is the next module in the build process
 for --make.

 * The error occurs even though flow/FlowGraph.hs doesn't even import
 data/OrdAST.hs

 * The error always occurs if you add a function (and thus change the
 automatically-determined export list) in a module they both depend on,
 such as common/Utils.hs and recompile

 * The error can occur even when data/OrdAST.hs is not recompiled
 (presumably it is still scanned for the module dependencies)

 * The error seems to disappear when data/OrdAST.hs exports a function; the
 error only occurs when data/OrdAST.hs exports nothing at all, or exports
 only type-class instances (for types not in its view).

 * Removing module imports from Main that are normally compiled before
 data/OrdAST.hs and flow/FlowGraph.hs, and that are directly impored by
 neither, can make the error go away.

 * The error seems to only occur if both modules import *qualified* AST,
 but as different things (e.g. import qualified AST, versus import
 qualified AST as A).  I think every other module in the code imports AST
 as A, so that may be a bit of a confounding factor too.

 * If I move all the modules from their subdirectories into the main
 directory, the problem disappears

 I had suspected the problem was to do with the orphan instance
 declarations in data/OrdAST.hs but the error seems to occur even with the
 instance declarations removed.  My best guess now is that the problem is
 somehow to do with the qualified imports, not exporting anything, the
 OPTIONS_GHC pragma and seems to be very specific to the build order.

 I've attached the tarball.  Extract the files and run "sh compile.sh".  If
 that doesn't produce the error immediately, let the compilation finish and
 then in common/Utils.hs, uncomment/comment (it's the toggling that does
 it) the two "foo" lines near the top of the file.   Then re-run
 compile.sh.  On my machine this will then produce the problem every time.
 If you re-run compile.sh until compilation succeeds, you can then toggle
 the lines in common/Utils.hs again to produce the problem again.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2169#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to