fix: improve `platforms.<platform>.build-on` validation
Metadata
Current evaluation
Closed unmerged as redundant: PR canonical/rockcraft#567 had already improved build-on validation by adopting craft-application's default BuildPlanner.
Resolution: closed superseded
Reason: The author closed the PR after confirming that merged PR canonical/rockcraft#567 coincidentally fixed the same build-on validation problem.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Provide a helpful error message if `rockcraft.yaml` contains a `platforms.<platform>.build-on` which is not a list.
Fixes #632.
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? *
\* my employing organization should have signed it AFAIK.
Example of change
-----
Given this snipped of a `rockcraft.yaml`:
```yaml
...
platforms:
arm64:
build-on: amd64
...
```
### Before:
```bash
$ rockcraft build --debug
Bad rockcraft.yaml content:
- error for platform entry 'arm64': value is not a valid list (in field 'platforms')
For more information, check out: https://documentation.ubuntu.com/rockcraft/en/stable/reference/rockcraft.yaml
```
#### After:
```bash
$ rockcraft build --debug
Bad rockcraft.yaml content:
- error for platform entry 'arm64': 'build-on' field must be a list of strings. (in field 'platforms')
For more information, check out: https://documentation.ubuntu.com/rockcraft/en/stable/reference/rockcraft.yaml
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged as redundant: PR canonical/rockcraft#567 had already improved build-on validation by adopting craft-application's default BuildPlanner. | |
| stealth/space-bunny-alpha | — | closed superseded | Closed unmerged as redundant: #567’s adoption of craft-application’s default BuildPlanner had already fixed the build-on validation. The author confirmed the overlap before closing the PR. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed by author as superseded by PR #567. The original changes to improve build-on validation error messages were rendered unnecessary by a concurrent fix. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without merging. The validation fix was coincidentally implemented in pull request #567, superseding this contribution. Author closed the PR to prevent duplication. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
canonical/rockcraft#567
(confidence 99%)
Its adoption of craft-application's default BuildPlanner had already fixed the validation behavior.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4650 Refactor `platform` validation | snapcraft | closed | Closed as completed after platform validation was refactored and the build planner moved to the craft-application 5 and craft-platforms architecture. | |
| #632 Confusing schema validation message for `platforms.<platform>.build-on`. | rockcraft | closed | Resolved by merged PR #567 (5f898b32): validation now identifies platforms.<platform>.build-on; the reporter confirmed the clearer message and requested closure. | |
| #698 Use craft-platforms for build plans | rockcraft | closed | Merged PR #715 (516d29e5) replaced Rockcraft's custom build-plan generation with craft-platforms, resolving #698 and aligning plans with downstream consumers. | |
| #639 Move the build planner logic into craft-platforms | rockcraft | closed | Build planner logic extracted to craft-platforms in merged PR canonical/craft-platforms#25 (commit d9ff004); rockcraft later simplified in commit 5f898b32. Maintainer mr-cal confirmed completion. | |
| #1876 Use craft-platforms for build plans | charmcraft | closed | Closed as done: charmcraft PR #1894 (commit f1755e8f) switched build plan generation to craft-platforms via craft-application's BuildPlanService; rockcraft did the same in #715. | |
| #502 Refactor platform validation | rockcraft | open | Refactor platform validation by consolidating it in Project and removing BuildPlanner. Resolved via migration to craft-application 5. | |
| #68 Possibly misleading error message when getting rock build plan | craft-platforms | closed | Bare Rock bases now receive targeted validation instead of a misleading distribution-format error. Fixed by merged PR canonical/craft-platforms#123 (80ac005). | |
| #5351 fix(remote): error early for invalid platform usage | snapcraft | merged | PR #5351 merged as commit 0c224fc7d, adding an early, friendlier error when --build-for is used with shorthand project platforms instead of failing at Launchpad. Fixes #5270 (CRAFT-4186); restriction later lifted by #5687. | |
| #365 feat: accept build-for: [all] in platforms | craft-application | merged | Merged PR canonical/craft-application#365 (CRAFT-3016): accepts 'build-for: [all]' in platform definitions, disallowing other platforms when set; closes craft-application#360, related to snapcraft#4854. | |
| #49 support architecture-specific builds | rockcraft | closed | Architecture-specific builds were implemented by merged PR canonical/rockcraft#52, adding the platforms primitive in commit 9f4269c4. |