kbuild: fix config make targets being merged as fragment data - #3205
Merged
nuclearcat merged 2 commits intoSep 9, 2026
Conversation
A fragment entry of the form 'make:<target>' names a kernel make target that generates config, and tuxmake accepts it as a magic --kconfig-add value. _parse_fragments() instead wrote every fragment entry into a fragment file and passed that file to --kconfig-add, so the directive reached kconfig as fragment content, which merged it as: .config:5652:warning: unexpected data: make:kselftest-merge The kselftest fragment consists of exactly that one entry, so no kselftest config has been merged since it was switched over. The resulting kernels lack CONFIG_IOMMUFD, CONFIG_USER_NS, CONFIG_BPF_SYSCALL and everything else tools/testing/selftests/*/config asks for, which fails whole suites: kselftest-iommu has not passed a single one of its 18376 runs, every subtest dying in fixture setup on a missing /dev/iommu. Split 'make:' directives out of the fragment content and keep them as separate kconfig additions, ordered with the fragment files so merge order is preserved, then pass them to tuxmake verbatim. The make backend skips them for now. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
The make backend built its .config with merge_config.sh per fragment and had no way to act on a 'make:<target>' entry, so it skipped them and lost whatever config the target would have generated, exactly as the tuxmake backend did before it learned to forward them. Run the target instead. It merges into the .config produced so far and is emitted in fragment order, so 'make:kselftest-merge' behaves like the merge_config.sh call it replaces. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.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.
The
kselftestbuild fragment is a single entry,make:kselftest-merge(kernelci-pipeline
config/fragments.yaml), which tuxmake accepts as a magic--kconfig-addvalue (kernelci/tuxmake#275, documented since kernelci/tuxmake#280)._parse_fragments()writes every fragment entry intofragments/N.configandpasses that file to
--kconfig-add, so the directive reaches kconfig asfragment content and gets merged as unexpected data:
No kselftest config has been merged since the fragment was switched over, on
either backend. The resulting kernels are missing everything
tools/testing/selftests/*/configasks for —CONFIG_IOMMUFD,CONFIG_FAULT_INJECTION,CONFIG_USER_NS,CONFIG_BPF_SYSCALL,CONFIG_VETH, ... — which wipes out whole suites rather than individual tests.Observed effect in production:
kselftest-iommuhas 1 pass in 18376 runsall-time, and accounted for ~43k of the ~61k test-level failures in the
04-07 Sep window (70%), pushing the overall test failure rate from ~3.2% to
9.8%. Every subtest dies in fixture setup on a missing
/dev/iommu:with
# CONFIG_IOMMUFD is not setin the build's.config, on hardware whoseIOMMU is otherwise fine (
DMAR: dmar0 ...,iommu: Default domain type: Translated).Changes
kbuild: pass config make targets through to tuxmake— splitmake:directives out of fragment content and keep them as separate kconfig
additions, ordered with the fragment files so merge order is preserved, then
pass them to tuxmake verbatim.
_fragment_filesbecomes_kconfig_addssince it no longer holds only files. The make backend skips them, unchanged,
so this commit stands on its own.
kbuild: run config make targets in the make backend— emitmake <target>in place of themerge_config.shcall.kselftest-mergemerges into the
.configbuilt so far and runs its ownolddefconfig, so itdrops into the existing sequence.
Result
Testing
ruff checkandruff formatclean;tests/test_kbuild.pypasses (13 tests,4 new in
TestFragments: directive not written to a fragment file, mixedconfig/directive fragments split correctly, tuxmake passthrough, make-backend
ordering).
No kernelci-pipeline change is needed —
config/fragments.yamlwas alreadycorrect; only the consumer was dropping the directive.
Draft: worth a build on staging to confirm
CONFIG_IOMMUFDlands inx86_64_defconfig+lab-setup+x86-board+kselftestbefore merging, and to checkthat the now-effective
kselftest-mergedoesn't pull in config that upsetsother suites (it is all-or-nothing across every subsystem).