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

Stack init could accept explicit versions #1370

Closed
ndmitchell opened this issue Nov 18, 2015 · 7 comments
Closed

Stack init could accept explicit versions #1370

ndmitchell opened this issue Nov 18, 2015 · 7 comments

Comments

@ndmitchell
Copy link
Contributor

For my test suite, I run things like hlint through stack init then stack build. At the moment, haskell-src-exts is not correct in the latest lts, so stack init fails. I would like to do:

stack init --resolver "haskell-src-exts-1.17.0"

Whether resolver takes package names, or I use --extra haskell-src-exts-1.17.0 doesn't matter, but it would be nice to init with explicit constraints for when stack otherwise fails.

@mgsloan
Copy link
Contributor

mgsloan commented Nov 21, 2015

Makes sense! --package haskell-src-exts-1.17.0 would be consistent with stack ghci's CLI. I'm in favor of such an addition.

@harendra-kumar
Copy link
Collaborator

With the changes in pull request #1583 you can achieve this by putting your preferred resolver in stack.yaml and haskell-src-exts-1.17.0 in extra-deps and then using stack solver.

@ndmitchell
Copy link
Contributor Author

@harendra-kumar - that doesn't help if I don't have a stack.yaml already, and here my use case is stack init to create the stack.yaml.

@mgsloan
Copy link
Contributor

mgsloan commented Jan 6, 2016

You can, however do stack init --force, and then add haskell-src-exts-1.17.0 to your extra-deps.

To me, this seems to handle the usecase nicely. I wouldn't be opposed to adding a --package flag if you still think it's needed and if it's easy to implement.

@ndmitchell
Copy link
Contributor Author

As soon as it involves the step "edit the stack.yaml" then it's no longer really suitable for running automatically on a buildbot for my use case, and I'd have to go and create a manual stack file, which is a bit of a shame. But maybe that's not a use case you support.

@harendra-kumar
Copy link
Collaborator

At the moment, haskell-src-exts is not correct in the latest lts, so stack init fails.

#1583 does everything possible to make stack init succeed. With that merged you can just use stack init --solver and it should give you a working stack.yaml with a snapshot resolver and haskell-src-exts in extra-deps. You can also use stack init --solver --resolver if you want to init with a specific resolver.

@ndmitchell
Copy link
Contributor Author

Ah, awesome :) - in that case I think there is enough to consider this fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants