Repository navigation
[amd64-v6.18.63-generic] check-config: fail on entries for symbols the tree does not declare - #340
Open
NopeCharon wants to merge 1 commit into
Conversation
olddefconfig drops an assignment to a symbol that no Kconfig declares, and Dockerfile.gcc merges fragments with merge_config.sh -m, which skips merge_config's own "requested value not in final .config" check. So when a symbol EVE sets is removed or renamed upstream, its defconfig or fragment entry quietly stops doing anything: - a fragment's "# CONFIG_X is not set" always holds, because check_fragment_values counts a symbol missing from .config as n, so a denial that no longer matches anything is never reported; - no check reads the base defconfig's own entries at all; - a fragment's =y or =m is reported only as "requested y, got n", which reads like a dependency problem. eve/drift/core-6.12-to-6.18.txt lists CRYPTO_CRC32_PCLMUL, CRYPTO_VMAC, CRYPTO_KEYWRAP and X86_5LEVEL among the eve-core_defconfig entries the 6.12 -> 6.18 move dropped: 6.18 declares none of them, and the list had to be put together outside the build. Add check_symbols_declared(), a fatal section that looks up every symbol named by the flavour's base defconfig and each of its fragments in the symbol map the checker already builds from the tree's Kconfig files, and names the file of every entry it cannot find. The base defconfig comes from a new optional --base-defconfig option, which Dockerfile.gcc fills from BASE_DEFCONFIG; without it only the fragments are checked, so existing callers keep working. The 6.18.63 tree passes: every entry of eve-core_defconfig (974), eve-hwe_defconfig (6333) and every fragment names a declared symbol, so this changes no build today. The next bump that drops a symbol EVE sets fails at the policy-check step, before the compile, instead of shipping a config that silently lost the entry. Fixes: lf-edge#338 Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eve/check-config.pygets a new fatal section, defconfig and fragment symbols declared in this tree. It fails the build when the flavour's base defconfig or one of its fragments sets a symbol that no Kconfig in the tree declares.Fixes #338
Why
olddefconfigsilently drops assignments to undeclared symbols, and the fragments are merged withmerge_config.sh -m, which skips merge_config's own final-value check. After a kernel bump removes or renames a symbol EVE sets:# CONFIG_X is not setalways "holds", becausecheck_fragment_valuescounts a symbol missing from.configasn;=y/=mshows up only asrequested y, got n.eve/drift/core-6.12-to-6.18.txtshows this already happened:CRYPTO_CRC32_PCLMUL,CRYPTO_KEYWRAP,CRYPTO_VMACandX86_5LEVELare 6.12eve-core_defconfigentries that 6.18 does not declare at all.Changes
check_symbols_declared(sources, symbol_map)looks up every entry of the base defconfig and the fragments, in apply order, in the symbol map the checker already builds from the tree's Kconfig files. For each stale entry it reports the symbol, the file and the value.run_checks()takes an optionalbase_defconfig(path, values) pair.main()takes an optional--base-defconfig. Without it, only the fragments are checked.Dockerfile.gccpasses--base-defconfig "arch/x86/configs/${BASE_DEFCONFIG}".eve/tests/test_check_config.pyadds unit tests for the new check,run_checks()cases where it is the only failing section, andmain()tests for the new option.Validation
python3 -m unittest discover -s eve/tests: 51 tests pass. Withcheck-config.pyreverted to the base, the 8 new tests fail.PASSfor all three: every entry ofeve-core_defconfig(974),eve-hwe_defconfig(6333) and every fragment names a declared symbol, so no build changes today.# CONFIG_GONE_UPSTREAM is not settodeny.fragmentand re-ran hwe: