
Hi, a new release of the 'json' package is now available via hackage, version 0.4.1 http://hackage.haskell.org/cgi-bin/hackage-scripts/package/json [no claims that it represents rocket science, but a number of downstream codebases depend on this package for their operation, hence the announcement here.] New in this release is a generic JSON encoder contributed by Lennart Augustsson (Text.JSON.Generic ; thanks Lennart!) along with a number of other, smaller changes (including changes to the default encoding for constructors and prelude types - no longer down-cased; see release notes for more.) Enjoy --sigbjorn

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 -- With best wishes, Alex Ott, MBA http://alexott.blogspot.com/ http://xtalk.msk.su/~ott/ http://alexott-ru.blogspot.com/

On Tue, Jan 13, 2009 at 8:47 PM, Alex Ott
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

On Tue, 2009-01-13 at 20:58 +0100, Bas van Dijk wrote:
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:
Note that in future it will be even easier. As of Cabal-1.6 (which comes with ghc-6.10 but works with older versions too) you can use CPP macros:
#if MIN_VERSION_base(4,0,0) import Data.Data (Data) #else import Data.Generics (Data) #endif
and not have to do anything in the .cabal file. Of course this does not really help you for base 3 / 4 because the only point of doing that is to preserve compatibility with ghc-6.8 and out-of-the-box ghc-6.8 comes with an older Cabal version and we generally cannot expect all users to upgrade their Cabal version. Duncan

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
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
participants (4)
-
Alex Ott
-
Bas van Dijk
-
Duncan Coutts
-
Sigbjorn Finne