Proposal: Ignore sub-minor version components in package id
Duncan Coutts
duncan.coutts at googlemail.com
Tue Nov 8 13:25:59 CET 2011
On Mon, 2011-10-03 at 13:18 +0200, Joachim Breitner wrote:
> Hi,
>
> I’d like to propose that the package (shown by "ghc-pkg field <pkg> id"
> and used by "ghc-pkg field <pkg> depends") should only consist of the
> first three components of the package version, not all of them.
So I agree with your aims but I suggest a different approach.
Also, we're conflating issues here:
The "id" field (or the InstalledPackageId in Cabal parlance) is used to
uniquely identify each package.
This is not the same thing as an ABI.
Note that currently, confusingly, the package id that Cabal creates (for
ghc) is made up of the package name, version and abi hash. This makes
people think it is an abi identifier when it is not.
We need (in future) to be able to distinguish different packages that
share the same ABI. So what needs to happen is that we include the ABI
as a separate field in the package db. That abi need not contain the
version number at all, it can be just some abi hash.
Then whether the dependencies should then use an installed package id or
a package abi is an interesting question. I think the right thing is to
use installed package ids. Just because it would be possible to update a
dependency to use the latest-ABI compatible version doesn't mean that it
should be immediate and automatic. Indeed it would prevent us from
having a persistent package database, as adding new packages would
change the meaning of existing packages. Switching to a later
ABI-compatible version of a dependency should be a deliberate act. Hence
we should use installed package ids for dependencies.
Duncan
More information about the Libraries
mailing list