-
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
Implicit snapshots (aka: Unify extra-deps and extensible snapshots) #1265
Comments
👍 |
For (3), I'm thinking doing the following makes sense:
Major release |
Errr, vendoring? If I read you correctly, this is something I've done many times, although it wasn't "local", it was a git repository with modifications divergent from an available Hackage version. I had to do this for Snap 1.0 and it was only due to Stack that I was able to manage the mess.
That's satisfactory for what I was concerned about, although we'll want a big-bold-headline explaining package vs. dependency since the former can be read either way. Everything else seems fine. |
vs
The main reason to add it is consistency. I've discussed this with @borsboom and he's in favor. Probably the way it will work is that |
What's the replacement for the "is a package, local path, has extra-dep: true" case in this design? There was a lot of that too in my projects. |
Good question! I actually didn't realize that was possible. This capability is indeed problematic if the Does stack reinstall these when you change files in them? |
I don't actually see any |
a big +1 to this one! |
Note that
|
Note that after this, having the solver add to extra-deps due to flags will be unnecessary: harendra-kumar@86334c6 |
I just talked to @borsboom about this issue: His idea was to start in the EDIT: He proposed to call the custom resolver that results from a |
See #3249. That PR explicitly decided not to create an implicit snapshot based on extra-deps, due to:
|
Closing now that #3249 is merged. |
There's a lot of overlap between extra-deps and extensible snapshots. Both give you a to add some "extra stuff" to a snapshot. The main difference is that extra-deps are installed into
<project>/.stack-work
and treated as slightly weird local packages, while extensible snapshots will go into~/.stack/snapshots
and are immutable. There's a fair amount of confusion around extra-deps (and packages that haveextra-dep: true
) , so instead of having two ways to do similar things, they should be unified into a single coherent approach.Particular issues currently:
Now that snapshots can share packages between them, there's no longer a good reason why extra-deps have to be local to the project. Instead, they could form an implicit extended snapshot.
So here, after discussing with @snoyberg, is my proposal for steps to take:
Ensure that extensible snapshots (Extensible snapshots #863) can support everything required to support extra-deps. That would include:
or local directory[edit: local directory for extended snapshot would not be a good idea, since contents could change]Modify stack so that an implicit custom snapshot is created for extra-deps, without changing the existing stack.yaml configuration. The implicit custom snapshot's name would be generated by taking a hash the package source location, name, version, flags, and ghc-options (at least) for each package
Rationalize the stack.yaml configuration. In particular, do away with the
extra-deps
section. All additions to the custom snapshot will be added using a flag in thepackages
section (similar to the existingextra-dep
flag, but perhaps with a different name likeextend-snapshot
). The existing configuration would be deprecated but still supported for some time.Edit: alternatively, keep a separate section for the extended snapshot (akin to current
extra-deps
section), but have it accept exactly the same syntax as thepackages
section (but not accepting local directories). Pro: a bit more clear; Con: more work to switch packages between local and extended snapshot (you have to move stuff around in stack.yaml instead of just toggling a flag).ping @mgsloan @zudov @bitemyapp
The text was updated successfully, but these errors were encountered: