Open andreasabel opened 8 months ago
Here is another case of bad upper bounds in the wild: https://hackage.haskell.org/package/concurrent-output-1.10.21/concurrent-output.cabal
build-depends: ...
, process (>= 1.6.0 && < 1.7.0)
, directory (>= 1.2.0 && < 1.4.0)
, transformers (>= 0.3.0 && < 0.7.0)
, exceptions (>= 0.6.0 && < 0.11.0)
, ansi-terminal (>= 0.6.2 && < 1.2.0)
@ffaf1 does this look plausible?
It does!
A few insights into bounds that
cabal check
could teach the users via some new warnings:>= version
, and not exclusive, i.e.> version
. Common blunders could bebase > 4.11
when you actually wantbase >= 4.12
. Note that versions make a dense space, so there are infinitely many versions that are> 4.11
and< 4.12
.< version
, and not inclusive, i.e.<= version
. A blunder I observed in the wild is folks setting e.g.base <= 4.19.1.0
when the last published version ofbase
is4.19.1.0
. This way, one blocks patch releases that should always be fine according to the PVP. The correct minor bound isbase < 4.19.2
.base < 4.20.0.0
could be mistaken to mean thatbase-4.19.*
is the latest versions that should be accepted. But reallybase-4.20
andbase-4.20.0
are not excluded by the bound. The correct bound is< 4.20
.I propose that
cabal check
warn on subexpressions of the version range that are of the form> version
or<= version
. It should further warn on upper bounds with trailing zeros, i.e.<= version.0...0
.