Ticket #284 (assigned defect)

Opened 6 months ago

Last modified 4 months ago

Cannot upload packages that require specific cabal versions

Reported by: guest Assigned to: duncan (accepted)
Priority: normal Milestone: HackageDB
Component: hackageDB website Version:
Severity: normal Keywords:
Cc: jcpetruzza@gmail.com Difficulty: normal
GHC Version: 6.8.2 Platform:

Description

I have a package that requires a custom Setup.lhs.The package works for ghc 6.8.x and 6.6.x and, thus, the Setup.lhs script was designed to work with Cabal 1.2.x, the one that comes with ghc 6.8.x. This is clearly indicated in the cabal-version field. However, if I try to upload this package to hackage I get this error:

hint-0.2.0.1/hint.cabal: This package requires Cabal version: >=1.2&&<1.3

As a workaround I used cabal-version: >= 1.2 but now, although the description explicitly says that it works with ghc 6.8.x, hackage indicates that it fails to build.

Change History

06/09/08 13:19:30 changed by duncan

  • status changed from new to assigned.
  • owner set to duncan.

As it happens in this particular case you're ok. It does actually work with Cabal-1.3.12.

In the general case this issue is this: we want to avoid people uploading packages that require a version of Cabal greater than the one that hackage itself is using because we could not reliably handle such packages. The difficulty is in implementing that test. The cabal-version is almost an opaque version predicate, it can have arbitrary unions and intersections of version ranges. So testing if it requires later than a particular version is tricky. It's easy to check if it allows the current version that is used by hackage, so that is what we do at the moment. I accept it's not right for packages that use a custom Setup.hs and that would fail to compile with some future version of the Cabal library.

At the moment though we're ok because the Cabal-1.4 series should be compatible with 1.2 for all existing Setup.hs scripts. We'll need to fix this at some point however. Probably the solution is to be slightly conservative, so if the current version is not in the version range and does not match a very simple version range, like >= x && < y then we'd keep the current behavior.

08/15/08 07:10:24 changed by duncan

  • milestone set to Cabal-1.6.

08/15/08 08:18:13 changed by duncan

  • milestone changed from Cabal-1.6 to HackageDB.