Skip to content

Add support for architecture variants - #1638

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

hjmitsd wants to merge 13 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.

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