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

Also build executables when running tests #701

Closed
mgsloan opened this issue Aug 1, 2015 · 2 comments
Closed

Also build executables when running tests #701

mgsloan opened this issue Aug 1, 2015 · 2 comments
Assignees
Milestone

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Aug 1, 2015

This issue has come up in the context of ide-backend.

The problem is that currently I need to run stack build before stack test. Otherwise, the ide-backend-server executable can be out of date. It seems that stack test doesn't build things that aren't directly required by packages which contain test-suites.

For now, stack build ide-backend-server && stack test is ok, but it requires an expensive reconfigure + rebuild.

mgsloan added a commit to fpco/ide-backend that referenced this issue Aug 1, 2015
+ update README.md

See commercialhaskell/stack#701 for why this
is necessary.
@snoyberg
Copy link
Contributor

snoyberg commented Aug 5, 2015

I found this description confusing, and had to reread it about 4 times before I realized what's actually happening (or what I actually think is happening): there's no way in a Cabal file to state a dependency on an executable-only package. Therefore, stack has no way of knowing that you want it to build/install ide-backend-server before testing ide-backend.

There may be something else occurring that I'm not getting (the title of this issue implies there is), but I'm not certain what it is. I can guess that there's also the fact that the runghc Setup.hs install comes after tests finish, but that's intentional and correct: we shouldn't be doing any installing of something which fails tests.

@snoyberg snoyberg added this to the 0.3.0.0 milestone Aug 5, 2015
@mgsloan
Copy link
Contributor Author

mgsloan commented Aug 5, 2015

Sorry for the confusion!

there's no way in a Cabal file to state a dependency on an executable-only package

Yes, that is a contributing problem, but I'm not seeking to solve that here.

I can guess that there's also the fact that the runghc Setup.hs install comes after tests finish, but that's intentional and correct: we shouldn't be doing any installing of something which fails tests.

That makes sense, and explains the behavior I'm seeing. The problem stands, though, which is if I only use stack test, we'll be testing against an old version of ide-backend-server. The recompilation actually doesn't seem to be as redundant as I'd thought. Having to do stack build && stack test isn't so bad.

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