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

Add cabal-hash revision info when displaying recommended packages when failing to construct buildplan #4068

Merged
merged 3 commits into from Jun 7, 2018

Conversation

Projects
None yet
2 participants
@tdietert
Contributor

tdietert commented Jun 6, 2018

This PR addresses the following issue #3925

TODO:

  • Add changes to ChangeLog.md
  • Test the output of failed build plan package recommendations

Tested by removing the rio extra-dependency in the stack.yaml file and then trying to build the package with the newly generated stack executable.

. . .

  * Recommended action: try adding the following to your extra-deps in /home/thomas/github/stack/stack.yaml:

rio-0.1.2.0@sha256:cb2a65cee1c0450815002ca890633215e4544b5c1c9f7091a950142c6efe8f3f
@@ -22,7 +22,9 @@ import Stack.Prelude hiding (Display (..))
import Control.Monad.RWS.Strict hiding ((<>))

This comment has been minimized.

@snoyberg

snoyberg Jun 6, 2018

Contributor

Can you add a note to the ChangeLog about the change and which issue it resolves?

This comment has been minimized.

@tdietert

tdietert Jun 7, 2018

Contributor

I have updated the changelog 👍

@@ -135,7 +137,7 @@ data Ctx = Ctx
, ctxEnvConfig :: !EnvConfig
, callStack :: ![PackageName]
, extraToBuild :: !(Set PackageName)
, getVersions :: !(PackageName -> IO (Set Version))
, getVersions :: !(PackageName -> IO (HashMap Version (NE.NonEmpty CabalHash)))

This comment has been minimized.

@snoyberg

snoyberg Jun 6, 2018

Contributor

Regarding our discussion: can you replace the NonEmpty CabalHash with either [CabalHash] or Maybe CabalHash and remove the usage of partial functions below? Alternatively, you could modify the original [CabalHash] to be a NonEmpty CabalHash.

@tdietert

This comment has been minimized.

Contributor

tdietert commented Jun 7, 2018

Unfortunately, any modification to the [CabalHash] type that represents one or two cabal hashes (the latter encoding both the hash of the cabal file with and without carriage returns) returns the error:

/home/thomas/github/stack/src/Stack/PackageIndex.hs:416:21: error:
    • Exception when trying to run compile-time code:
        For Stack.Types.PackageIndex.PackageCache GHC.Tuple.()

Since I don't really have the time to dig into the template-haskell code right now, I will remove the use of the partial function Data.List.NonEmpty.fromList and instead use Data.List.NonEmpty.nonEmpty to capture the notion that the version may not have a properly parsed tarball file neither/nor correctly parshes/hashes the cabal revisions.

tdietert added some commits Jun 7, 2018

@tdietert

This comment has been minimized.

Contributor

tdietert commented Jun 7, 2018

This PR should be ready to go barring no other requested changes 🎉

case latestApplicableVersion range vs of
Nothing -> pure Nothing
Just lappVer -> do
let mlappRev = join (HashMap.lookup lappVer vsAndRevs)

This comment has been minimized.

@snoyberg

snoyberg Jun 7, 2018

Contributor

Nice join!

@snoyberg snoyberg merged commit 33d6edd into commercialhaskell:master Jun 7, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment