azurelinux icon indicating copy to clipboard operation
azurelinux copied to clipboard

Attempt to use real macros when using rpmops.sh

Open dmcilvaney opened this issue 1 year ago • 0 comments

Merge Checklist

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

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

Summary

rpmops.sh is a bash script that can be sourced (source ./toolkit/scripts/rpmops.sh) and will provide 'mariner' versions of rpmspec (and now rpm). This is done by using the macro files from the git repo instead of the defaults found in the rpm tool.

There is a limitation: The macros built into rpm-libs aren't easily available, so we try to grab a copy from PMC. This means that if the rpm package itself is updated in a way that changes the macros the PR checks will use the previously released version. Once the PR is merged they PR checks will revert to the built-in macros until a build publishes the new version of rpm-libs.

This is a follow on fix for ~#7493~ / #7560

Change Log
  • Use updated macros in rpmops.sh
Does this affect the toolchain?

NO

Associated issues
  • https://microsoft.visualstudio.com/DefaultCollection/OS/_queries/edit/48574344
Test Methodology
  • DAILY_BUILD_ID=3-0-20240310 source ./toolkit/scripts/rpmops.sh, record the location of the temp copy of the macros file (~/tmp/tmp.TAa3kVQHtS/ce8874b8e732f08f0300fa4642afb552fe9250d17588f4b19bff42caf7d6bc4d)

  • azl_rpm --eval '%{test_macro}' "%{test_macro}"

  • Edit the temp macro file to add %test_macro its working

  • azl_rpm --eval '%{test_macro}' "its working"

  • Also ran the PR gates with an updated nano.spec, all gates passed.

dmcilvaney avatar Mar 18 '24 18:03 dmcilvaney