Skip to content

Add support for architecture variants - #1638

Draft
hjmitsd wants to merge 15 commits into
aptly-dev:masterfrom
hjmitsd:architecture-variants
Draft

hjmitsd wants to merge 15 commits into
aptly-dev:masterfrom
hjmitsd:architecture-variants

Conversation

@hjmitsd

@hjmitsd hjmitsd commented Sep 15, 2026

Copy link
Copy Markdown

Summary

This PR adds support for package architecture variants such as amd64v3.

Ubuntu 26.04 publishes separate indexes such as:

binary-amd64/
binary-amd64v3/

while packages from the variant index still use:

Architecture: amd64
Architecture-Variant: amd64v3

This means a regular package and its architecture variant may have the same name, version and base architecture. Aptly currently treats them as the same package identity.

Approach

The patch introduces the concept of an index architecture:

  • regular package: amd64
  • variant package: amd64v3

The original Architecture: amd64 remains unchanged and continues to be used for dependency matching.

Architecture variants are distinguished only where package or repository identity requires it.

The changes cover:

  • package identity and persistence
  • remote mirrors
  • filtered mirrors and dependency following
  • publishing
  • package queries
  • snapshot diff/pull
  • local repository imports and -force-replace
  • API package handling

Existing packages without Architecture-Variant retain their previous package keys and behavior.

Validation

The implementation was tested with both automated tests and real Ubuntu 26.04 repositories.

A full Ubuntu 26.04 mirror was created for release, updates, security and backports, including main, universe, restricted and multiverse, with both amd64 and amd64v3.

A real Ubuntu 26.04 APT client successfully selected and installed the amd64v3 package when configured with:

APT::Architecture-Variants "amd64v3";

I also tested an in-place upgrade of an existing Aptly mirror database populated by unmodified upstream Aptly. The patched build added the previously discarded amd64v3 packages without requiring a mirror rebuild.

The relevant test suites pass:

go test ./deb
go test ./query
go test ./cmd
go test ./api

The remaining failures from go test ./... are reproducible on the unmodified upstream source and are unrelated to this change.

Additional upstream issues

Two pre-existing issues were found during development and are included as separate commits:

  • API snapshot pull did not fully load the destination snapshot before modifying it.
  • API maximumVersion=1 could collapse packages from different architectures.

Both also affect ordinary non-variant packages.

I can split these into separate PRs if preferred.

Development process

For transparency, I developed this implementation with assistance from OpenAI Codex.

The resulting changes were reviewed and validated with regression tests, real Ubuntu 26.04 repositories, an existing Aptly database and a real APT client.

This is my first contribution to Aptly, so I am happy to adjust the implementation, naming, scope or commit structure to better match the project's conventions.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.16%. Comparing base (f59b0d2) to head (e6efb13).

Files with missing lines Patch % Lines
api/api.go 25.00% 2 Missing and 1 partial ⚠️
api/snapshot.go 66.66% 1 Missing and 1 partial ⚠️
deb/import.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1638      +/-   ##
==========================================
- Coverage   77.37%   77.16%   -0.22%     
==========================================
  Files         165      165              
  Lines       15747    15766      +19     
==========================================
- Hits        12185    12166      -19     
- Misses       2356     2397      +41     
+ Partials     1206     1203       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant