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

Too much recompilation when changing test targets #3732

Closed
snoyberg opened this Issue Jan 1, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@snoyberg
Contributor

snoyberg commented Jan 1, 2018

I believe this is a side-effect of the changes in #3565, implemented for #3483. CC @tswelsh. To repro, I created two packages, foo and bar, with bar depending on foo. I then ran the commands:

$ stack test --no-run-tests
$ stack test --no-run-tests bar

Expected: the second command should do nothing, as all tests, libraries, and executables have already been run.

Actual: I saw the following output:

$ stack test --no-run-tests bar
bar-0.1.0.0: unregistering (missing dependencies: foo)
foo-0.1.0.0: unregistering (local file changes: app/Main.hs test/Spec.hs)
foo-0.1.0.0: build (lib + exe)
foo-0.1.0.0: copy/register
bar-0.1.0.0: configure (lib + exe + test)

Notice how foo is unregistered, due to Stack thinking that the files changed. This occurs because the test suite and executable files are no longer included at all in the list of files in the package.

Instead, we should track, for each package, the files needed on a per-component basis, and only rebuild based on this. This may tie in with @ezyang's work on per-component builds, not sure.

@tswelsh are you interested in taking a stab at this one?

@snoyberg snoyberg added this to the P0: Blocking release milestone Jan 1, 2018

@tswelsh

This comment has been minimized.

Contributor

tswelsh commented Jan 1, 2018

Sure, I can take a look at it. I should be able to find some time this week hopefully.

@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Jan 11, 2018

Resolved via #3750, thanks!

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