-
Notifications
You must be signed in to change notification settings - Fork 842
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
Allow --pvp-bounds
to use multiple snapshots
#1568
Comments
Another problem with this is that the .cabal file's bounds are an input to --pvp-bounds (if the .cabal file specifies a bound, it will be passed through unchanged), so making it an output would basically mean that the bounds will never change again even if you change the resolver. |
Yes, this is tricky. A few possible ways to get around this:
|
I think the first step towards making this happen is to open an issue which specifies how multiple configurations work, and how configuration inheritance works. This task can be considered entirely separately to this stuff about determining version constraints. Despite earlier qualms with making stack.yaml more complicated, between this issue, #846 (comment) , and the general commonness of having multiple configurations, I'm thinking it's worth it! We just need to define the following:
|
This issue was one of the motivations to add support for |
I've just discussed something related to this in #haskell-stack . @chreekat and @bitemyapp have convinced me that we probably shouldn't extend the stack.yaml format with such fanciness. So, instead I think the functionality described here should be implemented in a tool external to stack. Here's how that might look:
I'd be keen on helping with such a tool if someone wants to implement it. |
While I agree that it's good to keep How about specifying the extra |
It recently occurred to me that we could have
--pvp-bounds
use broader constraints, by having it take into account multiple stackage snapshots. The simplest cut at this would be a funky field likeother-resolvers: [lts-2.0, lts-3.19]
. This would broaden the constraints placed on dependencies, to include the versions in both snapshots.Ideally, this feature would be implemented such that these configurations actually build and pass tests. I think this can be done by having
sdist
andupload
support building and testing the tarballs against all configurations (#717).Since you might need a different set of
extra-deps
for a given resolver, we really need to have multiple project configurations. I can think of two ways to do this:*.yaml
files.With configuration inheritance, I bet just overriding the resolver would work for many people's usages. So, I'm beginning to lean towards doing something like that. I don't think it'd be all that complicated (it's already a monoid, we're already using inheritance for the non-project options), and it's useful for other reasons.
I think this is a very principled way of setting your version constraint bounds: pick the extremes of the snapshots that you want to support, and perhaps even a few in the middle. Then, actually test that these snapshots work. This does not guarantee that all the versions in the middle will work, it's likely that they will. For the exceptional cases where this doesn't hold, the user can put fancier version constraints into the cabal files, which won't get overridden.
Side note: Another thing to consider is whether this should support inplace modification of cabal files. I think it's weird that we can end up in a situation where the repo's cabal file doesn't have constraints, whereas the hackage package does. However, implementing this shouldn't be blocked on that - refactoring cabal files seems tricky.
The text was updated successfully, but these errors were encountered: