Re: [PATCH 1/4] kconfig: tests: Reset KCONFIG_WARN_CHANGED_INPUT by default

From: Nicolas Schier

Date: Thu Sep 24 2026 - 03:40:00 EST


On Sat, Sep 19, 2026 at 06:29:39PM +0100, Julian Braha wrote:
> On 9/17/26 14:38, Nicolas Schier wrote:
> > Reset KCONFIG_WARN_CHANGED_INPUT by default for all kconfig tests but
> > those which set it explicitly.
> >
> > This fixes the 'warn_changed_input' test on systems with
> > KCONFIG_WARN_CHANGED_INPUT=1 and ensures a cleaner test environment.
> >
> > Fixes: 645323a7f4e5 ("kconfig: add optional warnings for changed input values")
> > Signed-off-by: Nicolas Schier <n.schier@xxxxxxxxx>
> > ---
> > scripts/kconfig/tests/conftest.py | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/scripts/kconfig/tests/conftest.py b/scripts/kconfig/tests/conftest.py
> > index 66f95e4ed58c..e92f0cf1421a 100644
> > --- a/scripts/kconfig/tests/conftest.py
> > +++ b/scripts/kconfig/tests/conftest.py
> > @@ -34,6 +34,9 @@ class Conf:
> > """
> > # the directory of the test being run
> > self._test_dir = os.path.dirname(str(request.fspath))
> > + self.default_env = {
> > + "KCONFIG_WARN_CHANGED_INPUT": "",
> > + }
> >
> > # runners
> > def _run_conf(self, mode, dot_config=None, out_file='.config',
> > @@ -57,6 +60,11 @@ class Conf:
> > # Override 'srctree' environment to make the test as the top directory
> > extra_env['srctree'] = self._test_dir
> >
> > + # Set default environment variables, if not set by caller
> > + for var in self.default_env:
> > + if not var in extra_env:
> > + extra_env[var] = self.default_env[var]
>
> Maybe it makes more sense to have the tests ignore users' env vars if
> they would cause tests to fail? For example, this recent patch
> explicitly unsets the KCONFIG_WERROR flag:
> https://lore.kernel.org/linux-kbuild/4d1eee3a-a5f9-467e-880e-4f2815851b09@xxxxxxxxx/T/#m25be9ad4d5e62956c5f98759398f91a555afb4df

Good point, but I am not sure, if we really should ignore all of the
user's environment. Maybe it's better for now, to just reset all
environment variables that start with KCONFIG_ and KBUILD_ ?


--
Nicolas