-
Notifications
You must be signed in to change notification settings - Fork 96
ghcup but for individual packages #835
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
Comments
That was basically already discussed here as The related cabal ticket is haskell/cabal#6885 However, I'm not sure this is actually a feature that should live in GHCup. For installing GHC automatically, we should use cabal hooks: haskell/cabal#7394 GHCup is about installing toolchain. Trying to figure out what toolchain might actually work seems like a separate concern that neither fits cabal, nor GHCup, but I'm not sure. And this is a fundamentally fuzzy feature. The build might still fail in the end. |
I agree this is a duplicate of #109 (so I'll close it). Plus I think I agree that GHCup isn't the right place for such a feature. |
I'm not completely opposed to having it in GHCup, but in my opinion, there are two different concerns here:
For the first we can use the already mentioned cabal hooks (if they ever get completed). For the latter, this might be a use case for @phadej's cabal-extras: https://github.com/phadej/cabal-extras |
What if ghcup had a mechanism to inspect a cabal file (or project file), determine which version of GHC is needed to build it (based on base constraints or something), and install that version if necessary?
I suppose this could also be a cabal feature (
cabal setup
-> calls ghcup if necessary), but as a ghcup feature it would be a single entrypoint for any Haskell project.For the language-server use case, I guess ghcup should already be installed as part of enabling Haskell, and thus some version of cabal is also available. Thus it doesn't matter where this feature is implemented in that case.
For the power user use case (i.e. any use that involves opening a terminal),
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && cabal setup
is probably still short enough for any maintainer to recommend to contributors, so maybe cabal is the right place for this, since cabal will have a better chance of figuring out which version of ghc is needed.The downside of making it a cabal feature, of course, is the complicated chain of each tool being able to download and install the other...
The text was updated successfully, but these errors were encountered: