← Back to issue list

Multiple platforms with `build-for: all` might need to be considered an error

View original Github issue

Metadata

Project
craft-platforms
Number
#125
Type
issue
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

Question whether multiple platforms with build-for: all must error. Generic planner still raises AllSinglePlatformError, but maintainers disagree on whether validation belongs here or in consumer schemas; Launchpad compatibility unresolved.

Suggested action: keep open

Reason: The code still enforces the proposed behaviour — `_validate_build_for_all` in craft_platforms/_platforms.py raises `AllSinglePlatformError` for multiple `build-for: all` platforms, matching mr-cal's note that 'this is already checked in the default build planner but not charmcraft's planner'. Maintainers engaged but reached no decision: mr-cal argues validation 'should come from the pydantic model rather than craft-platforms', while lengau replies 'we'd need to roll back that check on the generic build planner' yet adds 'In practice, Launchpad using this library might mean we should keep this as an error'. This is a live design/ownership question with cross-project (craft-application, charmcraft, Launchpad) impact, not a stale or resolved report, so it should stay open pending a decision rather than be triaged fresh or closed.

Evaluated by: mr-cal-bot

Impact: 38 Quick Win: 5 Complexity: 62 Confidence: 62 Actionability: 32

Issue body

This was found by @alvaro-crespo: ```python ( "unified multiple build-for all platforms", { "bases": None, "base": "ubuntu@20.04", "platforms": { "ubuntu-amd64": { "build-on": ["amd64"], "build-for": ["all"], }, "ubuntu-arm64": { "build-on": ["arm64"], "build-for": ["all"], }, }, "expected": [("20.04", "amd64"), ("20.04", "arm64")], }, ), ``` This is probably a bug, but I'd like to discuss it with @mr-cal and @cmatsuoka before saying for sure. 1. This is almost certainly a bug if it's accepted for snapcraft and charmcraft. 2. I am unsure how the generic planner should behave in this case.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 38
Quick Win: 5
Complexity: 62
Confidence: 62
Actionability: 32
keep open Question whether multiple platforms with build-for: all must error. Generic planner still raises AllSinglePlatformError, but maintainers disagree on whether validation belongs here or in consumer schemas; Launchpad compatibility unresolved.
stealth/space-bunny-alpha
Impact: 34
Quick Win: 9
Complexity: 47
Confidence: 93
Actionability: 52
keep open Multiple platform definitions with build-for: all are rejected by the generic planner, but maintainers have not settled whether validation belongs in craft-platforms or consumer schemas; Launchpad compatibility remains unresolved.
qwen3.6-35b-a3b-mtp-q6
Impact: 60
Quick Win: 27
Staleness: 75
Complexity: 55
Confidence: 65
Support Request: 0
keep open Design discussion on whether multiple platforms with build-for: all should be an error in craft-platforms validation logic.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 65
Confidence: 80
Support Request: 15
close stale Design discussion on whether multiple platforms with build-for: all should trigger an error, focusing on validation placement between craft-platforms and pydantic models.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 45
Confidence: 65
Support Request: 10
needs triage Stalled discussion on whether multiple platforms using build-for: all should trigger an error, with maintainers debating validation placement between pydantic and craft-platforms.

Update history

No update history recorded yet.

Related work

  • Related To: craft-application#360 (confidence 45%)

    Supplied as a related issue and closed by canonical/craft-application#365; covers allowing build-for: all for platform-independent builds, i.e. the same validation area, but is a consumer-side schema change rather than a fix to this planner check.

Related issues

Issue Project State Summary Similarity
#360 Allow build-for "all" for platform-independent builds. craft-application closed Merged PR #365 to support build-for [all] for platform-independent builds, including validation, an application-level opt-out, and tests; resolved #360 and CRAFT-3016.
71%