-
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
Specify full version of GHC, not just major version WAS: Stack installs wrong version of GHC #736
Comments
Stack only cares that the correct GHC major version (e.g. 7.10.*) is used for a snapshot, and |
Why? The snapshot nightly-2015-06-16 clearly states that it's based on Related back compatibility breaking change: https://downloads.haskell.org/~ghc/7.10.1/docs/html/libraries/ghc/TcRnDriver.html https://downloads.haskell.org/~ghc/7.10.2/docs/html/libraries/ghc-7.10.2/TcRnDriver.html Related issue: ucsd-progsys/liquidhaskell#420 |
I think we'll have to see if @snoyberg can give more detail about the reasoning, but my assumption is because it was thought to be the more desirable behaviour in most cases. And we must have believed "Patchlevels are bug-fix releases only, and never change the programmer interface to any system-supplied code." I could definitely see supporting a more strict interpretation of GHC versions being desirable, at least optionally, so worth discussing here. In the mean time, you should be able to work around this by installing GHC 7.10.1 yourself and using |
This was by design originally, for exactly the reasons @borsboom mentioned, but I was conflicted about it, and in hindsight think it was the wrong decision. I'm in favor of moving to:
One concern with a change like this is that it won't play nicely with custom GHC builds, so we need to consider how exactly to deal with that situation. |
* Requires the exact GHC version specified by the snapshot. * Deprecates major-version (ghc-7.10, ghc-7.8) resolvers, but still supports them. They resolve to the newest installed / available ghc matching that number. * Changes the format of stack-setup.yaml, and so changes which URL is used to find it (in order to not break old stack versions). * Refactors ensureTool code, as it already had a lot of special cases, which I found confusing. Main cause is that I needed to pass in a 'CompilerVersion' instead of 'Version', but just for installing ghc, not for git.
* Requires the exact GHC version specified by the snapshot. * Deprecates major-version (ghc-7.10, ghc-7.8) resolvers, but still supports them. They resolve to the newest installed / available ghc matching that number. * Changes the format of stack-setup.yaml, and so changes which URL is used to find it (in order to not break old stack versions). * Refactors ensureTool code, as it already had a lot of special cases, which I found confusing. Main cause is that I needed to pass in a 'CompilerVersion' instead of 'Version', but just for installing ghc, not for git. * Introduces a 'CompilerVersion' type, and changes some naming to specify that compiler versions are being passed around rather than ghc versions. The change could be a simpler without this, but this will be helpful for GHCJS support.
I've opened a PR for this: #784
How about handing this case with the |
* Requires the exact GHC version specified by the snapshot. * Deprecates major-version (ghc-7.10, ghc-7.8) resolvers, but still supports them. They resolve to the newest installed / available ghc matching that number. * Changes the format of stack-setup.yaml, and so changes which URL is used to find it (in order to not break old stack versions). * Refactors ensureTool code, as it already had a lot of special cases, which I found confusing. Main cause is that I needed to pass in a 'CompilerVersion' instead of 'Version', but just for installing ghc, not for git. * Introduces a 'CompilerVersion' type, and changes some naming to specify that compiler versions are being passed around rather than ghc versions. The change could be a simpler without this, but this will be helpful for GHCJS support.
One very common case of a custom GHC build is when using Docker images, which almost always contain a custom GHC build. |
It's fine if it's a custom build as long as |
How about this heuristic: match as many components of the version as are On Fri, Aug 14, 2015, 6:35 AM Emanuel Borsboom [email protected]
|
Hmm, I like it! I'll update the PR with that. This means we won't actually be deprecating the major-version resolvers, right? Heck, |
I have one other idea to consider: what if we had:
If
Where a value of I'm not convinced either of these is a good idea tbh. |
One mildly problematic aspect of this is that GHCJS will have two version numbers (GHCJS version, GHC version it's built against), and this policy would be applied to both. I'm thinking that the heuristic you mentioned earlier is enough to handle the common case for custom builds, and The only thing I don't like about the "matching prefix" approach is that it doesn't allow you to specify a fixed version, as there's always an implicit wildcard. So, one possibility would be to have |
Sorry to beat this to death... but I don't like the idea of relying on For For the GHC check, the easy case is where the user explicitly states the GHC version desired (i.e., the ghc- resolver or the custom resolver). However, when using a Stackage snapshot (lts- or nightly-), the GHC version will always have three components in it. Here are the use cases I can see:
I think we should have a sum type, resolver: lts-3.0
compiler-check: match-minor # the default
# compiler-check: match-exact
# compiler-check: newer-minor As for the GHCJS case, I see two options: either we say that using the same compiler-check for both GHC and GHCJS is valid (seems valid to me offhand), or we allow some kind of mapping for it, e.g.: resolver: ghcjs-..... # I forgot the exact syntax
compiler-check:
ghc: match-minor
ghcjs: newer-minor |
That seems like a good solution to me, lets go with this approach. |
* Stack now defaults to matching the minor version specified in the resolver / snapshot, whereas before only the major version was significant. * Adds a 'compiler-check' field which specifies a policy for checking the GHC version. * Changes the format of stack-setup.yaml, and so changes which URL is used to find it (in order to not break old stack versions). * Refactors ensureTool code, as it already had a lot of special cases, which I found confusing. Main cause is that I needed to pass in a 'CompilerVersion' instead of 'Version', but just for installing ghc, not for git. * Introduces a 'CompilerVersion' type, and changes some naming to specify that compiler versions are being passed around rather than ghc versions. The change could be a simpler without this, but this will be helpful for GHCJS support.
* Stack now defaults to matching the minor version specified in the resolver / snapshot, whereas before only the major version was significant. * Adds a 'compiler-check' field which specifies a policy for checking the GHC version. * Changes the format of stack-setup.yaml, and so changes which URL is used to find it (in order to not break old stack versions). * Refactors ensureTool code, as it already had a lot of special cases, which I found confusing. Main cause is that I needed to pass in a 'CompilerVersion' instead of 'Version', but just for installing ghc, not for git. * Introduces a 'CompilerVersion' type, and changes some naming to specify that compiler versions are being passed around rather than ghc versions. The change could be a simpler without this, but this will be helpful for GHCJS support.
@snoyberg I've implemented this and tested it some, seems to work! I haven't tried it against any funky installed ghc versions, but the |
Looking good. Let's move discussion (if necessary) to the PR (#784). Closing this. |
Great work guys. 👍 |
Using resolver
nightly-2015-06-16
which is based onghc-7.10.1
causes stack to installghc-7.10.2
when I runstack setup
.It's also not possible to specify
ghc-7.10.2
as a resolver. I can only specifyghc-7.10
which makes no sense as that's not even a real version of ghc. It doesn't mean anything as version numbers are arbitrary incremented.The text was updated successfully, but these errors were encountered: