Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How can I downgrade a package? #658

Closed
lippling opened this issue Jul 22, 2015 · 9 comments
Closed

How can I downgrade a package? #658

lippling opened this issue Jul 22, 2015 · 9 comments
Milestone

Comments

@lippling
Copy link

Hi,

I have problems with the tls package and want to downgrade it from 1.3.1 to 1.2.17. How can I do that?

I have the following files:

haskell-apns.cabal:

build-depends: [...]
               , tls == 1.2.17  -- I tried to pin down the version, originally there was no version constraint
               [...]

stack.yaml:

packages:
- '.'
extra-deps: ["tls-1.2.17", "x509-validation-1.5.2", "x509-1.5.1", "x509-store-1.5.0"]
resolver: nightly-2015-07-19

1.2.17 is built, but 1.3.1 is used and e.g. stack ghci or stack unpack use 1.3.1.

Any ideas?

PS: I use stack: Version 0.1.2.1, Git revision 500a55336af2245d2bcb3ed4201b126a030088c7, but I also tried 0.1.2.0.

@DanBurton
Copy link
Contributor

How odd. I just want to confirm that your expectations are correct, and this is indeed a bug.

@lippling
Copy link
Author

Is there anything I could do as a workaround until the bug ist fixed?

@DanBurton
Copy link
Contributor

As a workaround, you could try using resolver: ghc-7.10 and then specifying explicit versions for all of your dependencies in extra-deps.

@DanBurton
Copy link
Contributor

Pinging @chrisdone and @snoyberg to draw attention to this bug; I remember commenting on related code a while ago and thought it was fixed since then.

@snoyberg snoyberg added this to the Support milestone Jul 23, 2015
@snoyberg
Copy link
Contributor

I was just looking this over. I think there are two different issues at play:

  1. stack unpack ignores all version constraints in the stack.yaml file. This is actually by design: stack unpack is not a project level command, and therefore does not use project settings. This may be confusing, but is designed to work in the same way as the cabal unpack command. You can give it an explicit version via stack unpack foo-1.2.3
  2. stack ghci allows GHC itself to choose the versions of packages, and unfortunately GHC's shadowing algorithm is not working the way we want. It seems like stack ghci needs to be explicit about which package versions/IDs it's using, likely by passing in -package flags. I believe you can work around this with something like stack exec -- ghci -package foo-1.2.3.

Am I reading correctly that these are the two issues being reported?

@lippling
Copy link
Author

@snoyberg you are right. stack build works and stack exec -- ghci -package tls-1.2.17 also seems to work. Why does stack ghci --package tls-1.2.17 not work?

Thanks!

@snoyberg
Copy link
Contributor

Because of what I mentioned above: the stack ghci command is not passing any -package flags to ghci (though it probably should). --package is just telling stack to make sure that that package is installed, but that information is not being communicated to GHCi in any way.

@lippling
Copy link
Author

Ok, thanks for the clarfication.

@snoyberg
Copy link
Contributor

I've opened up #678 to track the necessary changes to stack ghci. I believe that covers everything, so I'll close this out.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants