Skip to content

Fixed tdnf provides parsing to recognize epochs in package names.#10587

Merged
PawelWMS merged 1 commit into3.0-devfrom
pawelwi/package_name_regex_fix
Oct 1, 2024
Merged

Fixed tdnf provides parsing to recognize epochs in package names.#10587
PawelWMS merged 1 commit into3.0-devfrom
pawelwi/package_name_regex_fix

Conversation

@PawelWMS
Copy link
Copy Markdown
Contributor

@PawelWMS PawelWMS commented Oct 1, 2024

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

We've recently started seeing builds failing with following errors:

failed to clone (7.70-506.azl3.noarch) from RPM repo

This seems to be related with invalid parsing of the tdnf provides output where the tool's regex failed to take a potential : into the account. A few lines above the mentioned error, we can see TDNF finding the right package:

time="2024-09-30T21:52:54Z" level=debug msg="Executing: [tdnf provides perl(ExtUtils::MakeMaker) --releasever=3.0 --disablerepo=* --enablerepo=toolchain-repo]"
time="2024-09-30T21:52:54Z" level=debug msg="tdnf search for provide 'perl(ExtUtils::MakeMaker)':
Loaded plugin: tdnfrepogpgcheck
[using capability match for 'perl(ExtUtils::MakeMaker)']
perl-ExtUtils-MakeMaker-2:7.70-506.azl3.noarch : Create a module Makefile
Repo	 : toolchain-repo

The : character in 2:7.70-506.azl3.noarch is what confused the regex.

The current (as of 09/30/2024) version of TDNF (3.5.6) is printing the versions without the epoch and that's why we haven't hit this issue until now. It seems that the bump to version 3.5.8 added the epoch number to the tdnf provides output.

Sample output for 3.5.6:

root [ / ]# tdnf provides 'perl(ExtUtils::MakeMaker)'
Loaded plugin: tdnfrepogpgcheck
[using capability match for 'perl(ExtUtils::MakeMaker)']
perl-ExtUtils-MakeMaker-7.70-506.azl3.noarch : Create a module Makefile
Repo     : azurelinux-official-base

Notice no epoch in 7.70-506.azl3.noarch.

Does this affect the toolchain?

No.

Test Methodology
  • Local Go tests.

@PawelWMS PawelWMS requested a review from a team as a code owner October 1, 2024 00:41
@PawelWMS PawelWMS merged commit 90673ff into 3.0-dev Oct 1, 2024
@PawelWMS PawelWMS deleted the pawelwi/package_name_regex_fix branch October 1, 2024 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants