(Imported from Trac #232, reported by @dcoutts on 2008-02-05)
Revised proposal: http://www.haskell.org/pipermail/cabal-devel/2008-January/001786.html
In order to make it easy for package package authors to describe correct and robust dependencies we (Duncan Coutts and I) propose the following syntactical extension to version range specifications in package files.
~ 1.2.\* ~~> >= 1.2 && < 1.3
~ x.y.\* ~~> >= x.y && < x.(y+1)
This is the most common specification of package dependencies. The assumption is that changes in the last version number indicate only backwards compatible changes, as is suggested in the new package versioning policy . The use of "*" matches the common usage as a wildcard character.
~ 1.2.1+ ~~> >= 1.2.1 && < 1.3
~ x.y.z+ ~~> >= x.y.z && < x.(y+1)
(Imported comment by @dcoutts on 2008-02-05)
Note that if the foo ~ 1.2.1+ syntax is too confusing we could do with just foo ~ 1.2.* && >= 1.2.1. It also allows to depend on a micro release that fixes a bug like foo ~ 1.2.* && >= 18.104.22.168.
(Imported comment by @dcoutts on 2008-05-04)
Added the wildcard syntax but not the upward range syntax.
Thu Jun 19 18:50:06 BST 2008 Duncan Coutts <email@example.com>
- Add version wildcard syntax
build-depends: foo ~1.2.*
build-depends: foo >=1.2 && <1.3
It's also valid everywhere else version ranges are used.
So if we're happy then we should document the syntax in the user guide and close the ticket.
Note that if we add this to the Cabal-1.4 branch (which is possible since it does not change any types) then we need to not let it be used in packages uploaded to hackage yet.
(Imported comment by @nominolo on 2008-06-19)
It is indeed confusing, 1.2.3+ looks all too much like >= 1.2.3. Let's drop it then.
(Imported comment by @dcoutts on 2008-06-20)
Changed syntax slightly:
Tue Jul 29 16:16:12 BST 2008 Duncan Coutts <firstname.lastname@example.org>
* Use "pkg == 1.2.*" as the version wildcard syntax
Rather than "pkg ~ 1.2.*". This seemed to be the consensus.
The syntax "pkg == 1.2.*" means "pkg >= 1.2 && < 1.3" and it
is to encourage people to put upper bounds on api versions.
Tue Jul 29 17:20:24 BST 2008 Duncan Coutts <email@example.com>
* Move docs for build-depends into the build information section
Since it is shared between libs and exes. Extend the documentation
to describe the syntax of version constraints, including the new
version range syntax "build-depends: foo ==1.2.*".