Skip to content

kselftest: allow partial build failures#276

Merged
bhcopeland merged 1 commit into
kernelci:masterfrom
roxell:kselftest-nonfatal
Apr 21, 2026
Merged

kselftest: allow partial build failures#276
bhcopeland merged 1 commit into
kernelci:masterfrom
roxell:kselftest-nonfatal

Conversation

@roxell
Copy link
Copy Markdown
Collaborator

@roxell roxell commented Apr 17, 2026

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.

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>
@roxell roxell force-pushed the kselftest-nonfatal branch from 36e928b to 47fee84 Compare April 18, 2026 04:58
# by the kselftest-merge target.
dependencies = kernel headers
commands = {make} -C tools/testing/selftests/ install
nonfatal = true
Copy link
Copy Markdown
Member

@bhcopeland bhcopeland Apr 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Copy link
Copy Markdown
Member

@bhcopeland bhcopeland Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@bhcopeland bhcopeland merged commit ea13ad6 into kernelci:master Apr 21, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants