BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ricardo B. Marlière" <rbm@suse.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v9 09/11] selftests/bpf: Tolerate benchmark build failures
Date: Wed, 29 Apr 2026 21:08:15 +0000	[thread overview]
Message-ID: <20260429210816.29EA6C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260429-selftests-bpf_misconfig-v9-9-c311f06b4791@suse.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Skipped `bench` binary causes `make install` to fail due to missing files in `TEST_GEN_PROGS_EXTENDED`.
- [Medium] Using `$(wildcard $^)` to filter missing prerequisites breaks `make -n` (dry run) and drastically increases compiler error noise.
--

commit 31a306fe854d559a436ecf84354b5b73a31012e8
Author: Ricardo B. Marlière <rbm@suse.com>

selftests/bpf: Tolerate benchmark build failures

This commit modifies the selftests/bpf Makefile to tolerate build failures
for benchmark objects when PERMISSIVE is set. It changes the compilation and
linking steps for the bench binary to emit a skip message and avoid failing
the entire build if a dependency is missing or fails to compile.

> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index a64e822dc540..db4ff951fc88 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile

[ ... ]

> @@ -988,7 +989,8 @@ $(OUTPUT)/bench: $(OUTPUT)/bench.o \
>  		 $(OUTPUT)/usdt_2.o \
>  		 #
>  	$(call msg,BINARY,,$@)
> -	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@
> +	$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$(if $(PERMISSIVE),$(wildcard $^),$^)) $(LDLIBS) -o $@ $(if $(PERMISSIVE),|| \
> +		($(RM) $@; printf '  %-12s %s\n' 'SKIP-LINK' '$(notdir $@) (some benchmarks may have been skipped)' 1>&2))

Does using $(wildcard $^) here break make -n (dry run) and cause excessive
linker noise?

Since bench.c statically references every benchmark, omitting missing objects
from the command line forces the linker to run anyway, resulting in a large
number of undefined reference errors before it fails.

If $^ were used directly, the compiler would fail cleanly and immediately with
a "No such file or directory" error before running the linker, which would
then correctly trigger the || SKIP-LINK fallback.

Also, evaluating $(wildcard $^) in a recipe causes missing generated objects
to be silently omitted during make -n.

Will skipping the bench binary cleanly cause make install to fail, since
bench is unconditionally listed in TEST_GEN_PROGS_EXTENDED?

During make install, the selftest build system uses rsync to copy all targets
in TEST_GEN_PROGS_EXTENDED. Since the skipped bench binary won't exist on disk,
rsync fails with a "No such file or directory" error and aborts the pipeline,
defeating the purpose of the permissive build mode.

I do see this was fixed later in the series by commit
ce682ab9bce04cbe3adda3d7a63647774ad61f5d "selftests/bpf: Tolerate missing
files during install".

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260429-selftests-bpf_misconfig-v9-0-c311f06b4791@suse.com?part=9

  reply	other threads:[~2026-04-29 21:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 14:33 [PATCH bpf-next v9 00/11] selftests/bpf: Tolerate partial builds across kernel configs Ricardo B. Marlière
2026-04-29 14:33 ` [PATCH bpf-next v9 01/11] selftests/bpf: Add BPF_STRICT_BUILD toggle Ricardo B. Marlière
2026-04-29 15:13   ` bot+bpf-ci
2026-04-29 16:03     ` Ricardo B. Marlière
2026-04-29 14:33 ` [PATCH bpf-next v9 02/11] selftests/bpf: Fix test_kmods KDIR to honor O= and distro kernels Ricardo B. Marlière
2026-04-29 19:41   ` sashiko-bot
2026-04-29 14:33 ` [PATCH bpf-next v9 03/11] selftests/bpf: Tolerate BPF and skeleton generation failures Ricardo B. Marlière
2026-04-29 15:13   ` bot+bpf-ci
2026-04-29 16:03     ` Ricardo B. Marlière
2026-04-29 14:33 ` [PATCH bpf-next v9 04/11] selftests/bpf: Avoid rebuilds when running emit_tests Ricardo B. Marlière
2026-04-29 14:33 ` [PATCH bpf-next v9 05/11] selftests/bpf: Make skeleton headers order-only prerequisites of .test.d Ricardo B. Marlière
2026-04-29 20:23   ` sashiko-bot
2026-04-29 14:33 ` [PATCH bpf-next v9 06/11] selftests/bpf: Tolerate test file compilation failures Ricardo B. Marlière
2026-04-29 20:37   ` sashiko-bot
2026-04-29 14:33 ` [PATCH bpf-next v9 07/11] selftests/bpf: Skip tests whose objects were not built Ricardo B. Marlière
2026-04-29 14:33 ` [PATCH bpf-next v9 08/11] selftests/bpf: Allow test_progs to link with a partial object set Ricardo B. Marlière
2026-04-29 14:33 ` [PATCH bpf-next v9 09/11] selftests/bpf: Tolerate benchmark build failures Ricardo B. Marlière
2026-04-29 21:08   ` sashiko-bot [this message]
2026-04-29 14:33 ` [PATCH bpf-next v9 10/11] selftests/bpf: Provide weak definitions for cross-test functions Ricardo B. Marlière
2026-04-29 21:29   ` sashiko-bot
2026-04-29 14:33 ` [PATCH bpf-next v9 11/11] selftests/bpf: Tolerate missing files during install Ricardo B. Marlière

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=20260429210816.29EA6C19425@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=rbm@suse.com \
    --cc=sashiko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox