On Sat, Jan 31, 2009 at 04:01, John Goerzen <jgoerzen@complete.org> wrote:
On Sat, Jan 31, 2009 at 01:51:54AM +0100, Krzysztof Skrz??tnicki wrote:
> The following change in .cabal file may solve the problems:---
> flag base4
>   description: Choose base-4 if possible
>   default: True
>
> library
>   if flag(splitBase)
>     if flag(base4)
>       Build-Depends: base>=4, old-time, time, bytestring, containers,
> old-locale
>     else
>       Build-Depends: base>=3, old-time, time, bytestring, containers,
> old-locale
>   else
>     Build-Depends: base<3
>   Build-Depends: mtl, convertible >= 1.0.1, utf8-string
> ---
>
> It works for me and I *think* will also work for other setups, most notably
> GHC 6.8.*.

Not out of the box.  The base4 flag will be on by default for GHC
6.8.x too, and they'll get the base >= 4 dep, which will break.
They'd have to configure with the option to disable a flag (-f -base4
if memory serves), which is neither intuitive nor automatic.

No, not really. I downloaded GHC 6.8.3 to test it, and it works:
 
D:\biblioteki\HDBC-2.0.0>cabal install -w c:\ghc\ghc-6.8.3\bin\ghc
Resolving dependencies...
Configuring HDBC-2.0.0.2...
Preprocessing library HDBC-2.0.0.2...
Preprocessing executables for HDBC-2.0.0.2...
Building HDBC-2.0.0.2...
[1 of 7] Compiling Database.HDBC.SqlValue ( Database/HDBC/SqlValue.hs, dist\build/Database/HDBC/SqlValue.o )
[2 of 7] Compiling Database.HDBC.ColTypes ( Database/HDBC/ColTypes.hs, dist\build/Database/HDBC/ColTypes.o )
[3 of 7] Compiling Database.HDBC.Statement ( Database/HDBC/Statement.hs, dist\build/Database/HDBC/Statement.o )

Database/HDBC/Statement.hs:15:0:
    Warning: Module `Control.Exception' is imported, but nothing from it is used,
               except perhaps instances visible in `Control.Exception'
             To suppress this warning, use: import Control.Exception()
[4 of 7] Compiling Database.HDBC.Types ( Database/HDBC/Types.hs, dist\build/Database/HDBC/Types.o )
[5 of 7] Compiling Database.HDBC.Utils ( Database/HDBC/Utils.hs, dist\build/Database/HDBC/Utils.o )
[6 of 7] Compiling Database.HDBC.DriverUtils ( Database/HDBC/DriverUtils.hs, dist\build/Database/HDBC/DriverUtils.o )
[7 of 7] Compiling Database.HDBC    ( Database/HDBC.hs, dist\build/Database/HDBC.o )
C:\ghc\ghc-6.10.1\bin\ar.exe: creating dist\build\libHSHDBC-2.0.0.2.a
Installing library in C:\Program Files\Haskell\HDBC-2.0.0.2\ghc-6.8.3
Registering HDBC-2.0.0.2...
Reading package info from "dist\\installed-pkg-config" ... done.
Saving old package config file... done.
Writing new package config file... done.

Checking:

C:\ghc\ghc-6.8.3\bin>ghc-pkg list HDBC
C:/ghc/ghc-6.8.3\package.conf:
    HDBC-2.0.0.2

So both 6.8.3 and 6.10.1 work as expected.

I can't remember the exact page in docs, but as far as i remember if Cabal fails to satisfy conditions with certain flag on its default settings the flag is changed and dependency calculation restarts.

All best

Christopher Skrzętnicki