[WIP] Honor split_arch in aptpkg install target parsing#68933
[WIP] Honor split_arch in aptpkg install target parsing#68933TobiPeterG wants to merge 1 commit intosaltstack:3006.xfrom
Conversation
Match yumpkg's parse_targets behavior so pkg.installed(update_holds=True) can preserve explicit APT multiarch package names such as :amd64. Add a regression test and document the provider-specific naming caveat for held/unheld packages.
|
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here's some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
| reinstall=False, | ||
| downloadonly=False, | ||
| ignore_epoch=False, | ||
| normalize=True, |
There was a problem hiding this comment.
Can you please add a description of this argument in the docstring?
What does this PR do?
Fixes
aptpkg.install()so explicit APT multiarch package names such as:amd64are preserved whensplit_arch=Falseis passed from the genericpkg.installedstate path.This makes the APT behavior similar to the existing YUM handling and fixes a case where
pkg.installed(update_holds=True)could fail to temporarily unhold packages that dpkg records as held with an architecture suffix.This PR also adds documentation notes for the provider-specific naming requirement around held/unheld multiarch APT packages.
What issues does this PR fix or reference?
Fixes #68932
Previous Behavior
For APT,
pkg.installedpassessplit_arch=Falseintopkg.install, butaptpkg.install()did not honor that when callingpkg_resource.parse_targets().As a result, an explicit package target like:
- libnvidia-cfg1-570-server:amd64could be normalized to:
libnvidia-cfg1-570-serverbefore APT hold handling ran.
If dpkg recorded the hold as:
then
update_holds: Truecould fail to match and unhold the package correctly.New Behavior
aptpkg.install()now honorssplit_arch=Falsewhen parsing install targets, matching the existing YUM pattern.This preserves explicit APT multiarch package names such as
:amd64in the install path, allowingupdate_holds: Trueto operate on the exact held package name reported by dpkg.Merge requirements satisfied?
Tests updated:
tests/pytests/unit/modules/test_aptpkg.pyValidation performed:
split_arch=FalsepathCommits signed with GPG?
No
Is signing the commits with GPG required?
I tried to test my changes locally on a Ubuntu system to confirm that the issue is properly resolved. However, I saw this message when I tried to install salt in editable mode:
ERROR: Project file:///home/user/Documents/salt uses a build backend that is missing the 'build_editable' hook, so it cannot be installed in editable mode. Consider using a build backend that supports PEP 660.Did I do something wrong?
This means that I don't have a real world proof that this code actually fixes the issue. However, I hope that A) the issue is easily reproducable and B) this code can be easily checked by someone with a working test setup.
Until this PR is proven to solve the linked issue, I will keep it in draft mode.
EDIT: I will change it to ready and add WIP as there are very few PRs in draft mode, but quite a few with the WIP tag. I hope this change is correct.
I'm also not too experienced in python and not very familiar with the code base, so I hope this is an acceptable solution. :)
I'm of course open for feedback. :)
PS: I hope I didn't miss a point in the contribution guidelines :D