-
Notifications
You must be signed in to change notification settings - Fork 841
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
[rfc] only unpack package versions within preferred-versions #1391 #1839
[rfc] only unpack package versions within preferred-versions #1391 #1839
Conversation
* fetches version present in snapshot otherwise falls back to hackage * caches `preferred-versions` from index * only versions within `preferred-versions` are fetched unless explicitly asked by package identifier * added --latest flag to fetch latest version from hackage regardless of resolver
|
||
groupByPackageName = fmap Set.fromList . Map.fromListWith mappend . map toTuple' . Map.keys | ||
|
||
filterBy' pvs name vs = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not filterBy
without the prime?
LGTM so far! Are those checkboxes supposed to be checked? (in the issue description) It'd be cool, though not required, to have tests that the snapshot version is unpacked, that |
Also, note that it's failing to build for 7.8. Without looking at the error, most of the time I get that it's due to needing to use |
Maybe :) I have also added tests and have a, probably too fragile, way to get the latest non-deprecated from hackage to check against |
Yeah, I'd be fine with just making sure that it exits successfully for the latest case. It's sufficient to just check that |
Thanks for adding a test! For avoiding copying I have an enhancement suggestion: how about only loading the configuration / build plan if there are package names to resolve. So if the user does Ooh, and I just thought of something. I think we want Also, I don't think this is strictly necessary, but it would also be good to have clear messaging in the following case:
|
I'm back! let's 🚢 this one! 🎉 🕐
I like! done ✔️
Ommiting the buildplan! done ✔️ Hmm, omitting the configuration ✖️
Meaning that it should fetch the extra-dep's version if it shadowed the snapshot one when only given a package name? Makes sense! This behavior goes more inline with what you were suggesting in #1441, right?
👍
👍 makes sense in order to show a consistent behavior when handling the
👍 but also considering the config's custom indices/snapshots, right? same goes for the first suggestion |
Good point! The private package index option does mean that the config should always be loaded.
Yup
Yes indeed!
Yep! |
@luigy Hey! I'm doing a bit of a PR cleanup sweep, how's it going? I think potentially the discussion above is making this a bit complicated. How about lets get an initial version of this in - just the bit with the code cleanup |
Since this has languished for a while, I've added a link to it from the issue. Thanks for working on this @luigy, when we return to that issue, this code will be a helpful reference! |
first pass at #1391
preferred-versions
from indexpreferred-versions
are fetched unless explicitly asked by package identifierTODO:
loadBuildPlan
fromStack.BuildPlan
intoStack.Fetch
Stack.Upgrade
to only consider non-deprecated versions.New behavior: