-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ninja backend: don't rebuild all tests by default
When running `ninja all` we shouldn't build testsuite programs as these might not be wanted e.g. in order to just install the project. We do want them to be built when running `ninja test`. Since meson 0.63 we actually have a dedicated ninja alias for test dependencies -- move these from the "all" rule to the dedicated test/benchmark rules.
- Loading branch information
1 parent
8a8234c
commit 95c2b9c
Showing
3 changed files
with
29 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Test targets no longer built by default | ||
|
||
The `ninja test` / `meson test` rules have been reworked to no longer force | ||
tests to be built unnecessarily. The correct, guaranteed workflow for this has | ||
been to either run `ninja test` or `meson test`, both of which rebuild | ||
dependencies on demand. *Also* building test-only binaries as part of | ||
installing the project (`ninja && ninja install`) was unnecessary and has no | ||
use case. | ||
|
||
Some users might have been relying on the "all" target building test | ||
dependencies in combination with `meson test --no-rebuild` in order to skip | ||
calling out to ninja when running tests. The `--no-rebuild` option has always | ||
been intended for expert usage -- you must provide your own guarantees that it | ||
will work -- and it should be noted that this change means test programs are no | ||
longer guaranteed to have been built, depending on whether those test programs | ||
were *also* defined to build by default / marked as installable. The desired | ||
behavior of building test programs in a separate stage can be restored by | ||
building `ninja all meson-test-prereq` (or `meson-benchmark-prereq` for running | ||
benchmarks), as these prereq targets have been available since meson 0.63.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters