fix(remote): error early for invalid platform usage
Metadata
Current evaluation
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.
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 `make lint`?
- [x] Have you successfully run `make test`?
---
Raises an early error if `--build-for` is used in combination with shorthand `platforms` entries in the project file.
Launchpad fails with an unfriendly error, so Snapcraft now fails early with a friendlier error.
This is designed so that it can be quickly removed once the upstream bug in Launchpad is resolved.
Remote build spread test: https://github.com/canonical/snapcraft/actions/runs/14045570296/job/39326652643
Fixes #5270
(CRAFT-4186)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix adding early validation to fail gracefully when --build-for conflicts with shorthand platforms entries, preventing unfriendly Launchpad errors. Resolves #5270. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix that validates --build-for usage against shorthand platform entries early, preventing a confusing Launchpad failure. Resolves #5270 as a temporary workaround until the upstream bug is fixed. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #4858 remote build: platform definitions cannot be parsed by Launchpad | snapcraft | closed | Fixed via an upstream Launchpad bug resolution. PR #4994 merged additional --platform argument handling to resolve remaining parsing scenarios. | |
| #5005 fix(remotebuild): error early for multiple artifacts per build-on | snapcraft | merged | Merged. Adds early validation to prevent Launchpad build failures when multiple artifacts share the same build-on architecture. Replaces cryptic errors with a clear message, resolving issue #4995. Approved and passed CI. | |
| #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. | |
| #687 fix(commands/lifecycle): Pass the correct platform and build-for | craft-application | merged | Merged fix correcting platform and build-for parameter passing in lifecycle commands, resolving a "Multiple builds match the current platform" error. Approved by two reviewers and passed CI. | |
| #5216 feat(remotebuild)!: filter build-plan with --build-for, drop --platform | snapcraft | merged | 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. | |
| #4994 fix(remotebuild): parse '--build-for' and '--platform' | snapcraft | merged | Merged fix for remote-build parsing of --build-for and --platform flags. Enforces flag restrictions, updates documentation, and resolves issues #4858 and #4881. Approved by two reviewers with passing CI checks. | |
| #5265 fix(remotebuild): don't fail when cross-compiling | snapcraft | merged | Merged fix resolving remote build cross-compilation failures. Snapcraft now passes build-on architectures to Launchpad instead of build-for, enabling correct cross-compilation and addressing issue #4996. Approved by reviewers and passed CI. | |
| #4892 fix(remotebuild): use legacy launchpad credentials if they exist | snapcraft | merged | Merged fix enabling legacy Launchpad credential fallback for remote builds with a deprecation warning. Added build-for all support, updated spread tests, and resolved issue 4889. Requires craft-application 3.1.0+. Approved and passed CI. | |
| #4996 remote build: fix cross-compiling errors and `build-for: all` errors | snapcraft | closed | Fixed by passing build-on architectures to Launchpad instead of build-for, enabling cross-compiling and correct architecture selection for build-for: all. |