Fix kernel debug build hang #2720
Merged
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.
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
./cgmanifest.json,./toolkit/tools/cgmanifest.json,./toolkit/scripts/toolchain/cgmanifest.json,.github/workflows/cgmanifest.json)./SPECS/LICENSES-AND-NOTICES/data/licenses.json,./SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md,./SPECS/LICENSES-AND-NOTICES/LICENSE-EXCEPTIONS.PHOTON)*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
What does the PR accomplish, why was it needed?
Fix a few issues with the kernel specs related to a build hang.
Resolve a build hang issue seen with kernel. Previously having "%exclude %{_libdir}/debug" after the rpm 4.17.0 upgrade caused the kernel build to hang forever. Restore %exclude directive for debug symbol directory in kernel-tools subpackage, but add "%dir" to also exclude hidden files and directories. Also add the same exclude directive for the main kernel package, to prevent a debug symbol from being included in the arm64 package. For arm64 that debug symbol was:
/usr/lib/debug/.build-id/14/72420763d9efade0b345fa798aead8fa79230c.debug
and pointed to a module that is not in the main package:
../../../../../usr/lib/debug/lib/modules/5.15.32.1-2.cm2/vmlinux-5.15.32.1-2.cm2
I believe that the hang occurs when a .debug file link is present in a package, but the file it points to is not present.
The hang occurs after an rpmlog() call during the AutoProv dependency generation here:
RPM code -> rpmfc.c / printDeps() / rpmlog(RPMLOG_NOTICE, " %s", DNEVR+2);
Removed the /usr/bin/trace symlink, which pointed to the /usr/bin/perf binary. This trace symlink caused duplicate matching build-ids, which creates a ".1.debug" symbol:
/usr/src/mariner/BUILDROOT/kernel-5.15.26.1-4.cm2.x86_64/usr/lib/debug/.build-id/8d/2179c7eeeb21eeae48dde4916c5fc9a2ed0434.1.debug
The package then provides this invalid debuginfo package:
rpm -q --provides kernel-debuginfo-5.15.26.1-3.cm2.x86_64.rpm
…
debuginfo(build-id) = ffba06d26ac1b309547cf391ef63b09e4be0b7df
debuginfo(build-id) = nilnil
Remove BR for xerces-c-devel package. This reference came from our original import of the linux.spec from Photon. We don't use the package.
Change Log
Does this affect the toolchain?
YES
Test Methodology