-
Notifications
You must be signed in to change notification settings - Fork 841
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
stack build --copy-bins --test only copies binaries after testing #805
Comments
I also ran into this and reported with #701, and I'm not sure what the ideal solution is. Maybe binaries should be copied to the local install root even when tests don't pass (and do it before running tests)? |
I did comment on that in the previous issue:
I think the right approach is to modify the test suite to use the executable from the There may be some issues though around not rebuilding the executable without explicitly requesting it. This is an optimization for the common case of testing a library. You may need to explicitly state that you want to build both the executable and test suite, e.g. |
IMO, the real bug here actually is that doing With the current cabal interface, I can't think of a good way to solve this. |
The question is whether we wait for cabal or do what you suggest and look into |
I wouldn't recommend waiting for cabal, getting a change made and released On Tue, Aug 18, 2015, 1:11 PM Mateusz Kowalczyk [email protected]
|
This is quickly veering off course from the original issue description, but here's my plan of attack right now (inspired by an idea @gregwebs had a few months back):
Then: cabal_macros.h won't change between stack/src/Stack/Build/ConstructPlan.hs Line 135 in 4159ec0
Which I believe will also adversely affect you. |
That sounds like quite a bit of gymnastics for something that is a very common use case: perform system-level testing of the binary itself, e.g. to check that piping scripts through stdin and parsing all the command line arguments yields the correct result. I agree that performing say The fact that |
Actually, I didn't realize it when initially reading the issue, but I think the change I made did just that. Specifically, I think the culprit here was: stack/src/Stack/Build/ConstructPlan.hs Line 135 in 4159ec0
In other words: before #815, we weren't rebuilding the executable at all when doing Can you try out the #815 PR and see how that works for you? |
The behavior on master for this command should now be:
If this is not happening, please reopen. |
Currently we can not run tests which rely on a binary produced during build. Something like
works but rebuilds twice. Ideally
stack build --test --bench
would make binaries produced available before the tests run so we can use the executable for the testing.The text was updated successfully, but these errors were encountered: