Skip to content

rpm: remove unnecessary brp-strip scripts#5693

Merged
anphel31 merged 7 commits into
mainfrom
anphel/rpm-brp-strip-fix
Jun 26, 2023
Merged

rpm: remove unnecessary brp-strip scripts#5693
anphel31 merged 7 commits into
mainfrom
anphel/rpm-brp-strip-fix

Conversation

@anphel31

@anphel31 anphel31 commented Jun 15, 2023

Copy link
Copy Markdown
Member
Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./SPECS/LICENSES-AND-NOTICES/data/licenses.json, ./SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md, ./SPECS/LICENSES-AND-NOTICES/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?
Remove redundant brp-strip operations from our default __os_install_post definition.
Get rid of custom scripts bundled in our rpm-build package: brp-strip-debug-symbols & brp-strip-unneeded
Call the upstream rpm versions of each brp-strip* script, while still keeping some Mariner customizations related to ccache and embedded ELF metadata.

Change Log
  • rpm: Remove unnecessary script: brp-strip-debug-symbols. This does the exact same thing as brp-strip, but in a less efficient way - it searches for all ELF binaries and sequentially removes debug symbols. brp-strip removes the debug symbols from multiple files in parallel.
  • rpm: Remove unnecessary script: brp-strip-unneeded. This calls "strip --strip-unneeded -g" on every ELF binary. The upstream rpm macro does not call --strip-unneeded, and the brp-strip-comment-note script appears to strip the same content as this script.
  • mariner-rpm-macros: remove references to brp-strip-debug-symbols, brp-strip-unneeded in __os_install_post
  • mariner-rpm-macros: use standard brp-macro naming definitions from upstream rpm
  • update toolchain manifests
Does this affect the toolchain?

YES

Test Methodology
  • Full X64 build: 2.0.20230615-anphel-378724
  • Full ARM64 build: 2.0.20230616-anphel-379014
  • Buddy build to just build rpm and mariner-rpm-macros packages: https://dev.azure.com/mariner-org/mariner/_build/results?buildId=378541&view=results
  • I have spot-checked binaries built with this change from the following packages: kernel, moby-cli, tree. I compared binaries built with and without these changes, comparing the file size and headers (using objdump -x binary). I did not detect any differences in these packages. The overall size of the debuginfo packages with and without the changes is also consistent.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the main PR Destined for main label Jun 15, 2023
Comment thread SPECS/mariner-rpm-macros/macros
Comment thread SPECS/mariner-rpm-macros/macros
@anphel31 anphel31 changed the title optimize brp-strip scripts in os_install_post rpm: remove unnecessary brp-strip scripts Jun 18, 2023
@anphel31 anphel31 marked this pull request as ready for review June 18, 2023 22:03
@anphel31 anphel31 requested review from a team as code owners June 18, 2023 22:03

@reubeno reubeno left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see us making these changes! I'm assuming we'll want to spot-check a few packages to make sure that the resulting RPMs's binaries still match what we'd expect to see (i.e., appropriately stripped of debug info, etc.)?

Comment thread SPECS/rpm/rpm.spec
@anphel31

Copy link
Copy Markdown
Member Author

Great to see us making these changes! I'm assuming we'll want to spot-check a few packages to make sure that the resulting RPMs's binaries still match what we'd expect to see (i.e., appropriately stripped of debug info, etc.)?

Yes, I've spot checked some of the built packages. Will update the test section of the description with details.

@anphel31 anphel31 merged commit c4c9b17 into main Jun 26, 2023
@anphel31 anphel31 deleted the anphel/rpm-brp-strip-fix branch June 26, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main PR Destined for main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants