Skip to content

Commit

Permalink
Add content to the version ranges section
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Feb 9, 2025
1 parent e9c1e38 commit 5fd552d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions doc/how-to-freeze-versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,22 @@ Version ranges
--------------

A dependency can have a version range specified in the package description.
This is expected for published packages. The `cabal check` command will check
that version ranges conform to a set of rules:
Published packages are expected to attach version ranges to dependencies that
conform to a set of rules that ``cabal check`` command will check for and report
on:

- that lower bounds are inclusive
- that upper bounds are exclusive
- that upper bounds don't have trailing zeros
- that upper bounds are not missing
- that upper bounds are not missing for ``base``

With large projects with many packages, it would be a lot of work to keep all
For large projects with many packages, it would be a lot of work to keep all
package dependency version ranges up to date. Ways of overcoming this are:

- use a bash script to replace or update version ranges in all package descriptions
- use a package generator like ``hpack-dhall-cabal`` to import sets of dependencies with version ranges
- use a ``cabal.project`` file to specify version constraints for all dependencies
- use a ``cabal.project`` file to specify version constraints for some or all dependencies
- use a curated set of packages and versions and import these into the project

Version constraints
Expand Down

0 comments on commit 5fd552d

Please sign in to comment.