feat(remotebuild)!: filter build-plan with --build-for, drop --platform
Metadata
Current evaluation
Merged after review and passing CI. Introduces --build-for to filter build plans, removes --platform due to Launchpad API limitations, and improves error handling. Resolves #4992.
Suggested action: —
No scores available.
Issue body
- [x] Have you followed the [guidelines for contributing](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `tox run -m lint`?
- [x] Have you successfully run `tox run -e test-py310`? (supported versions: `py39`, `py310`, `py311`, `py312`)
-----
* Allows using `--build-for` to filter entries in the `architectures` or `platforms` keys in a project file.
* For more information on how these arguments operate, see [this section of the documentation](https://canonical-snapcraft--5216.com.readthedocs.build/en/5216/explanation/remote-build/#id1), which is updated by this PR.
* Drop the `--platform` argument. For more information, see [this comment](https://github.com/canonical/snapcraft/pull/5216#issuecomment-2613110424).
* Catches Launchpad errors, which were percolating up as internal errors.
There are still ways for remote builds to fail due to Launchpad's limited processing of the `platforms` key. That is out of scope here.
The :tada: passing :tada: remote spread tests are [here](https://github.com/canonical/snapcraft/actions/runs/12960688013/job/36167583889).
Fixes #4992
(CRAFT-3277)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after review and passing CI. Introduces --build-for to filter build plans, removes --platform due to Launchpad API limitations, and improves error handling. Resolves #4992. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Implemented --build-for to filter build-plan entries and removed --platform due to Launchpad API limitations and UX complexity. Fixed internal error propagation for Launchpad failures. Approved after dismissing an unrelated test failure. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Introduces --build-for to filter build-plan entries and removes --platform due to Launchpad API limitations and UX complexity. Resolves #4992. Merged after dismissing an unrelated test failure. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4992 remote build: filter build plan with `--build-for`, drop `--platform` | snapcraft | closed | Resolved via PR #5216. Implemented --build-for filtering for remote build plans. The --platform flag was dropped pending full Launchpad support for the platforms key. | |
| #272 feat(platforms): support --build-for to select platform | craft-application | merged | Merged to add --build-for flag for platform selection and update _filter_plan API with host_arch parameter for remote builds. Approved by two reviewers, passed CI, and resolves issue #254. | |
| #5687 feat(remote): allow using shorthand platforms with --build-for | snapcraft | merged | Merged a feature enabling shorthand platforms with the --build-for flag. The change removes a prior restriction now that related Launchpad bugs are resolved. Approved by three reviewers and passed CI checks before integration. | |
| #86 feat(project): add support to platforms in build plan | craft-application | merged | Implemented generic platform name filtering for build plans, resolving issue #83. Merged after reviewer approval and passing CI checks with 100% diff coverage. | |
| #365 feat: accept build-for: [all] in platforms | craft-application | merged | Merged via rebase after approval and passing CI. Enables build-for: [all] in platform definitions, restricting other platforms when used. Resolves #360. | |
| #5351 fix(remote): error early for invalid platform usage | snapcraft | merged | Merged a fix that raises an early error when --build-for conflicts with shorthand platform entries, preventing unfriendly Launchpad failures. The change passed CI checks and received approvals, resolving issue #5270. |