Ticket #326 (new enhancement)
Cabal should support Cabal-version-dependent Setup.hs
| Reported by: | claus | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Cabal library | Version: | 1.2.3.0 |
| Severity: | normal | Keywords: | |
| Cc: | Difficulty: | normal | |
| GHC Version: | 6.8.2 | Platform: |
Description
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 (#284).
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 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.
