-
Notifications
You must be signed in to change notification settings - Fork 697
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
[Feature] remote freeze files #6528
Comments
This is a great idea and will certainly help bringing cabal to feature parity with stack in enterprise environments. |
@hvr spent considerable time to keep the critical path to produce a Such a remote fetch for a freeze file would be and almost certainly ruin this criticial path. |
IMO, it's very reasonable to be concerned about re-fetching a remote freeze file every time you run There are other ways to do it:
It's not like the latency concern is a dead end for the concept. It's just an argument against one of many possible implementations. |
Wrt 2.: Sounds like a controversial choice to me, since remote freeze files very likely would be per project (although there might be a global one too). As for the latency concerns: I do not share them.
I believe that |
Recent discussions have convinced me this would be a great feature to have. I think we should give the current freeze workflows a once-over as a first pass to make sure they're sufficiently ergonomic, then just tweak them to allow http fetch with caching. There are at least three features to reduce repeated fetch latency -- cache-control, etag, and last-modified checks. Our current transport backends should have decent support for them, last I checked :-) |
I agree with this. I was thinking too complex and missing a simpler answer here. I think it needs to be possible to do |
I too agree with this. |
@ptkato: does v2-configure still fetch remote repos or did we focus it exclusively on translating Even if it still does, given that the use of I didn't read closely about your use cases in this issue, so pardon me if I don't make sense. |
I was under the impression that |
Yes, that was a misguided attempt at backward compatibilty with v1-configure, which was a mandatory first step in the standard v1- workflow and which was not duplicated in v1-install. Now the overlap of |
Well in that case, the user definitely needs a way to:
|
I think if |
That'd be the new --only-download flag |
Well, I don't have too much of a clear picture how current or future cabal-install are structured. But I'd argue that internal phases and external cli interface is a different matter entirely. Internally, especially in the light of #7394 I'd argue that an approach similar to classic linux distro package managers is desirable. See for example https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-850009.1 So cabal would have at least phases, such as:
and possibly more (again, see the link to the gentoo PMS). My impression was that The user might only be exposed to the name |
I'm very much in favour, even as separate explicit plumbing commands, from which porcelain commands for the usual simple workflows are put together. For now, flags to pick the phases and some output indicating which phases are selected and which runs ATM, would probably be fastest to implement (see bike-shedding) and a good start. So, possibly, downloading the freeze files in the phase selected with Q: is what is currently being done with |
No it doesn't; right now it translates the given flags into a config file. I believe there's some confusion due to the naming of the command, which does give the impression that it does more. The naming ain't the best, I concur, try to see "configure" as in setting up a configuration file. |
I guess that's fine |
Afaiu this could be closed as #7783 is already merged, feel free to reopen if there is any pending question |
An important use case for this was being able to build with cabal using versions from stackage. What would that look like? Is there work needed to publish stackage package versions in some accessible location with the right format? I guess that can be continued in #7556 |
You just add this to your
|
The freeze files are already there at
So the syntax would be (I didn't try it):
|
For completeness we are about to add the example in docs: #8083 |
I guess one point of disagrement (from commercialhaskell/stackage-server#232) was that "versions from stackage" would still be subject to revisions. I think with the remote config definitely make a step forward but I am left wondering (because I don't know stack&stackage much): a stackage lts does fix the revisions right? how do we know which revisions are in the lts? (I amit I did have a play with pantry and I think I found a way to get that info out). |
Wrt revisions: #7833 |
On its own it doesn't, because unlike cabal.projec.tfreeze it doesn't include |
Freezing index state freezes the entire set of revisions. You can't specify individual revisions. |
I understand what cabal does, I am just wondering what stack does. E.g. I would expect a package to build with stack and lts-18.26 IFF it builds with cabal and I was under the impression that since the pantry reform, stackage snapshots will fix all the cabal files too, but I might be wrong here. |
Stack has 3 forms:
stackage snapshots usually specify hashes and as such implicitly pin revisions: https://github.com/commercialhaskell/stackage-snapshots/blob/6b1cf107d88d0ac78573d843c26a075d6bfff9c3/lts/19/2.yaml#L62 |
I don't think the revisions stuff is important. I do think that we're missing another thing still -- the logic for combining constraints remains totally additive -- so if there is a constraint from some imported freeze file, there's no way to override it. We need a PR that says "within processing project files, constraints on versions should be combined under Last, not under union. |
Wasn't duncans idea to write a nice algebra with combinators? |
yes but we're not doing that. |
Why not? |
Because as discussed here #7556 specifying a package algebra is a lot of work and new code which may be subtle and just changing the behavior this way will handle the use cases people are concerned about in a much more straightforward fashion |
How can you specify non-overridable constraints with this approach (e.g. security masks)? Wasn't that one of the major use cases? |
you can't specify non-overridable constraints, but if someone wants to deliberately override a security mask that's their right, prerogative, and problem. |
As an aside, I'm starting to come to the view that the "correct" way to handle security masks is a proper notion of a "vulnerability-warning-list" either orthogonal to or integrated into the main package index, rather than just trying to beef up existing tools to cover this sort of situation. |
I still think an algebra is cooler and more powerful. Is this left open as a future option? |
Sure, there's nothing in the plan that would rule such a thing out. |
I added cabal pre-releases, so people can test this feature on current HEAD comfortably:
|
Thank you @hasufell, exactly the summary I needed! |
If you want to use the same freeze file for a plethora of internal projects, then a "global" freeze file might make sense. Currently this would require copying and synchronising such a file across repositories, or having a mono-repo. Being able to set a remote location as a freeze file in
cabal.project
would solve this use case.Cli options could allow to say what to do in case fetching fails:
The text was updated successfully, but these errors were encountered: