Compile an instrumented library once, not twice Independent of #156, #157 and #158: this is `nix/mutationCheck.nix` only. A library whose test suites a check runs is built twice from the same source with the same flags. `addManifest` builds it for its manifest, and `builtTestPkg` builds it again with `--enable-tests`, which is what produces the test executables. The second derivation does not reference the first at all, so nothing is reused and a cold check pays for the whole library twice. The second build writes a manifest of its own, because the plugin runs over the library there exactly as it does in the first. For the same revision the two are byte-identical, which I checked by realising both outputs of one package and diffing them: ``` /nix/store/…-instrument-nix-ci-leader-data-manifest /nix/store/…-testsuite-nix-ci-leader-data-manifest IDENTICAL for the same revision ``` So the manifest now comes from whichever build the check needs anyway, and for a package whose suites are run here the instrument-only build is never realised. Verified on a caller that uses the `packages` argument: its mutation-report derivation went from referencing an `instrument` derivation to referencing none, while the test-suite derivation it reuses kept the same store path. A library whose suites belong to another package (`libraries` plus `tests`, which is how this repository's own checks are written) has no `--enable-tests` build, so it keeps the instrument-only one. Those check derivations are unchanged, byte for byte: ``` development: /nix/store/gxya59g3ka85nnqkbd217axbv0c77fak-sydtest-mutation-example-mutation-check.drv mutation-compile-instrumented-once: /nix/store/gxya59g3ka85nnqkbd217axbv0c77fak-sydtest-mutation-example-mutation-check.drv ``` Which is also the limitation worth stating: no check in this repository exercises the merged path, because none of them instruments a package and runs that package's own suites. The evidence for it is the manifest diff and the reference check above, both done against an out-of-tree caller.
Total
3m12s
Created Started Finished
| Time to Start | Worker time | Duration | Time to finish | Idle | |
|---|---|---|---|---|---|
| Config | 0s | 0s | 0s | 1s | 0s |
| Eval | 1s | 3m01s | 3m11s | 3m13s | 2m10s |
| Build | - | - | - | - | - |
| Suite | 0s | 3m02s | 3m12s | 3m13s | 2m11s |