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 library directly (instead of cabal-install executable) for building #1107

Closed
snoyberg opened this issue Jan 7, 2016 · 3 comments
Closed

Comments

@snoyberg
Copy link
Contributor

snoyberg commented Jan 7, 2016

Advantages:

  • No need to build cabal-install before running the actual build
  • Avoid problems with accidentally polluting the user-wide package database
  • Less surface area for bugs to creep in

Disadvantages:

  • Slightly different build flow than projects normally receive, possibly resulting in bugs
  • Concrete example: if a project lists build-type as Simple and then has a different Setup.hs, a naive implementation may not compile properly (I know this affects Nix and affected Stack in the past)
@DanBurton
Copy link
Contributor

How much of cabal-install would we be reimplementing in order to accomplish this? Are the appropriate points of abstraction available in the Cabal library such that this would be trivial to implement (in stackage-curator, I presume)?

@snoyberg
Copy link
Contributor Author

snoyberg commented Jan 7, 2016

I think so, I just need to research it a bit. We wouldn't even be using the Cabal library as such, but rather runghc Setup.hs, which has a very similar command line API as cabal-install. The big thing we don't need is cabal-install's ability to solve dependencies and download them for us from Hackage, so we may be golden here.

@DanBurton
Copy link
Contributor

runghc Setup.hs

Oh right! That makes a lot of sense. 👍

snoyberg added a commit to fpco/stackage-curator that referenced this issue Jan 20, 2016
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

2 participants