Sashiko discussions
 help / color / mirror / Atom feed
From: "Ricardo B. Marlière" <rbm@suse.com>
To: sashiko@lists.linux.dev, "Ricardo B. Marlière" <rbm@suse.com>
Cc: <bpf@vger.kernel.org>
Subject: Re: [PATCH bpf-next v10 06/11] selftests/bpf: Tolerate test file compilation failures
Date: Thu, 30 Apr 2026 10:13:51 -0300	[thread overview]
Message-ID: <DI6ILKHKXCTR.2TAXUY0YUC5DS@suse.com> (raw)
In-Reply-To: <20260430131052.3E683C2BCB3@smtp.kernel.org>

On Thu Apr 30, 2026 at 10:10 AM -03, sashiko-bot wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] The inline condition `$(if $(V))` incorrectly suppresses the `BTFIDS` pretty output when `V=0` or `V=2`.
> --
>
> commit 0d69d461adbd02ed2bb765aad81f923aeaf2a8da
> Author: Ricardo B. Marlière <rbm@suse.com>
>
> selftests/bpf: Tolerate test file compilation failures
>
> This commit makes per-test compilation non-fatal for test_progs, skipping
> missing objects during linking. It adjusts the BTFIDS step to use standard
> printf instead of the msg macro within the shell conditionals.
>
>> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
>> index 608e6dff03926..9becc077eb231 100644
>> --- a/tools/testing/selftests/bpf/Makefile
>> +++ b/tools/testing/selftests/bpf/Makefile
>
> [ ... ]
>
>> @@ -717,11 +723,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)) $(if $(filter test_progs%,$1),$(if $(PERMISSIVE),|| \
>> +		($(RM) $$@; printf '  %-12s %s\n' 'SKIP-TEST' '$$(notdir $$@)' 1>&2)))
>>  	$$(if $$(TEST_NEEDS_BTFIDS),						\
>> -		$$(call msg,BTFIDS,$(TRUNNER_BINARY),$$@)			\
>> +		$(Q)if [ -f $$@ ]; then						\
>> +		$(if $(V),true,printf '  %-8s%s %s\n' "BTFIDS" " [$(TRUNNER_BINARY)]" "$$(notdir $$@)"); \
>
> Does this condition correctly handle V=0 or V=2?
>
> In GNU Make, the $(if) function evaluates to true if the condition expands to
> any non-empty string. If a user sets make V=0, $(V) expands to the string "0",
> which Make considers true.
>
> Consequently, `$(if $(V),true,printf ...)` will execute `true;`, silencing the
> BTFIDS output entirely. The standard msg macro used for other compilation steps
> explicitly checks `ifeq ($(V),1)`.
>
> This results in inconsistent behavior where V=0 correctly prints brief messages
> like TEST-OBJ but silently skips BTFIDS.
>
> Could this explicitly check for "1", such as using
> `$(if $(filter 1,$(V)),true,printf ...)` to accurately match the behavior of
> the msg macro?

ugh I forgot about this one

>
>>  		$(RESOLVE_BTFIDS) --btf $(TRUNNER_OUTPUT)/btf_data.bpf.o $$@;	\
>> -		$(RESOLVE_BTFIDS) --patch_btfids $$@.BTF_ids $$@)
>> +		$(RESOLVE_BTFIDS) --patch_btfids $$@.BTF_ids $$@;		\
>> +		fi)


           reply	other threads:[~2026-04-30 13:13 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20260430131052.3E683C2BCB3@smtp.kernel.org>]

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=DI6ILKHKXCTR.2TAXUY0YUC5DS@suse.com \
    --to=rbm@suse.com \
    --cc=bpf@vger.kernel.org \
    --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