daniil
August 18, 2021, 6:45pm
1
Hi,
Package version on Hackage can be overloaded with multiple revisions, nonetheless Hacakge web ui doesn’t have any sign how many revisions a package version has.
I discovered the issue after trying to understand why hslogger is not working for me on ghc901 , mean while issues is closed and there is no any commit or release!
# Hackage Metadata Revisions — What They Are, How They Work
## What are revisions?
Package maintainers (as well as Hackage trustees) may provide metadata-revisions to existing package versions. These revisions can be thought of as "updating" the cabal file of a package with new or more current information. However, they do not _actually_ update the file. Tarballs retrieved from Hackage are always as the authors uploaded them. Revision information is tracked explicitly in the Hackage index, and `cabal-install` will chose to prefer the latest revision of a cabal file to the original one when downloading or installing a package.
## Why do we have revisions?
Revisions are used to provide better metadata, typically in the case when a build-plan turns out to be incorrect, and we wish to tighten bounds to exclude incompatible versions of dependencies, or when a new version of a package is released and loosening dependencies will allow existing packages to work with it. Strategies for managing revisions and their costs are enumerated in [the hackage trustee cookbook](https://github.com/haskell-infra/hackage-trustees/blob/master/cookbook.md#best-practice-for-managing-meta-data)
Revisions can also be used when a package homepage or maintainer or the like changes, to keep information displayed current.
## Why not just keep uploading new versions?
First, uploading a whole bunch of code when only metadata changes leads to an unnecessary growth in versions. Second, often revisions need to be applied not only to the most recent version of a package, but prior versions as well. In particular, if a package at a given version has a bad install plan, then you do not want to let some tool continue to think this is a good plan, even if that package is not the latest version.
## Where can I see revisions?
Packages with revisions will tell you so on their Hackage page. You can always access the revisions of a package by appending `/revisions` to its url, like so: http://hackage.haskell.org/package/lens-3.5.1/revisions/
This file has been truncated. show original
1 Like
The Hackage web UI does show the revisions for a package. For instance, lens-5.0.1
currently has 1 revision. From https://hackage.haskell.org/package/lens-5.0.1:
If you click on Revision 1
here, you’re taken to Metadata revisions for lens-5.0.1 | Hackage , which is a list of all revisions.
There are some nice things about revisions, although I agree they are quite unintuitive and surprising. I sometimes wonder if the Haskell ecosystem would be better without them.
magthe
March 14, 2024, 10:35pm
3
I bumped into this today and really needed to find a way to get a more recent revision than what one gets by default. After finding a solution I wrote it up: Hackage revisions in Nix
The gist of it is
hl = nixpkgs.haskell.lib.compose;
hsPkgs = nixpkgs.haskell.packages.ghc963.override {
overrides = newpkgs: oldpkgs: {
openapi3 = hl.overrideCabal (drv: {
revision = "4";
editedCabalFile =
"sha256-a5C58iYrL7eAEHCzinICiJpbNTGwiOFFAYik28et7fI=";
}) (oldpkgs.callHackageDirect {
pkg = "openapi3";
ver = "3.2.3";
sha256 = "sha256-0F16o3oqOB5ri6KBdPFEFHB4dv1z+Pw6E5f1rwkqwi8=";
} { });
1 Like