← Back to issue list

Extend advanced grammer to all keys of snapcraft

View original Github issue

Metadata

Project
snapcraft
Number
#6064
Type
issue
State
open
Author
soumyaDghosh
Labels
Created
Updated
Closed

Current evaluation

Request to extend advanced grammar (on/to/else) to all snapcraft.yaml keys (apps, plugin params like cmake-parameters, per-arch part skipping). Grammar currently limited to 6 part keys. Unlabeled; cross-referenced to craft-application#985.

Suggested action: needs triage

Reason: No labels, assignee, or maintainer response in this issue; the only comment (187 days ago) is a user cross-reference to craft-application#985, which is open and acknowledged for the plugin-parameters portion but does not triage this issue. Code confirms the request is unimplemented: snapcraft/parts/grammar.py restricts grammar to source, build-environment, build-packages, stage-packages, build-snaps, stage-snaps, and GrammarAwareProject models only those fields.

Impact: 45 Quick Win: 15.75 Staleness: 55 Complexity: 65 Confidence: 75 Support Request: 15

Issue body

I believe the advanced grammar should be usable throughout the complete snapcraft.yaml. Projects targeting multiple architectures currently requires maintaining multiple manifests for multiple architectures. An example pain point is, consider, there are 3 services, only 1 needs to run in both amd64 and arm64, the other 2 are exclusive to only one architecture, how can one handle that? ```yaml app1: command: app1 daemon: simple restart-condition: always restart-delay: 5s app2: command: app2 daemon: simple restart-condition: always restart-delay: 5s after: - on amd64: - app1 app3: command: app3 daemon: simple restart-condition: always restart-delay: 5s after: - on arm64: - app1 ``` I believe this should be fairly simple. Also, another scenario, where I just don't want to build a particular part in one architecture, currently I'll have to do this ```yaml part: override-build: | if [ "${CRAFT_ARCH_BUILD_FOR}" == "arm64" ]; then echo "skipping..." else craftctl default fi ``` But I think this not really a very clean solution. Also, I believe using the advanced grammar on keys like cmake-parameters is also essential and is fairly simple. The current solution is very hacky ```yaml part: cmake-parameters: - -DPI=${PI} - -DX86=${X86} build-environment: - on arm64: - PI: "ON" - X86: "OFF" - on amd64: - X86: "ON" - PI_SNAP: "OFF" ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 45
Quick Win: 15.75
Staleness: 55
Complexity: 65
Confidence: 75
Support Request: 15
needs triage Request to extend advanced grammar (on/to/else) to all snapcraft.yaml keys (apps, plugin params like cmake-parameters, per-arch part skipping). Grammar currently limited to 6 part keys. Unlabeled; cross-referenced to craft-application#985.
qwen/qwen3.6-35b-a3b
Staleness: 55
Complexity: 70
Confidence: 85
Support Request: 10
needs triage Feature request to extend conditional advanced grammar syntax to all snapcraft.yaml keys to avoid multiple manifests or shell workarounds. Open for 148 days with no maintainer response or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 65
Confidence: 75
Support Request: 10
needs triage Feature request to extend conditional advanced grammar syntax across all snapcraft.yaml keys for multi-arch builds. Currently unlabelled and awaiting maintainer assessment.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 60
Confidence: 85
Support Request: 10
needs triage Extends Snapcraft advanced grammar conditional logic to all snapcraft.yaml keys for cleaner multi-architecture builds. Open 112 days with one comment linking to a related craft-application issue. Awaiting triage and assignment.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-application#985 (confidence 80%)

    Cross-referenced in the issue's only comment; #985 tracks enabling advanced grammar in plugin parameters (e.g. cmake-parameters), one of the three scenarios requested here, and is open with maintainer acknowledgement.

Related issues

Issue Project State Summary Similarity
#985 Support Snapcraft advanced grammar in plugin parameters? craft-application open Feature request to support advanced grammar (on/to/else) in plugin parameters like cmake-parameters for arch-specific build flags. Triaged by maintainers in Jan 2026, confirmed valid but requiring extra work; no progress since.
77%
#5995 Documentation doesn't describe which keys can use advanced grammar snapcraft open Docs gap: advanced-grammar reference never lists which snapcraft.yaml keys support the syntax (only hinted via examples). Maintainer confirmed the omission and pointed to a separate feature request for broader key coverage; doc fix still pending.
74%