Circular dependency between the compiler and TH?

Pepe Iborra mnislaih at gmail.com
Sat Aug 19 15:46:02 EDT 2006


Joel, I feel your pain.
In my (very short) experience, the ghc build system can be fragile  
and impredictable some times. Randomly, it will decide to do a stage2  
build in stage1, and this is clearly your case today Joel.

The issue with indices and bounds is an actual issue, but can be  
solved easily by manually editing the affected file and fully  
qualifying the usages of said functions. That if it has not been  
fixed already.

The issues with pkgString and NameG in Convert are due to building  
Convert.hs in stage1. In my system Convert.hs gets included in stage2  
only. I am building ghc-6.5 head with all the patches. Since I am on  
Mac Intel too and bootstraping ghc-6.5 with the ghc-65 build from  
audreyT, I can assure you that there is nothing inherently wrong in  
this setup that prevents the current ghc-65 from building.

Make sure that you have pulled the patches in all the libraries  
repositories too. If those get out of sync, ghc-65 will probably fail  
to build. Do a './darcs-all pull' always instead of a simple darcs pull.

Finally, I recommend the brute force combo: ' make distclean ;  
autoreconf ; ./configure ; make -j2 '
If after that you see -DGHCI -DBREAKPOINT in your stage1 build,  
that's bad.

Cheers
pepe

On 19/08/2006, at 20:56, Joel Reymont wrote:

>
> On Aug 19, 2006, at 7:30 PM, Simon Peyton-Jones wrote:
>> I can't tell just what you are doing, but somehow you seem to be
>> building a stage-2 compiler in stage1.
>>
>
>
> Well, I'm on Mac Intel so I can only build ghc 6.5 using ghc 6.5.  
> The one in /usr/local was built a few weeks ago and worked at the  
> time. It's more than just the indices issue, this one can be solved  
> by unpulling the patch.
>
> There are other issues with TH.Syntax.pkgString which I don't have  
> in /usr/local and there are issues with another bit of TH. I don't  
> think I'm doing anything wrong. I think it's a stage1 compiler too.
>
> /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/ghci -Istage1 -DGHCI -DBREAKPOINT -package template-haskell  
> -threaded -package readline -DUSE_READLINE -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 hsSyn/ 
> Convert.lhs -o stage1/hsSyn/Convert.o  -ohi stage1/hsSyn/Convert.hi
> /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/ghci -Istage1 -DGHCI -DBREAKPOINT -package template-haskell  
> -threaded -package readline -DUSE_READLINE -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 typecheck/ 
> TcMType.lhs -o stage1/typecheck/TcMType.o  -ohi stage1/typecheck/ 
> TcMType.hi
> /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/ghci -Istage1 -DGHCI -DBREAKPOINT -package template-haskell  
> -threaded -package readline -DUSE_READLINE -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 main/ 
> TidyPgm.lhs -o stage1/main/TidyPgm.o  -ohi stage1/main/TidyPgm.hi
>
> hsSyn/Convert.lhs:625:32: Not in scope: `TH.pkgString'
> <<ghc: 49771588 bytes, 8 GCs, 2578002/5045464 avg/max bytes  
> residency (2 samples), 18M in use, 0.00 INIT (0.00 elapsed), 0.10  
> MUT (0.27 elapsed), 0.08 GC (0.13 elapsed) :ghc>>
>
> So I fix this line to use unpackPS instead of pkgString, after  
> adjusting imports:
>
> mk_pkg pkg = stringToPackageId (TH.pkgString pkg)
>
> Now I get:
>
> hsSyn/Convert.lhs:574:23:
>     Constructor `NameG' should have 2 arguments, but has been given 3
>     In the pattern: NameG th_ns pkg mod
>     In the definition of `thRdrName':
>         thRdrName ctxt_ns occ (NameG th_ns pkg mod)
>                     = (mkOrig $! (mkModule (mk_pkg pkg) (mk_mod mod)))
>                       $! (mk_occ (mk_ghc_ns th_ns) occ)
>
>
> --
> http://wagerlabs.com/
>
>
>
>
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



More information about the Glasgow-haskell-users mailing list