A question about ghc-cabal
Manuel M T Chakravarty
chak at cse.unsw.edu.au
Fri Jan 21 01:13:42 CET 2011
Simon Marlow:
> On 20/01/2011 10:00, Manuel M T Chakravarty wrote:
>> Simon Marlow:
>>> On 20/01/2011 08:18, Roman Leshchinskiy wrote:
>>>> On 20/01/2011, at 06:42, Manuel M T Chakravarty wrote:
>>>>
>>>>> After some changes to GHC's handling of DPH packages, I'm
>>>>> currently fighting with the build system. In particular, I'm
>>>>> getting
>>>>>
>>>>>> "inplace/bin/ghc-cabal" configure
>>>>>> --with-ghc="/Users/chak/Code/ghc-test/inplace/bin/ghc-stage1"
>>>>>>
>>>>>>
> --with-ghc-pkg="/Users/chak/Code/ghc-test/inplace/bin/ghc-pkg"
>>>>>> --with-gcc="/usr/bin/gcc"
>>>>>> --configure-option=--with-cc="/usr/bin/gcc"
>>>>>> --flag=include-ghc-prim --enable-shared
>>>>>> --enable-library-for-ghci
>>>>>> --with-hscolour="/Users/chak/bin/HsColour"
>>>>>> --configure-option=CFLAGS="-Wall -march=i686 -m32 -isysroot
>>>>>> /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
>>>>>> -fno-stack-protector " --configure-option=LDFLAGS="
>>>>>> -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk
>>>>>> -mmacosx-version-min=10.5 " --configure-option=CPPFLAGS="
>>>>>> -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk
>>>>>> -mmacosx-version-min=10.5 " -fdph-this -- dist-install
>>>>>> libraries/ghc-prim Configuring ghc-prim-0.2.0.0...<command
>>>>>> line>: the dph-par package is not installed. To install it:
>>>>>> "cabal install dph".
>>>>
>>>> This looks wrong to me. It shouldn't be passing -fdph-this
>>>> (that's only for dph-seq and dph-par)
>>>
>>> Right.
>>
>> The --dph-this shouldn't be there in the configure options, but it
>> needs to be passed to this invocation to GHC (that it isn't passed is
>> actually the reason for the error). Why? If DPH is installed,
>> -fdph-par is now the default. Unfortunately, during the build
>> process, the package DB is populated with packages at a time where
>> they are not yet available. (Hence, GHC believes that dph-par is
>> available, though it isn't yet.) The simplest solution to working
>> around this arguably inconsistent state of the package DB during the
>> build is to pass -fdph-this to GHC.
>>
>> Hence my original question: how (and why) is GHC called in this
>> invocation to ghc-cabal? Any ideas?
>
> ghc-cabal is a wrapper around "cabal configure": it pokes around your system to find the various versions of things and other parameters. ghc-cabal doesn't actually do any of this itself, it just calls the Cabal library with various options, and Cabal does the configuration. One of the things it does is run GHC to find the version and which extensions are supported.
>
> Until recently we used a dummy-ghc program that only supported --version and --supported-extensions, but now we wait until the stage1 compiler is built and use that instead.
If I understand you correctly, you are saying that the invocation of the stage1 compiler is by the Cabal library code. I'll look at that.
Thanks,
Manuel
More information about the Cvs-ghc
mailing list