[Hackage] #284: Cannot upload packages that require specific cabal versions

#284: Cannot upload packages that require specific cabal versions --------------------------------+------------------------------------------- Reporter: guest | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: hackageDB website | Version: Severity: normal | Keywords: Difficulty: normal | Ghcversion: 6.8.2 Platform: | --------------------------------+------------------------------------------- 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. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/284 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#284: Cannot upload packages that require specific cabal versions --------------------------------+------------------------------------------- Reporter: guest | Owner: duncan Type: defect | Status: assigned Priority: normal | Milestone: Component: hackageDB website | Version: Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: --------------------------------+------------------------------------------- Changes (by duncan): * status: new => assigned * owner: => duncan Comment: 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. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/284#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#284: Cannot upload packages that require specific cabal versions --------------------------------+------------------------------------------- Reporter: guest | Owner: duncan Type: defect | Status: assigned Priority: normal | Milestone: Cabal-1.6 Component: hackageDB website | Version: Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: --------------------------------+------------------------------------------- Changes (by duncan): * milestone: => Cabal-1.6 -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/284#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#284: Cannot upload packages that require specific cabal versions --------------------------------+------------------------------------------- Reporter: guest | Owner: duncan Type: defect | Status: assigned Priority: normal | Milestone: HackageDB Component: hackageDB website | Version: Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: --------------------------------+------------------------------------------- Changes (by duncan): * milestone: Cabal-1.6 => HackageDB -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/284#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#284: Cannot upload packages that require specific cabal versions --------------------------------+------------------------------------------- Reporter: guest | Owner: duncan Type: defect | Status: assigned Priority: normal | Milestone: HackageDB Component: hackageDB website | Version: Severity: normal | Resolution: Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: --------------------------------+------------------------------------------- Comment (by duncan): This is doable with the new `VersionIntervals` data type in Cabal-1.7+. We can now match on the semantics of version range expressions where previously we could only do it on the syntax. This should enable us to do an accurate test on the allowed `cabal-version` range expressions. As mentioned previously we want to make sure that hackage can actually parse the .cabal file. So that means any lower bound must be less than the version of Cabal that hackage is using. So for example if Hackage is using Cabal-1.7 then this should be ok: {{{ cabal-version: >= 1.2 && < 1.5 }}} but we can quite legitimately reject: {{{ cabal-version: >= 2.0 }}} because its lower bound is higher than we understand. We can also enforce that exact `==` predicates are not used, because we know that the Cabal lib follows the package versioning policy. See also #395. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/284#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#284: Cannot upload packages that require specific cabal versions --------------------------------+------------------------------------------- Reporter: guest | Owner: duncan Type: defect | Status: closed Priority: normal | Milestone: HackageDB Component: hackageDB website | Version: Severity: normal | Resolution: fixed Keywords: | Difficulty: normal Ghcversion: 6.8.2 | Platform: --------------------------------+------------------------------------------- Changes (by ross): * status: assigned => closed * resolution: => fixed -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/284#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage