meta: use build-for in snap.yaml architecture
Metadata
Current evaluation
Merged #4150 as 77d3454d: build-for: all now writes architectures: all to meta/snap.yaml instead of the build-on architecture, fixing CRAFT-1535.
Resolution: closed resolved
Reason: The approved PR was merged as commit 77d3454d5. It corrects generated snap metadata so build-for: all maps to architectures: all.
Evaluated by: mr-cal-bot
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`?
-----
### Details
Previously, using `build-for: all` in a snapcraft project would cause `meta/snap.yaml` to contain the `build-on` architecture, due to [this line](https://github.com/snapcore/snapcraft/blob/2f2d1eac63de39dbd4f9bbfab8ffa5df0ac9ca62/snapcraft/parts/parts.py#L88) from my first implementation of adding support for the `architectures` keyword.
Now, `build-for: all` will cause `meta/snap.yaml` to use `architectures: all`.
### Source
https://bugs.launchpad.net/snapcraft/+bug/1999580
https://forum.snapcraft.io/t/incorrect-architecture-with-snapcraft-7-x-and-build-for-build-on/34130
(CRAFT-1535)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #4150 as 77d3454d: build-for: all now writes architectures: all to meta/snap.yaml instead of the build-on architecture, fixing CRAFT-1535. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in canonical/snapcraft#4150 (77d3454d): build-for: all now emits architectures: all in snap.yaml instead of a build-on architecture, fixing CRAFT-1535. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged fix correcting snap.yaml architecture generation. When build-for is set to all, the file now correctly outputs architectures: all instead of the previous incorrect build-on value. Resolves CRAFT-1535. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into main. Fixed meta/snap.yaml to set architectures: all when build-for: all is used, replacing the incorrect build-on fallback. Resolves bug 1999580. Merged with 100% diff coverage. |
Update history
No update history recorded yet.
Related work
-
Caused By:
snapcraft (launchpad)#1999580
(confidence 98%)
Launchpad bug cited as the source of the CRAFT-1535 fix.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1999580 core22: wrong arch in snap.yaml when building for all archs | snapcraft (launchpad) | closed | Fixed in merged canonical/snapcraft#4150 (commit 77d3454d): core22 snap.yaml now records build-for (all) instead of the build-on architecture. | |
| #5606 schema: add build-for in architectures for core22 | snapcraft | merged | Merged as c9822a38c via snapcraft#5606, adding build-for to the core22 architectures schema in snapcraft.json. | |
| #1685 Implement support for architecture in snapcraft.yaml | snapcraft | closed | Architecture support for snapcraft.yaml landed in PR #2080 (commit c60ac3891), adding CI-oriented build-on/run-on lists. build.snapcraft.io adoption was tracked separately by cjwatson. | |
| #1885150 Cannot use --build-on, architecture list is already set in snapcraft.yaml. | snapcraft (launchpad) | closed | Resolved in Snapcraft 8.7.0: remote-build added --build-for filtering for projects defining architectures or platforms, replacing the unusable --build-on workaround. | |
| #3821 meta: architectures | snapcraft | merged | Merged core22 architecture support, including build-on/build-for handling, host and build-instance selection, and SNAPCRAFT_BUILD_FOR filtering, via commit 4876b53. | |
| #1533713 Add metadata describing the architectures that a snap can be built for | snapcraft (launchpad) | closed | Core20 added build-on/build-for platform metadata in 2018, enabling CI to derive builds and build-for: [all] for architecture-independent snaps. | |
| #4543 fix(remote): parse comma-separated architectures | snapcraft | merged | Merged in snapcore/snapcraft#4543 as b8eed87c0, fixing comma-separated remote-build architectures and enforcing --build-for/--build-on exclusivity. | |
| #393 Support architecture all packages when snapping | snapcraft | merged | Merged snapcraft#393 as ca2301a9d, making directory snaps default to architecture "all" when snap.yaml omits architectures; merge commit: 0adafaa0f. | |
| #4854 Accept `build-for: [all]` and `--build-for=all` for architecture-independent snaps | snapcraft | closed | Resolved: Snapcraft supports build-for [all] and --build-for=all for remote builds/core24 in 8.4.0 and core22 in 8.7.0; requested core22/core24 regression tests were added. | |
| #5859 Non-list `build-for` values are no longer allowed | snapcraft | open | A valid scalar build-for value regresses in Snapcraft 8.13.0: core22 falls back, then crashes with “cannot determine build-for architecture.” The issue is triaged and remains open. |