Article View: linux.debian.kernel
Article #463Re: [PATCH v1 04/10] kconfig: Introduce checkconfig target
From: sashiko-bot
Date: Sat, 07 Nov 2026 09:50
Date: Sat, 07 Nov 2026 09:50
76 lines
5341 bytes
5341 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] kconfig: checkconfig pipeline masks check.py startup and
dependency errors
--
commit 984ec26ec37b16ca849857bd7d027d488808c4d2
Author: Ahmed S. Darwish <darwi@linutronix.de>
kconfig: Introduce checkconfig target
This commit adds a checkconfig Makefile target that invokes
tools/kconfig-checker/check.py to validate the kernel configuration
against the rules profile specified by RULES, and documents the target in
the help output.
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index 5baf1c44ffa25..d67a23730259b 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -125,6 +125,26 @@ testconfig: $(obj)/conf
> $(if $(findstring 1,$(KBUILD_VERBOSE)),--capture=no)
> clean-files += tests/.cache
>
> +checkconfig := $(PYTHON3) -B $(srctree)/tools/kconfig-checker/check.py
> +list_checkconfig_rules = \
> + echo -n >&2 "Available RULES: "; \
> + $(checkconfig) list-rules >&2; \
> + echo >&2
> +
> +PHONY += checkconfig
> +checkconfig:
> + $(Q)if [ -z "$(RULES)" ]; then \
> + echo >&2 "Usage: make RULES=<profile> checkconfig"; \
> + $(list_checkconfig_rules); \
> + exit 2; \
> + fi
> + $(Q)if ! $(checkconfig) list-rules | grep -qw "$(RULES)"; then \
> + echo >&2 "Unknown RULES profile = $(RULES)"; \
> + $(list_checkconfig_rules); \
> + exit 2; \
> + fi
> + $(Q)$(checkconfig) check -r "$(RULES)" -c "$(KCONFIG_CONFIG)"
[Severity: Low]
Does piping $(checkconfig) list-rules into grep mask startup and
dependency failures from check.py?
tools/kconfig-checker/check.py imports jsonschema and yaml at module load
time before handling list-rules:
tools/kconfig-checker/check.py:
try:
import jsonschema # type: ignore
import yaml as yaml_m # type: ignore
except ModuleNotFoundError as e:
error(f'Missing Python module: {e.name}', os.EX_UNAVAILABLE)
When either module is missing, check.py writes the error to stderr,
produces no stdout, and exits with os.EX_UNAVAILABLE. Because the POSIX
shell pipeline ignores the exit status of $(checkconfig) list-rules,
grep -qw exits 1 on the empty stdout and the negated condition enters the
branch. That reports a valid setting such as RULES=preempt_rt as an
unknown profile and runs $(list_checkconfig_rules), which invokes check.py
a second time and prints a duplicate module error on the same line after
"Available RULES: ".
In addition, grep -qw treats $(RULES) as a regular expression with word
boundaries against the comma-separated output of list-rules rather than
matching an exact profile name, and spawns Python twice on every valid
invocation even though check.py check -r already validates the profile
name.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261106091922.7560-1-darwi@linutronix.de?part=4
Technical Details
Message-ID:
<NWLdD-amPt-1@gated-at.bofh.it>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomodReferences:
<NWoK5-aaez-7@gated-at.bofh.it> <NWoK5-aaez-5@gated-at.bofh.it>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod From: sashiko-bot@kernel.org Newsgroups: linux.debian.kernel,linux.kernel Subject: Re: [PATCH v1 04/10] kconfig: Introduce checkconfig target Date: Sat, 07 Nov 2026 10:50:01 +0100 Message-ID: <NWLdD-amPt-1@gated-at.bofh.it> References: <NWoK5-aaez-7@gated-at.bofh.it> <NWoK5-aaez-5@gated-at.bofh.it> X-Mailbox-Line: From debian-kernel-request@lists.debian.org Sat Nov 7 09:48:19 2026 Old-Return-Path: <sashiko-bot@kernel.org> X-Amavis-Spam-Status: No, score=-4.401 tagged_above=-10000 required=5.3 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no X-Policyd-Weight: using cached result; rate: -5.5 Reply-To: sashiko-reviews@lists.linux.dev Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailing-List: <debian-kernel@lists.debian.org> archive/latest/158106 List-ID: <debian-kernel.lists.debian.org> List-URL: <https://lists.debian.org/debian-kernel/> List-Archive: https://lists.debian.org/msgid-search/sashiko-outbox-202759@kernel.org Approved: robomod@news.nic.it Lines: 76 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: "Sebastian Andrzej Siewior" <bigeasy@linutronix.de>, "Frederic Weisbecker" <frederic@kernel.org>, "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>, "Jonathan Corbet" <corbet@lwn.net>, "John Ogness" <john.ogness@linutronix.de>, "Derek Barbosa" <debarbos@redhat.com>, Zbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>, "Daan De Meyer" <daan.j.demeyer@gmail.com>, "Luca Boccassi" <luca.boccassi@gmail.com>, linux-rt-devel@lists.linux.dev, debian-kernel@lists.debian.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org X-Original-Date: Sat, 07 Nov 2026 09:20:26 +0000 X-Original-Message-ID: <sashiko-outbox-202759@kernel.org> X-Original-References: <20261106091922.7560-1-darwi@linutronix.de> <20261106091922.7560-5-darwi@linutronix.de>