Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kconfig: error out when seeing recursive dependency

Originally, recursive dependency was a fatal error for Kconfig
because Kconfig cannot compute symbol values in such a situation.

Commit d595cea62403 ("kconfig: print more info when we see a recursive
dependency") changed it to a warning, which I guess was not intentional.

Get it back to an error again.

Also, rename the unit test directory "warn_recursive_dep" to
"err_recursive_dep" so that it matches to the behavior.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Dirk Gouders <dirk@gouders.net>

+10 -12
-3
scripts/kconfig/symbol.c
··· 1248 1248 sym->flags &= ~SYMBOL_CHECK; 1249 1249 } 1250 1250 1251 - if (sym2 && sym2 == sym) 1252 - sym2 = NULL; 1253 - 1254 1251 return sym2; 1255 1252 } 1256 1253
+10
scripts/kconfig/tests/err_recursive_dep/__init__.py
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + """ 3 + Detect recursive dependency error. 4 + 5 + Recursive dependency should be treated as an error. 6 + """ 7 + 8 + def test(conf): 9 + assert conf.oldaskconfig() == 1 10 + assert conf.stderr_contains('expected_stderr')
scripts/kconfig/tests/warn_recursive_dep/Kconfig scripts/kconfig/tests/err_recursive_dep/Kconfig
-9
scripts/kconfig/tests/warn_recursive_dep/__init__.py
··· 1 - """ 2 - Warn recursive inclusion. 3 - 4 - Recursive dependency should be warned. 5 - """ 6 - 7 - def test(conf): 8 - assert conf.oldaskconfig() == 0 9 - assert conf.stderr_contains('expected_stderr')
scripts/kconfig/tests/warn_recursive_dep/expected_stderr scripts/kconfig/tests/err_recursive_dep/expected_stderr