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

Better component-based build system #834

Closed
snoyberg opened this issue Aug 23, 2015 · 3 comments
Closed

Better component-based build system #834

snoyberg opened this issue Aug 23, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@snoyberg
Copy link
Contributor

There are a number of annoyances with how Cabal works around individual components builds:

  • Reconfiguring rewrites cabal_macros, leading to unnecessary recompiles
  • Copying fails if not all components are built
  • Requiring libraries to be installed if any of the components require them

After a lot of thought, I think the core problem is that the list of components to build should be an argument to ./Setup.hs configure, not ./Setup.hs build. Another way of thinking about that would be: even though a single cabal file contains multiple components, stack wants to treat each of those components as its own package. I think this will solve a lot of problems for us (like the ugly --enable-tests hack I added recently).

I'm considering pushing this forward on the Cabal side (where I- as usual- expect resistance), but wanted feedback from others first if there are downsides to this approach. I've also been thinking about short-term hacks to try to get this working. It's terribly ugly, but the thought that came to mind was to create temporary .cabal files during the build for each component.

If this rambling is too incoherent, please tell me and I can clarify.

@snoyberg snoyberg self-assigned this Aug 23, 2015
@snoyberg snoyberg added this to the 0.3.0.0 milestone Aug 23, 2015
@phadej
Copy link
Collaborator

phadej commented Aug 28, 2015

I personally wouldn't resist having cabal configure --enable-tests --test-suites=suite1,suite2, because sometimes I don't care about the third suite. Same applies to the executables and especially to the benchmarks!

@snoyberg
Copy link
Contributor Author

Opened upstream issue with Cabal: haskell/cabal#2802

@snoyberg
Copy link
Contributor Author

Superseded by #1166

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

No branches or pull requests

2 participants