-
Notifications
You must be signed in to change notification settings - Fork 843
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
Extensible snapshots #863
Comments
Side point: if we like the syntax we come up with here, perhaps we can use it for making extensible stack.yaml project configurations add well |
👍 |
Now that we have sharable binary artifacts between snapshots, I think we can relax some of the original design points behind custom snapshots. Specifically: we previously needed custom snapshots to be semi-mutable so that small changes in a package set wouldn't result in complete recompilation. Now that that's no longer the case, I'd like to go for a simpler model: assume that a name is a unique mapping to a snapshot definition that never changes. Specifically:
I think this is the right set of constraints to make snapshots efficient to implement, convenient to use, and flexible enough. I'd like some feedback (including questions on what I mean here) before I implement this. Pinging the users of custom snapshots I'm aware of: @gregwebs @feuerbach @hesselink @3noch |
Sounds good. The only concern I have is, as the snapshot changes, we'll quietly leak disk space. (Although this is true even for normal snapshots.) Perhaps we need some kind of |
A cleanup command is being tracked in #133 |
I think this sounds very good. We decided to have our custom snapshots mostly immutable anyway, and the small amount of mutability was only motivated by the long reinstall times of new snapshots. Since those are gone now, making them completely immutable seems like the right choice. One question: why not treat file urls just like remove urls, copying the file once and then ignoring it? |
That would indeed be simpler/more consistent. The reason is to meet the use case of people trying to have semi-mutable snapshots still, which are checked into the repository. Since that's the common use case for mutable snapshots, and it adds very little performance overhead (as opposed to needing to make an HTTP request for every build), it seems like a worthwhile tradeoff. If no one needs that functionality, however, I'm OK removing it. |
This sounds a bit like what we do: we have a |
Benefits would be convenience, and avoiding a very confusing result, namely: if you update the snapshot.yaml and forget to rename it, building on one machine would have a very different result than building on another. By checking the hash, we avoid that corner case. That case still exists with HTTP-based snapshots, but I think it would be far more unusual to change those, as opposed to changing a local file which is easy to do by mistake. |
That's a good point. Perhaps you could issue a warning in both cases (or the HTTP case only)? |
What would trigger the warning in the HTTP case? We'd need to perform an On Thu, Sep 17, 2015, 11:59 AM Erik Hesselink notifications@github.com
|
Yes, I was thinking of doing the HTTP request, but if that's unacceptable performance wise, then it just leaves the choice of allowing mutable snapshots for local files, or not allowing them and having a warning if they change. I'm indifferent, I think we'll treat them as immutable anyway since it doesn't have any downsides now. |
Related: #1265 (Unify extra-deps and extensible snapshots) |
This is implemented on https://github.com/commercialhaskell/stack/tree/863-extensible-snapshots :D Still work in progress, but should work. Those who're keen to use it / find bugs, feel free to give it a try. (though it will put large shas on your custom snapshot storage dirs, not sure if that convention will stick) Instead of Also adds |
Merged, so this is now available on master! |
Woohoo On Sat, May 7, 2016, 4:57 AM Michael Sloan notifications@github.com wrote:
|
I'd like to identify a common syntax for all snapshots to use for markup (LTS, Nightly, and the current custom snapshots), and allow snapshots to extend each other. For example: suppose we're using LTS 3.2, but want to modify the version of aeson to 0.14.0, drop pandoc from the included packages, and switch the compiler from GHC 7.10.2 to GHC 7.10.1. Perhaps this could be accomplished with something like:
Longer term: I'm thinking about trying to streamline all of the snapshot code: have a single syntax for LTS, Nightly, and "custom" snapshots, get rid of the specialness of LTS/Nightly (just make it the default available snapshots, like we do with package indices), and have some kind of fallback approach like package indices have right now.
The text was updated successfully, but these errors were encountered: