-
Notifications
You must be signed in to change notification settings - Fork 691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package IDs are not unique #4381
Comments
The assumption that is being made is that if the In fact, it's not correct to rely on ABI hashes to decide when to relink, even in GHC 7.10 and earlier, where OK, so let's explain why Cabal works this way. In GHC 7.8 and earlier, the SPJ was not very happy with having two, very similar, but subtly different "unique" identifiers for a package, so he lobbied strongly for collapsing IPIDs and package keys together as one notion. In GHC 8.0, we did just that (http://ghc.haskell.org/trac/ghc/ticket/10714): now what we previously called the If you really want to keep relinking based on ABI hashes, ghc-8.0 does record the ABI hash of a package in |
I guess that's that then. I don't think it's good practice for GHC to be regularly redefining fields and removing guarantees that downstream can rely upon. We'll work around this in Stack I guess, doesn't look like there's much alternative to doing so. Thanks for the thorough response, even if it's not the response I was hoping for :) |
Following up from commercialhaskell/stack#2904. Feel free to read my comments there for background on what downstream issues this caused, I'll focus on just Cabal here.
I've tested with cabal-install 1.24 and HEAD, and in both cases it appears that newly installed packages have an identical package id and key. Furthermore, changing the contents of the package do not result in a change in the package id. This is expected behavior for the key (which is calculated from the inputs to the build plan), but is not expected for the id (which should be based on the resulting binary, and should be unique for changes in source code or dependencies).
I confirmed this behavior with the following Docker script:
Which results in the output (among much else):
Changing the source code and rebuilding results in exactly the same id (unexpected) and key (expected).
The text was updated successfully, but these errors were encountered: