Skip to main content

Stack extra-deps Revisions

I recently had issues with using a Hackage package revision with Stack. It would not work unless I specified the revision number.

Hackage, the Haskell package repository, allows maintainers to make revisions of package metadata. This is commonly done to bump upper bounds of dependency constraints when a new release may be used without any changes to the code of a project. Indeed, doing so is recommended over releasing a new version in order to minimize the cost of maintaining Hackage. It is also convenient for maintainers, as making a revision is generally less work than creating a new release.

Stack allows configuration of “extra dependencies” (extra-deps) to specify a dependency (version) that is not included in the Stackage snapshot. I thought that the latest revision of the specified version would be used. This is what is documented, but it seems to be incorrect. Specifying a revision as in the following example works.

extra-deps:
  - ginger-0.10.5.2@rev:1

FWIW, I think that having to specify the revision number is the correct thing to do for Stack, where configuration should specify the exact dependencies used.

Note that Cabal uses the latest revision for a specified version. This works well, and I am happy that I do not have to update revision numbers in various configuration when making new revisions. For example, old releases of ginger have insufficient dependency constraints, which means that constraints must always be specified in order to prevent Cabal from using those old versions in some cases.

Author

Travis Cardwell

Published

Tags