Skip to content

[WIP] Honor split_arch in aptpkg install target parsing#68933

Open
TobiPeterG wants to merge 1 commit intosaltstack:3006.xfrom
TobiPeterG:fix-68932
Open

[WIP] Honor split_arch in aptpkg install target parsing#68933
TobiPeterG wants to merge 1 commit intosaltstack:3006.xfrom
TobiPeterG:fix-68932

Conversation

@TobiPeterG
Copy link
Copy Markdown

@TobiPeterG TobiPeterG commented Apr 13, 2026

What does this PR do?

Fixes aptpkg.install() so explicit APT multiarch package names such as :amd64 are preserved when split_arch=False is passed from the generic pkg.installed state 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.installed passes split_arch=False into pkg.install, but aptpkg.install() did not honor that when calling pkg_resource.parse_targets().

As a result, an explicit package target like:

- libnvidia-cfg1-570-server:amd64

could be normalized to:

libnvidia-cfg1-570-server

before APT hold handling ran.

If dpkg recorded the hold as:

libnvidia-cfg1-570-server:amd64

then update_holds: True could fail to match and unhold the package correctly.

New Behavior

aptpkg.install() now honors split_arch=False when parsing install targets, matching the existing YUM pattern.

This preserves explicit APT multiarch package names such as :amd64 in the install path, allowing update_holds: True to operate on the exact held package name reported by dpkg.

Merge requirements satisfied?

  • Docs
  • Changelog
  • Tests written/updated

Tests updated:

  • tests/pytests/unit/modules/test_aptpkg.py

Validation performed:

  • Built docs locally and verified the new doc text renders correctly
  • Added a unit test for the APT split_arch=False path
  • Ran local validation on the changed Python files

Commits 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

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.
@welcome
Copy link
Copy Markdown

welcome bot commented Apr 13, 2026

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.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

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.
If you have additional questions, email us at saltproject.pdl@broadcom.com. We're glad you've joined our community and look forward to doing awesome things with you!

@TobiPeterG TobiPeterG changed the base branch from master to 3006.x April 13, 2026 14:19
@TobiPeterG TobiPeterG changed the title Honor split_arch in aptpkg install target parsing [WIP] Honor split_arch in aptpkg install target parsing Apr 13, 2026
@TobiPeterG TobiPeterG marked this pull request as ready for review April 13, 2026 14:25
@TobiPeterG TobiPeterG requested a review from a team as a code owner April 13, 2026 14:25
reinstall=False,
downloadonly=False,
ignore_epoch=False,
normalize=True,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please add a description of this argument in the docstring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: v3006: updating held arch-dependent packages doesn't work with apt with update_holds: True flag

2 participants