-
Notifications
You must be signed in to change notification settings - Fork 842
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
Changing hackage metadata can invalidate ~/.stack cache, thus making builds non-reproducible #2217
Comments
I agree stack should fix this issue even before it ever triggers, however unlikely; but did it also happen in practice? I'm asking to judge urgency. |
Yeah, this is what the SHAs thing is for, it means that the stackage snapshot specifies a specific revision. We don't support it for extra-deps, but once implicit snapshots are implemented, it'll probably become possible. In practice, hackage restricts the edits you can make. If these edits break the build, then you can always use |
In fact, I learned that the issue has been discussed to death in However, while I'm in favor of allowing to fix revisions, I'm not sure I'd always want to. What happens if some version combination turns out to be buggy and is forbidden through cabal edits? Or is that better handled by deprecations? And in most cases, revisions upgrades will not break working stack.yaml, only make more ones valid (though haskell/cabal#2222 might be a counterexample). Or in other words: updating to a newer version of stackage takes some work, and I don't want that to increase because I have to specify revisions. I think this also requires an extra index on all-cabal-hashes (unless configurations mention revisions by SHA rather than revision number, which is only maybe OK). |
Right, the specification of revisions comes with the snapshot. It is highly unlikely that they will ever be mandatory for stuff like extra-deps, just recommended if you want that last bit of reproducibility. |
Just an idea -- we could go with a It could be generated when you build a project that has EDIT: To be clear about what I mean, |
We have lots of work in this direction with Pantry. See also #4288 for next steps. |
Consider the following case:
foo
depends onbar-1.2.3
in itsextra-deps
.bar-1.2.3
is at revision1
on Hackage, with certain version bounds that work forfoo
.bar-1.2.3
is changed on Hackage to version bounds that do not work forfoo
anymore. Nowbar-1.2.3
is at revision2
.bar-1.2.3
cached in my~/.stack
, I don't notice the breakage at all (since I keep using revision1
), but users getting a fresh Hackage index (I think it's called that way) will (since they'll use revision2
).The solution to this is to fix the Hackage package revision, either by defaulting to the first revision, or through some other UI.
The text was updated successfully, but these errors were encountered: