Re: [PATCH v1 04/10] kconfig: Introduce checkconfig target

From: sashiko-bot

Date: Sat Nov 07 2026 - 04:20:44 EST


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@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx?part=4