Description
Describe the feature
Currently we have the build-tool-depends
feature. This is normally used to ensure build tools are built so that the build tool can be used during the build process.
We have been abusing this feature for another purpose which is to ensure that executables are built before tests are run. This is useful for CLI tests or integration tests where you would want the CLI executable to integration component to be already built before running the test.
This is especially useful to ensure that we aren't accidentally picking up stale executables that haven't been built which is a problem we've experienced in the development process and caused much confusion.
Unfortunately, build-tool-depends
does a lot more than just ensuring the executable is built, which incurs additional costs. Specifically, it seems to significantly at to constraint resolution times. For example:
With build-tool-depends
:
cabal build --dry-run all 15.44s user 0.61s system 95% cpu 16.828 total
Without build-tool-depends
:
cabal build --dry-run all 0.48s user 0.10s system 83% cpu 0.699 total
On Windows, for some reason we are forced to use reorder-goals
or the constraint resolution fails, but this can bring the constraint resolution time to about 20 minutes.
If we could avoid using build-tool-depends
, we hope to cut constraint resolution times by 66%, which is a substantial gain.