From: sashiko-bot@kernel.org
To: "Ricardo B. Marlière" <rbm@suse.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH v4 05/10] selftests/bpf: Tolerate test file compilation failures
Date: Thu, 13 Aug 2026 23:37:32 +0000 [thread overview]
Message-ID: <20260813233736.E61E31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260406-selftests-bpf_misconfig-v4-5-9914f50efdf7@suse.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Masking test compilation failures breaks the linking step and aborts the test runner, completely breaking the test suite.
--
--- Patch [5]: [PATCH v4 05/10] selftests/bpf: Tolerate test file compilation failures ---
commit fa90c61b664da4eb761a6d8759626a636f99483a
Author: Ricardo B. Marlière <rbm@suse.com>
selftests/bpf: Tolerate test file compilation failures
This commit modifies the BPF selftests Makefile to make individual test
compilation non-fatal. It removes the output object on failure, prints a
SKIP-TEST marker, and skips BTFIDS post-processing for absent objects.
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 72f576a8236a1..e67f9c4cb5d70 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -688,11 +688,14 @@ $(TRUNNER_TEST_OBJS): $(TRUNNER_OUTPUT)/%.test.o: \
> $(TRUNNER_TESTS_DIR)/%.c \
> | $(TRUNNER_OUTPUT)/%.test.d
> $$(call msg,TEST-OBJ,$(TRUNNER_BINARY),$$@)
> - $(Q)cd $$(@D) && $$(CC) -I. $$(CFLAGS) -MMD -MT $$@ -c $(CURDIR)/$$< $$(LDLIBS) -o $$(@F)
> + $(Q)cd $$(@D) && $$(CC) -I. $$(CFLAGS) -MMD -MT $$@ -c $(CURDIR)/$$< $$(LDLIBS) -o $$(@F) || \
> + ($(RM) $$(@F); printf ' %-12s %s\n' 'SKIP-TEST' '$$(notdir $$@)' 1>&2)
[Severity: High]
Will masking the compilation failure here break the subsequent linking step
and the test runner?
Because Make evaluates $$^ in the linker command line, it expands to all
defined .test.o prerequisites, including the missing ones. The missing
.test.o file is then passed to the compiler during linking, which fails with a
'No such file or directory' error and halts the build.
Furthermore, even if the linker step is bypassed by filtering out missing
files, the test runner itself aborts execution entirely if a test function
is NULL:
tools/testing/selftests/bpf/test_progs.c:main() {
...
if ((test->run_test == NULL && test->run_serial_test == NULL) ||
(test->run_test != NULL && test->run_serial_test != NULL)) {
fprintf(stderr, "Test %d:%s must have either test_%s() or "
"serial_test_%sl() defined.\n", test->test_num,
test->test_name, test->test_name, test->test_name);
exit(EXIT_ERR_SETUP_INFRA);
}
...
}
When test_progs initializes, it enumerates all tests by scanning .c files.
The missing .test.o file causes its weak function symbol to resolve to NULL,
aborting the entire test suite on startup.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260406-selftests-bpf_misconfig-v4-0-9914f50efdf7@suse.com?part=5
next prev parent reply other threads:[~2026-08-13 23:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 18:22 [PATCH v4 00/10] selftests/bpf: Tolerate partial builds across kernel configs Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 01/10] selftests/bpf: Fix test_kmods KDIR to honor O= and distro kernels Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 02/10] selftests/bpf: Tolerate BPF and skeleton generation failures Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 03/10] selftests/bpf: Avoid rebuilds when running emit_tests Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 04/10] selftests/bpf: Make skeleton headers order-only prerequisites of .test.d Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 05/10] selftests/bpf: Tolerate test file compilation failures Ricardo B. Marlière
2026-08-13 23:37 ` sashiko-bot [this message]
2026-04-06 18:22 ` [PATCH v4 06/10] selftests/bpf: Allow test_progs to link with a partial object set Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 07/10] selftests/bpf: Tolerate benchmark build failures Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 08/10] selftests/bpf: Provide weak definitions for cross-test functions Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 09/10] selftests/bpf: Skip tests whose objects were not built Ricardo B. Marlière
2026-04-06 18:22 ` [PATCH v4 10/10] selftests/bpf: Tolerate missing files during install Ricardo B. Marlière
2026-04-10 10:06 ` [PATCH v4 00/10] selftests/bpf: Tolerate partial builds across kernel configs Alan Maguire
2026-04-10 13:57 ` Ricardo B. Marlière
2026-04-12 21:09 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260813233736.E61E31F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=rbm@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.