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

Comments

Projects
None yet
2 participants
@snoyberg
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

This comment has been minimized.

Show comment
Hide comment
@DanBurton

DanBurton Jan 7, 2016

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)?

Contributor

DanBurton commented Jan 7, 2016

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

This comment has been minimized.

Show comment
Hide comment
@snoyberg

snoyberg Jan 7, 2016

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@DanBurton

DanBurton Jan 7, 2016

Contributor

runghc Setup.hs

Oh right! That makes a lot of sense. 👍

Contributor

DanBurton commented Jan 7, 2016

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

@snoyberg snoyberg closed this in 99da9c5 Jan 20, 2016

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