Circular dependency between the compiler and TH?

Simon Marlow simonmarhaskell at gmail.com
Mon Aug 21 12:03:41 EDT 2006


Joel Reymont wrote:
> 
> On Aug 21, 2006, at 4:10 PM, Simon Marlow wrote:
> 
>> GHC is trying to build GHCI in stage 1, because it thinks you have  a 
>> compatible compiler.  In fact, you have a slightly older 6.5  
>> installed.  However (as I think I mentioned before) we don't  
>> officially support building GHC using a random snapshot, because it  
>> would be impractical to do so.
> 
> 
> I'm not sure I understand this. How do you guys work then? Do you  
> always build ghc 6.5 using ghc 6.4?

Sure.

> What about the time-honored technique of bootstrapping using yourself?

You can do that of course, but it has to be the *exact same compiler*.  That is, 
not one you built from last week's sources.  It's just not practical to support 
building GHC with any GHC that existed at any point in the past, we'd have 
#ifdefs up the wazoo and a testing nightmare.

>> As a workaround, you can 'make GhcWithInterpreter=NO' in compiler/  
>> when building stage 1.
> 
> Still doesn't build after make clean in compiler and then a no-ghci  make:
> 
> /usr/local/bin/ghc -H16m -O  -istage1/utils  -istage1/basicTypes  - 
> istage1/types  -istage1/hsSyn  -istage1/prelude  -istage1/rename  - 
> istage1/typecheck  -istage1/deSugar  -istage1/coreSyn  -istage1/ 
> specialise  -istage1/simplCore  -istage1/stranal  -istage1/stgSyn  - 
> istage1/simplStg  -istage1/codeGen  -istage1/main  -istage1/ profiling  
> -istage1/parser  -istage1/cprAnalysis  -istage1/ ndpFlatten  
> -istage1/iface  -istage1/cmm  -istage1/nativeGen -Istage1  -cpp 
> -fglasgow-exts -fno-generics -Rghc-timing -I. -IcodeGen - InativeGen 
> -Iparser -package unix -ignore-package lang -recomp -Rghc- timing  -H16M 
> '-#include "cutils.h"' -i../compat -ignore-package  Cabal    -c 
> ghci/ByteCodeAsm.lhs -o stage1/ghci/ByteCodeAsm.o  -ohi  
> stage1/ghci/ByteCodeAsm.hi
> 
> ghci/ByteCodeAsm.lhs:20:0:
>     Failed to load interface for `ByteCodeInstr':
>         Could not find module `ByteCodeInstr':
>           use -v to see a list of the files searched for
> <<ghc: 23420660 bytes, 4 GCs, 111664/111664 avg/max bytes residency  (1 
> samples), 16M in use, 0.00 INIT (0.00 elapsed), 0.04 MUT (0.15  
> elapsed), 0.02 GC (0.03 elapsed) :ghc>>

It's still trying to build part of GHCi.  Try cleaning harder (make distclean), 
or just start with a fresh tree.  Also I just fixed compiler/Makefile so it 
won't try to build GHCi in stage1, even if it thinks you are bootstrapping with 
the same GHC version.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list