[Haskell-cafe] ANN: json-0.4.1

Sigbjorn Finne sigbjorn.finne at gmail.com
Tue Jan 13 23:31:04 EST 2009


Thanks Bas for the helpful & clear advice.

While I'm not on top of it yet why some installs of 6.10.1 experience 
this build
failure, but others don't, I've put together an updated .cabal file + 
source dist
that I hope gets at it. It's available from

   http://www.galois.com/~sof/json-0.4.1.tar.gz

I've pointed Alex at this bundle earlier, but if others that have run 
into the same
problem could test using above bits and see if that fixes it, that'd be 
great.

If cool, I'll upload the bits to hackage. My apologies if this is 
breaking people's
cabal builds at the moment.

cheers
--sigbjorn

On 1/13/2009 11:58, Bas van Dijk wrote:
> On Tue, Jan 13, 2009 at 8:47 PM, Alex Ott <alexott at gmail.com> wrote:
>   
>> Hello
>>
>>     
>>>>>>> "SF" == Sigbjorn Finne writes:
>>>>>>>               
>>  SF> Hi, a new release of the 'json' package is now available via hackage,
>>  SF> version 0.4.1
>>
>>  SF>   http://hackage.haskell.org/cgi-bin/hackage-scripts/package/json
>>
>> I tried to upgrade it via cabal on mac os x & linux (both use ghc 6.10.1)
>> and it fails with
>>
>> Building json-0.4.1...
>>
>> Text/JSON/Generic.hs:33:7:
>>    Could not find module `Data.Generics':
>>      it was found in multiple packages: base-3.0.3.0 syb
>> cabal: Error: some packages failed to install:
>> json-0.4.1 failed during the building phase. The exception was:
>> exit: ExitFailure 1
>>     
>
> The standard solution for this is to add a cabal flag that controls
> wether to depend on base-4 or base-3:
>
> ------------------------------------------------------
> flag small_base
>   description:          Choose the new smaller, split-up base package.
>
> Library
>   if flag(small_base)
>     Build-Depends:      base == 4.*, syb
>     CPP-Options:        -DBASE_4
>   else
>     Build-Depends:      base == 3.*
> ------------------------------------------------------
>
> And use some CPP in your modules like this:
>
> ------------------------------------------------------
> {-# LANGUAGE CPP #-}
>
> #ifdef BASE_4
> import Data.Data (Data)
> #else
> import Data.Generics (Data)
> #endif
> ------------------------------------------------------
>
> See for example how I do it in http://code.haskell.org/Stream
>
> regards,
>
> Bas



More information about the Haskell-Cafe mailing list