[Hackage] #753: cabal configure choosing base 3 is confusing (was: cabal executable chooses different versions of libraries than cabal library)

Hackage cvs-ghc at haskell.org
Thu Nov 11 09:06:36 EST 2010


#753: cabal configure choosing base 3 is confusing
---------------------------------+------------------------------------------
  Reporter:  guest               |        Owner:         
      Type:  defect              |       Status:  new    
  Priority:  normal              |    Milestone:         
 Component:  cabal-install tool  |      Version:  1.8.0.6
  Severity:  normal              |     Keywords:         
Difficulty:  unknown             |   Ghcversion:         
  Platform:                      |  
---------------------------------+------------------------------------------

Comment(by duncan):

 This behaviour is due to backward compatibility hacks in cabal-install.
 When you run `cabal configure` it uses its constraint solver and various
 preferences to decide what dependencies to pick. When you run `rughc Setup
 configure` it just blindly picks the latest version of everything (whether
 or not the set of versions it picks have consistent dependencies).

 One of the things that `cabal configure` does is to make lots of old
 packages work that never specified what version of base they want. They
 were written when base 3 was around and so were not tested with base 4,
 but they specified:
 {{{
 build-depends: base >= 3
 }}}
 Normally we would interpret this as allowing any version greater than 3,
 but the problem when base 4 came out was that all these packages broke,
 because cabal would pick base 4. The hack was to reinterpret what an
 upwards open constraint means on base. If the range is open we apply a
 preference for base 3. If it is closed we treat it normally.

 So if you write:
 {{{
 build-depends: base >= 3 && < 5
 }}}
 then cabal will pick base 4, if it's available.

 The problem now is new packages where people just list:
 {{{
 build-depends: base
 }}}
 They expect the latest version to be picked. I think what we need to do is
 to add a warning that they should specify an upper bound and that the
 older version is being defaulted to.

 Note that it is not practical to make `cabal configure` and `runghc Setup
 configure` do exactly the same thing, because that either means making
 `cabal configure` dumb, or it means moving the constraint solver into the
 Cabal library. I think the right solution to this inconsistency is to
 encourage users to use the cabal program as the main UI, and stop using
 `runghc Setup`, leaving that interface just as a machine interface for
 things like distro packaging scripts.

-- 
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/753#comment:1>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects



More information about the cabal-devel mailing list