[Haskell-cafe] Building lambdabot

Gwern Branwen gwern0 at gmail.com
Thu Jan 20 21:50:42 CET 2011


On Thu, Jan 20, 2011 at 12:45 PM, Max Bolingbroke
<batterseapower at hotmail.com> wrote:
> On 20 January 2011 17:30, Gwern Branwen <gwern0 at gmail.com> wrote:
>>> * You need to loosen the base upper bound to < 4.4
>>> * If using base >= 4, you need to depend on the syb package as well
>>> (current version 0.3)
>>
>> Would this break GHC 6.12 builds?
>
> Thats why I suggested the flag stanza. Cabal has a weird kind of flag
> semantics where it will try every possible combination of flags until
> it finds one that builds. The solution I suggested uses this behaviour
> to either depend on base >= 4 && < 4.4 WITH syb, OR base < 4 WITHOUT
> syb. Because of the default flag setting of True, the first
> possibility will be tried first, but it if fails Cabal will just fall
> back on base < 4.
>
> In short, it should work perfectly for either GHC 7 or 6.12 clients
> (modulo syntax issues - I haven't actually tried the syntax I sent
> you).

No, there's another issue. I've recorded this version;

hunk ./show/show.cabal 25
+Flag base4
+ Description: Build with base-4
+ Default: False
+
hunk ./show/show.cabal 32
-   build-depends:       base<4, random, QuickCheck>=2.4, smallcheck>=0.4
+   build-depends:       random, QuickCheck>=2.4, smallcheck>=0.4
+   if flag(base4)
+    build-depends:       base>=4 && <4.4, syb >= 0.3 && < 0.4
+   else
+    build-depends:       base<4

Notice the flag defaults to False, not True. When I tried it with True, I got:

$ cabal install
Resolving dependencies...
cabal: dependencies conflict: base-3.0.3.2 requires syb ==0.1.0.2 however
syb-0.1.0.2 was excluded because syb-0.3 was selected instead
syb-0.1.0.2 was excluded because show-0.4.1 requires syb ==0.3.*

-- 
gwern
http://www.gwern.net



More information about the Haskell-Cafe mailing list