Skip to content

Too much recompilation when changing test targets #3732

@snoyberg

Description

@snoyberg

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions