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 cabal-install dependency-solver as a library #1615

Closed
harendra-kumar opened this issue Jan 6, 2016 · 5 comments
Closed

Use cabal-install dependency-solver as a library #1615

harendra-kumar opened this issue Jan 6, 2016 · 5 comments

Comments

@harendra-kumar
Copy link
Collaborator

If we can factor out the cabal dependency solver and other related code required for the stack solver as a library we can do more advanced stuff in stack solver. This will require a change in the cabal-install package.

  1. We will not have to depend on an external cabal-install executable. See stack init --solver should install and use its own GHC #1149 (comment)

  2. We will not have to parse cabal output which is fragile and can break whenever cabal changes its display output. Not having to parse will allow us to extract a lot more information with ease and we can do more advanced tricks with the solver.

@mgsloan
Copy link
Contributor

mgsloan commented Jan 8, 2016

Makes sense to me! Another benefit of this is that it means the solver version is tied to the stack version, so behaviors will be reproduced more. The downside of this is that it makes it a little more difficult to use a newer version of cabal-install, but that seems fine.

If the cabal project is willing to make this change, I'd be in favor of using cabal-install as a library. You have a better idea than I as to whether it's worth the work.

@harendra-kumar
Copy link
Collaborator Author

harendra-kumar commented Jan 8, 2016

I would not be in favor of maintaining it separately. The change has to be made in upstream so that it is automatically maintained. I am not even sure whether it is worth the effort. For that I will have to investigate a bit to know how much effort is really involved.

#1616 can still be fixed and (perhaps qucikly) in a sort of hacky way by parsing the output if this cannot be done. But it will be cool and pave way for more stuff in future if we can do this.

@sjakobi
Copy link
Member

sjakobi commented Jul 14, 2016

The cabal project seems to have made a bunch of progress in separating the solver code, starting with haskell/cabal#3381, but so far the Distribution.Solver.* modules still belong to the cabal executable.

@harendra-kumar
Copy link
Collaborator Author

Solver seems to be broken again with newer version of cabal. See #2585 . I think we need to get this done to get rid of issues due to breaking changes in cabal output every once in a while.

@snoyberg
Copy link
Contributor

Let's move this discussion to #4410.

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