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

Hackage trac at galois.com
Mon Aug 18 14:08:34 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         |   Resolution:         
  Keywords:                 |   Difficulty:  normal 
Ghcversion:  6.8.2          |     Platform:         
Comment (by claus):

 Ah, I see - the macros are only temporarily available while building. I
 had assumed that Cabal would generate them permanently for each package,
 so that not only cabal-install could profit from them.

 A CABAL_VERSION macro could just as well be part of the cabal package,
 without auto-generation, but if cabal doesn't have an include directory
 yet, I certainly don't insist on a CPP-based solution, as long as we can
 find something else.

 What about the other suggestion? Standardise a format for including the
 Cabal-version in the `Setup` file name, and make cabal-install select the
 right one (that is something even users might manage to do manually, but
 it'd be nice if automated scripts could handle it as well).

 One could even code that up in Haskell, at the expense of interpreting
 `Setup-<version>`. However, Cabal should provide that code, and check that
 the required versions exist, just as it ought to provide a default `Setup`
 for build-type `Simple`.

 -- sketch of Cabal-version-dependent Setup:
 -- get Cabal version
 -- execute Setup-<version>

 No CPP, and it can be started without changing Cabal, just standardizing
 the file name format. Since it is unlikely that the code for getting the
 Cabal version or for executing processes is going to be stable for long,
 such a `Setup.hs` file should really come with Cabal, for a build-type
 Setup-select or something, hiding the implementation details.

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

More information about the cabal-devel mailing list