kselftest: allow partial build failures#276
Conversation
Many selftests do not cross-compile. The kernel kselftest Makefile now fails if any sub-target fails to build. The install target depends on all. When all fails, make skips install and nothing gets packaged. Split into two make steps. Run all first, then install with -o all to skip the dependency. Add a nonfatal flag so command failures do not stop the build. Mark kselftest and kselftest-bpf as nonfatal. Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
36e928b to
47fee84
Compare
| # by the kselftest-merge target. | ||
| dependencies = kernel headers | ||
| commands = {make} -C tools/testing/selftests/ install | ||
| nonfatal = true |
There was a problem hiding this comment.
I'm not in favour of nonfatal by default. A partial tarball is better than nothing, but silently passing a degraded build pushes debugging down to the CI consumer, who now has to dig through logs to notice anything broke. I get a partial kselftest file, could be seen as better rather than not having one at all.
A --nonfatal= CLI option could address that, but it's not much better: every pipeline would need to adopt it, and it still hides failures once enabled.
Could we instead keep the two-step make all && make -o all install change, but surface nonfatal failures as a visible warning in the build status e.g. a PASS_WITH_WARNINGS state or similar to what went down? That way, the partial tarball is still produced, CI can detect the degradation, and nothing is hidden.
Thinking out loud through this comment :)
There was a problem hiding this comment.
I gave the patch a go and still ended up with an empty tarball. Looking at it, -o all applies to the outer make, but the Makefile invokes a fresh sub-make per subdir that has its own install: all, so the same partial-build failure repeats.
Put together this. Which seems to keep the install step happy and was able to get bpf tarball out of it.
There was a problem hiding this comment.
I think the PASS_WITH_WARNINGS make sense, but lets do that in a followup PR, this PR is just get the build to create a tarball. And lets see how we can get bpf to build or target kselftest-bpf and create a new PR for that too.
does that make sense?
Many selftests do not cross-compile. The kernel kselftest Makefile now fails if any sub-target fails to build.
The install target depends on all. When all fails, make skips install and nothing gets packaged.
Split into two make steps. Run all first, then install with -o all to skip the dependency. Add a nonfatal flag so command failures do not stop the build.
Mark kselftest and kselftest-bpf as nonfatal.