providers: specify build-on and build-for in instance name
Metadata
Current evaluation
Merged changes to instance naming convention, incorporating build-on and build-for architecture specifications. Approved by reviewers, passed CI with 100% coverage, and enables core22 multi-architecture support.
Suggested action: —
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
New naming convention for instances.
Part 6 of supporting architectures for `core22`. Full code change is proposed [here](https://github.com/snapcore/snapcraft/pull/3712).
#### Previous naming convention
`snapcraft-<project_name>-<inode-number>`
`snapcraft-hello-world-10488157`
#### New naming convention
`snapcraft-<project_name>-on-<build_on>-for-<build_for>-<inode-number>`
`snapcraft-hello-world-on-amd64-for-arm64-10488157`
#### Reference: Charmcraft naming convention
`charmcraft-<project_name>-<inode-number>-<bases_index>-<build_on_index>-<target_arch>`
`charmcraft-hello-world-20846552-2-1-amd64`
Where `bases_index` and `build_on_index` are the indices of each base and architecture defined in the charmcraft config.
For snapcraft, I chose to use the architectures names themselves, rather than indices. It's more descriptive and is not affected by the re-ordering of architectures in `snapcraft.yaml`.
(CRAFT-1172)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged changes to instance naming convention, incorporating build-on and build-for architecture specifications. Approved by reviewers, passed CI with 100% coverage, and enables core22 multi-architecture support. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Updated instance naming convention to include build-on and build-for architecture details, enhancing multi-architecture support for core22. Achieved 100% test coverage upon integration. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Updates instance naming convention to include build-on and build-for architectures, enabling multi-architecture support for core22. Achieved 100% code coverage. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4341 architectures: allow same arch in multiple build-ons in core20 | snapcraft | closed | Abandoned and closed. Core20 support for duplicate build-on architectures was rejected because core22 and newer bases natively handle this via build-for. Implementing for core20 was deemed too risky and effort-intensive for an enhancement. | |
| #601 feat: use platform name in build instance name | craft-application | merged | Merged. Changes build instance naming to use platform names instead of architectures, preventing shared environments. Approved by two reviewers, the +40/-10 line update across four files fixes #600 and unblocks dependent work. |