-
Notifications
You must be signed in to change notification settings - Fork 691
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
How should a package represent the fact that it does not support a particular GHC version? #9648
Comments
For dealing with project P having package K compiling (or not) with GHC X, we're able to have per-GHC, Px projects1 (that exclude K if it doesn't build with X). Having per-GHC packages, Kx is unconventional (but actually doable2, if not in the same directory) but that got me thinking is there another option?
Footnotes
|
Projects only work if everything is in one repository. I want this to work even with published packages in a package repository like Hackage. |
Projects using |
I agree that this would be useful, and the buildable approach sounds good to me. In #3072 is suggested an
Coupled with good error messages printing the assertion, perhaps it would bring the resolution you seek without having to drop into the |
I do think a solution that allowed for a user-supplied message would be nice. "Package not buildable in this environment, assertion failed: impl (ghc >= 7.0 && < 8.0)" is better, but "... 'foo does not support GHC 8.0 yet, see $link'" would be even better. I also think it might be nice to allow this at the top-level somehow. It's usually the case that this stuff is all-or-nothing for a package. |
I believe adding a message to If anybody wants to work on this I can advise/mentor. |
I agree. I think that we should just start by attaching a message to |
Suppose I have a component C of a package P that does not build with GHC X, and I want to signal this to my users. There are a few ways of doing this:
base
bounds that exclude the version ofbase
that ships with that GHCbase
, it's really GHC that's the problem.base
version compatibilityimpl(ghc)
andbuildable: False
buildable: False
#8905), in some circumstances cabal ignores the component entirely (e.g. when doingcabal build all
).tested-with
.None of these feel great to me. At the moment I think the
buildable: False
approach has the best UX, and it seems like the right way in principle, since it's a similar issue to "how should a package represent the fact that it does not support windows?". But it's still a bit unsatisfactory, and it's not widely used in the ecosystem.This problem bites us quite a bit at work, since we have a lot of packages and they tend to gradually get support for new GHC versions. But our big package builder doesn't have a good way of knowing when a package isn't expected to work on a particular GHC so we have to have a big manual list of exceptions. It would be nice if this was more discernable from the package metadata.
It would be nice also if cabal recommended an approach. In particular, if we solved #8905 then I think promoting the
buildable: False
approach would be a strict improvement over settingbase
bounds, since it could give a better error to users. We're all used to interpreting solver errors mentioningbase
as GHC version conflicts, but it's a terrible UX.The other idea I had is that maybe we could have some syntax to make this easy, e.g.:
supported-ghcs
on a component or at the top-level that implies the appropriate conditionals with nice messages.The text was updated successfully, but these errors were encountered: