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

Expose cabal-install as a library #5473

Closed
quasicomputational opened this issue Jul 30, 2018 · 3 comments
Closed

Expose cabal-install as a library #5473

quasicomputational opened this issue Jul 30, 2018 · 3 comments

Comments

@quasicomputational
Copy link
Contributor

There's currently no good way to parse or render cabal.project files: there's code in cabal-install, but getting at it requires setting a flag with a description telling you not to do that very thing. The alternative for some use-cases is grubbing around with the plan.json, which ties you even more to cabal-install's implementation details.

#3781 is an issue from two years ago about exposing the solver somehow, which would be useful for Stack along with other things: again, these are using ugly hacks today like inspecting plan.json or trying to parse output that's only meant for human consumption. If I'm looking at things correctly, most of the separation work has been done since that issue was opened; the only thing holding people back is that cabal-install isn't sanctioned for use as a library.

What are the concerns that led to not exposing the library? If it's API ossification, I'm not so worried: cabal-install isn't a boot package, so users can lag behind on upgrading if necessary. It follows the PVP and I think we should continue to be bold in refactoring the API whenever it's a good idea; the only new thing we would have to do would be to make sure API changes go into the changelog, which we're not currently in the habit of doing.

@hvr
Copy link
Member

hvr commented Jul 30, 2018

@quasicomputational one of the problems is that we want to be able to do major-ver worthy changes at the API level within cabal-install without having to major ver bump (it's already limiting us for lib:Cabal); but once we expose the internal API this will make it a lot harder to backport changes; personally I have no interest to have to be considered of API consumer of a lib:cabal-install library (which may start requesting API features which are not relevant to the cabal-install frontend and cause additional maintainance overhead, or even complain when we "break" consumers by refactoring/removing/moving-around stuff; and as you mention start maintaining API-level changelogs and @since annotations for lib:cabal-install -- I'm personally not willing to do that) and start to apply the PVP to the cabal-install codebase; in my view, exposing cabal-install as an API would considerably increase the cost of cabal-install development and maintenance

@hvr
Copy link
Member

hvr commented Jul 30, 2018

Duplicate of #1597

@hvr hvr marked this as a duplicate of #1597 Jul 30, 2018
@quasicomputational
Copy link
Contributor Author

Thanks for the cross-reference - "cabal-install" and "library" are not very precise search terms in the bugs here... I'll close this one and repost a precis of the new information there.

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

No branches or pull requests

2 participants