-
Notifications
You must be signed in to change notification settings - Fork 698
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
By default, new-build should freeze the Hackage index revision, so "cabal update" does not cause rebuilds #3832
Comments
This is expected behavior, but perhaps we can make the reasons why more transparent to the user. The principle of new-build is that builds should be deterministic with respect to the Hackage index. That means that new-build will never attempt to prefer existing packages in the database. It just does dependency solving as if there was nothing preinstalled, and if it happens to pick the same dependency resolution which lets you reuse something, great. But it will always act the same. CC'ing @hvr, I actually think it is a bit bad that despite all we are for determinism, the Hackage index is still one big honking source of non-reproducibility. If we were to automatically freeze the Hackage index (let's add another config file, Some other matters:
|
How will this work when |
How about, update from within a cabal.project writes out a snapshot config file, outside it just downloads a newer index. (Ugh, do we need an offline mode haha.) |
Sounds like a nice plan! A project-local snapshat would make a lot of sense and sounds like another big improvement for reproducibility.
The local snapshot would already solve a lot of stuff. But for cases like this where it's installing packages with an already present version number (probably some other flag assignment) it would be very nice to have :) |
@ezyang fwiw, I have slightly other plans (especially because I like the current behaviour and don't want to loose it; as I said elsewhere, we can still implement that per-project update feature, but make it configurable as I wouldn't want it to be default for me), and plan to hook up index-snapshot to |
I was also thinking we might do a semi-freeze by default, ie first time you run (new-)configure/build it'd stick with the current snapshot, and then not be affected by running update in other projects/places until you run update again in this project. |
Pinging @hvr: what is the status update on index snapshot and freezing? |
snapshot and freezing are both in afaik. I guess this ticket is worth keeping in for the discussion over if if people want to consider making a semi-freeze by default? |
@hvr If I understand the above correctly, the proposed design is to make Has this been implemented recently (Cabal 3.0.0 does not seem to do it)? |
No it isn't. The underlying problem is that the So whatever is written to |
Hi Oleg, thanks for replying,
Do you mean "That is not the design", or "it is not implemented"?
Surely new revisions can breaks builds by e.g. pushing unsolvable constraints. Do you mean that this is not done in practice?
Surely freeze could just store the state of each repo, similar to #5965 |
OK I now see I can get the behavior I want by setting |
|
See #3832 (comment) for how to avoid user confusion.
Original report below.
Not sure if this is expected behaviour, I am new-building leksah after running a
cabal update
. It seems to be installing many of my dependencies again and duplicating them in the global database (probably having a different hash?) ghc-pkg gives me this for example:I'm not sure how I can reproduce this to see what caused it, because the build plan is now dependent on the hackage index right?
By the way, shouldn't there be hashes in the package id's? This is with cabal 1.24.
The text was updated successfully, but these errors were encountered: