← Back to issue list

sources: only add "compatible" architectures

View original Github issue

Metadata

Project
craft-archives
Number
#96
Type
pull request
State
merged
Author
tigarmo
Labels
—
Created
Updated
Closed

Current evaluation

Merged as craft-archives commit 06b1ca2: fixes dpkg --add-architecture argument order and only adds host-compatible archs (amd64→i386, arm64→armhf). Shipped in 1.1.3, whose changelog was added in #97.

Resolution: closed resolved

Reason: The PR itself was merged into main as commit 06b1ca2 ("sources: only add 'compatible' architectures (#96)"), which rewrote _add_architecture in craft_archives/repo/apt_sources_manager.py to guard the dpkg call behind compatible-arch checks and fixed the parameter order (--root before --add-architecture). The fix was released in 1.1.3 per docs/changelog.rst, with the changelog entry added by #97.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This commit both fixes the order of the parameters in the call to "dpkg --add-architecture" (the parser is picky) and updates the logic to only make said call if the target architecture (that is, the one coming from the package-repository definition) is "compatible" with the host architecture (that is, the architecture of the system running the code). This is necessary because incompatible mixes typically break the system. For example, adding "armhf" on an "amd64" system breaks subsequent calls to "apt update" because apt will try to fetch package listings for the "armhf" architecture on the default Ubuntu archives, which don't have them. Therefore, only the following pairs result in adding the target arch: - host amd64, target i386; - host arm64, target armhf. - [ ] Have you followed the guidelines for contributing? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `tox`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged as craft-archives commit 06b1ca2: fixes dpkg --add-architecture argument order and only adds host-compatible archs (amd64→i386, arm64→armhf). Shipped in 1.1.3, whose changelog was added in #97.
stealth/space-bunny-alpha — closed resolved PR #96 by tigarmo merged as commit 06b1ca2 ("sources: only add 'compatible' architectures"): fixed dpkg arg order and gated `dpkg --add-architecture` to host-compatible archs (i386 on amd64, armhf on arm64); shipped in 1.1.3.
stealth/space-bunny-alpha — closed resolved PR #96 merged as commit 06b1ca2, fixing the dpkg --add-architecture parameter order and only adding host-compatible archs. Released in craft-archives 1.1.3 (2023-08-04).
stealth/space-bunny-alpha — closed resolved Merged in canonical/craft-archives#96 as commit 06b1ca2, correcting dpkg parameter order and adding only compatible target architectures: amd64→i386 and arm64→armhf.
qwen/qwen3.6-35b-a3b — — Merged fix correcting dpkg parameter order and restricting architecture addition to compatible pairs (amd64/i386, arm64/armhf) to prevent system breaks. Approved, passed CI, and achieved 100% diff coverage.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-archives#97 (confidence 90%)

    Follow-up PR adding the 1.1.3 changelog entry describing this fix.

  • Likely Fixed By: canonical/craft-archives#255 (confidence 45%)

    Later commit b4767b8 stopped treating armhf as compatible on Ubuntu 25.10+, refining the compatible-arch logic introduced here.

Related issues

Issue Project State Summary Similarity
#4298 pkg: error: --add-architecture takes exactly one argument snapcraft closed Duplicate of #4289; the underlying dpkg architecture regression was fixed in craft-archives 1.1.3 via PR #96 (commit 06b1ca2).
76%
#230 Don't add armhf as a compatible architecture for 25.10 and newer craft-archives closed Fixed by merged PR #255 (commit b4767b8), released in craft-archives 2.2.2: on Ubuntu 25.10+ arm64 hosts no longer auto-add armhf to ubuntu.sources, since arm64 moved to archive.ubuntu.com.
75%
#4303 requirements: bump craft-archives snapcraft merged Merged #4303, bumping craft-archives to 1.1.3 to correct dpkg argument ordering and enable only compatible repository architectures; fixes #4289 and #4298.
74%
#4289 dpkg --add-architecture fails when using package-repositories snapcraft closed Fixed in craft-archives 1.1.3 via canonical/craft-archives#96 (06b1ca2), reordering dpkg options so --root precedes --add-architecture; rolled out via Snapcraft candidate.
71%