[Hackage] #326: Cabal should support Cabal-version-dependent Setup.hs

Hackage trac at galois.com
Sat Aug 16 16:22:49 EDT 2008

#326: Cabal should support Cabal-version-dependent Setup.hs
  Reporter:  claus          |        Owner:         
      Type:  enhancement    |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:
  Severity:  normal         |     Keywords:         
Difficulty:  normal         |   Ghcversion:  6.8.2  
  Platform:                 |  
 The manual says about non-standard `Setup.hs`: "good luck". But there are
 packages that need non-standard `Setup.hs`, often just very small ones.
 And all of them risk breakage when Cabal changes.

 The first issue is to specify the dependency on a particular Cabal version

 The next issue is that package authors often know how to write their
 `Setup.hs` for different versions of Cabal, but have to pick one or the
 other. It would be better to have `Setup.hs` code adapt to as many Cabal
 versions as possible. Since version mismatch leads to compile errors, that
 seems to imply either

  - separate sources (`Setup-v1.4.hs`, `Setup-v1.5.hs`, etc.)

  - one source, with CPP (#if Cabal==1.4 ..)

 If I read [http://www.haskell.org/pipermail/cabal-
 devel/2008-August/003576.html Add auto-generated CPP macros for package
 version testing] correctly, that almost provides package version info via
 CPP. It would only need to provide precise versions instead of lower
 bounds, and for the Cabal package.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/326>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list