Skip to content
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

Use exact GHC versions rather than major-version #736 #784

Merged
merged 3 commits into from
Aug 14, 2015

Conversation

mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Aug 13, 2015

To test before commercialhaskell/stackage-content#8 is merged, replace this line with

    req = "https://raw.githubusercontent.com/fpco/stackage-content/c9165a5845370cf83b2dd373a66cb9a80f9bf74d/stack/stack-setup-2.yaml"

Description from the commit:

  • 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.

* 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.
@mgsloan mgsloan force-pushed the 736-exact-ghc-versions branch from 66d990a to fcedab0 Compare August 14, 2015 08:58
@@ -735,7 +735,7 @@ data CustomSnapshot = CustomSnapshot
instance FromJSON CustomSnapshot where
parseJSON = withObject "CustomSnapshot" $ \o -> CustomSnapshot
<$> ((o .: "compiler") >>= (\t -> maybe (fail $ "Invalid compiler: " ++ T.unpack t) return $ do
t' <- T.stripPrefix "ghc-" t
parseVersionFromString $ T.unpack t'))
GhcVersion v <- parseCompilerVersion t
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably shouldn't use this kind of match, as the compiler will hide the incomplete pattern match, and you're about to add more constructors (I presume).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make the change myself, it will also give me a chance to compile/test it locally.

@snoyberg snoyberg added this to the 0.2.0.0 milestone Aug 14, 2015
@snoyberg snoyberg merged commit ff24fb9 into master Aug 14, 2015
@mgsloan mgsloan deleted the 736-exact-ghc-versions branch October 16, 2015 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants