Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore PM-specific option specification in mock config #1074

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Oct 31, 2024

It appears that we actually WANT this configuration key to change with the package manager, and this will be required as mock now supports multiple DNF tools.

This reverts part of ed19495

@cottsay cottsay added the bug label Oct 31, 2024
@cottsay cottsay self-assigned this Oct 31, 2024
@cottsay cottsay force-pushed the cottsay/mock-pm-cmd branch 2 times, most recently from 0ef1812 to a3374bb Compare October 31, 2024 16:58
@cottsay cottsay marked this pull request as ready for review October 31, 2024 17:49
@cottsay
Copy link
Member Author

cottsay commented Oct 31, 2024

This is pretty messy, but we need to unblock RHEL 9 builds.

The CI on this PR demonstrates that it's working as expected, and I manually verified that we didn't regress Fedora.

Copy link

@azeey azeey left a comment

Choose a reason for hiding this comment

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

Just a small nitpick. Otherwise, LGTM!

Thanks for the quick fix!

ros_buildfarm/templates/release/rpm/mock_config.cfg.em Outdated Show resolved Hide resolved
Comment on lines 24 to 26
# Deal with dnf -> dnf4 transition - see rpm-software-management/mock#1496
if package_manager == 'dnf':
config_opts[f'dnf4_builddep_opts'] = config_opts.get(f'dnf4_builddep_opts', []) + ['--setopt=install_weak_deps=True']
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed on top of L22 because config_opts['dnf4_builddep_opts'] is checked in addition to / instead of config_opts['dnf_builddep_opts'] in some situations? If so, I think @azeey's suggestion also makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

The transition in mock is pretty muddy. The situations I'm aware of are:

  1. There is only dnf and dnf_builddep_opts
  2. package_manager is dnf, which is an alias for dnf4 and dnf4_builddep_opts is what we want set
  3. package_manager is now dnf4 and we want dnf4_builddep_opts as before

TBH it doesn't really hurt to drop the conditional and just set the config even if it won't be used, but I think may help in future forensics to understand the purpose of the duplicated code.

It appears that we actually WANT this configuration key to change with
the package manager, and this will be required as mock now supports
multiple DNF tools.

This is all a bit of a mess right now. There isn't a straightforward way
to determine which package manager we should be using, and mock is in
the process of transitioning the default PM to dnf5, where it was
previously unversioned dnf (which means dnf4).

This reverts part of ed19495
@cottsay cottsay force-pushed the cottsay/mock-pm-cmd branch from a3374bb to d162c54 Compare November 1, 2024 15:15
@cottsay cottsay merged commit 63548fe into master Nov 1, 2024
24 checks passed
@cottsay cottsay deleted the cottsay/mock-pm-cmd branch November 1, 2024 15:42
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.

3 participants