← Back to issue list

Allow staging snap components

View original Github issue

Metadata

Project
snapcraft
Number
#6095
Type
issue
State
open
Author
cnihelton
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Feature request to support snap components in stage-snaps (snap+component syntax). Triaged as feasible; implementation lives upstream in craft-parts PR #1604, currently on hold pending snapd UX decisions on component access/management.

Suggested action: keep open

Reason: The feature is valid and triaged: mr-cal confirmed "This is feasible to implement" and specified using snapd's existing `<snap>+<component1>+...` syntax, noting "The work would primarily be in craft-parts, which has the logic for staging snaps." No implementation exists in this repo (snapcraft/parts/grammar.py only forwards the `stage-snaps` key, and the docs only document `snap-name/channel`), and the last comment states the upstream effort is "currently on hold until we figure out how components should be accessed and managed", so the issue is valid but not yet implementable here. Impact is modest: the reporter's own motivating project was a proof of concept that "was never planned to see daylight" and no other real-world examples have been cited (mr-cal explicitly asked for them), so the only demonstrated need is a shell workaround via `snap download`/`unsquashfs` in override-build.

Evaluated by: mr-cal-bot

Impact: 32 Quick Win: 7 Complexity: 58 Confidence: 78 Actionability: 55

Issue body

### Check existing issues - [x] I've verified that this request isn't described by any existing issues. ### Request It's already possible to use `stage-snaps` in a snapcraft.yaml to compose multiple snaps into a bigger one, or to dump the contents of a list of snaps into a ROCK (in the case of rockcraft.yaml). It would be great if there was a similar way to stage snap components, either extending the syntax of `stage-snaps` to support constructs like `snap+component` or a more specific key `stage-snap-components` in which the items in the list follow the syntax (`snap+component`) (or a better UX you might find that I can't think of right now). ### The problem it solves Allowing this composition aligns the reuse of snaps and snaps components in a finer grained way when composing larger units of deployments, such as composite snaps or ROCKs. I believe such feature should allow decoupling the component from the main snap. Although that could be somewhat surprising for folks used to `snap download snap+component` to acquire both, for `snapcraft.yaml` and other craft-related configurations, certain use cases might benefit from solely bringing the component, such as locale data that happens to be replicated in multiple snaps without having to source one of the main snaps in that case. An optional component in a snap might be a useful dependency of a composite snap.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 32
Quick Win: 7
Complexity: 58
Confidence: 78
Actionability: 55
keep open Feature request to support snap components in stage-snaps (snap+component syntax). Triaged as feasible; implementation lives upstream in craft-parts PR #1604, currently on hold pending snapd UX decisions on component access/management.
qwen/qwen3.6-35b-a3b
Impact: 45
Quick Win: 15
Complexity: 55
Confidence: 80
Actionability: 75
keep open Enhancement to allow staging snap components via stage-snaps syntax. Triaged, with active PR craft-parts#1604 blocked by pending snapd changes.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 18
Staleness: 10
Complexity: 60
Confidence: 85
Support Request: 5
keep open Enhancement to extend stage-snaps to stage snap components (snap+component syntax) for composing ROCKs/composite snaps. Triaged and acknowledged; upstream work in craft-parts#1604 is a draft on hold pending component access/management design.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 65
Confidence: 90
Support Request: 10
keep open Enhancement to extend stage-snaps syntax for staging individual snap components. Triaged and acknowledged by maintainers. Upstream work exists in craft-parts but is currently on hold pending design decisions.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 40
Confidence: 95
Support Request: 5
keep open Enhancement request to allow staging snap components via extended stage-snaps syntax. Triaged, under active discussion, with maintainer implementing in craft-parts and requesting real-world examples.
qwen3.6-35b-a3b-mtp-q6
Staleness: 15
Complexity: 60
Confidence: 95
Support Request: 10
keep open Feature request to extend stage-snaps syntax to support staging individual snap components. Triaged and acknowledged by maintainers, who are working on implementation in craft-parts and requested real-world examples from the author.

Update history

Date Change
updated

Related work

  • Blocked By: canonical/craft-parts#1604 (confidence 90%)

    PR 'feat: handle snap components in stage-snaps' is the draft implementation; per mr-cal it is on hold awaiting snapd UX work and has unresolved review threads plus failing checks, so snapcraft-side support depends on it landing.

Related issues

Issue Project State Summary Similarity
#1604 feat: handle snap components in stage-snaps craft-parts open Adds snap component support to stage-snaps (unpacking component trees, SNAP_COMPONENTS). Marked draft by mr-cal pending snapd UX decisions; 3 unresolved review threads and 5 CI jobs still failing.
80%
#1805214 stage-snaps snapcraft (launchpad) closed Feature request for a stage-snaps keyword (unpack a snap's content into the snap being built, like stage-packages) was implemented and merged in canonical/snapcraft#2468 (commit 0983e4063), then shipped in the 3.2 release; follow-up fixes in #2525 and #3211.
74%
#270 Support $SNAPCRAFT_STAGE for parts snapcraft merged Merged in canonical/snapcraft#270 via eb033b40c, adding part-time replacement of $SNAPCRAFT_STAGE with the absolute stage-directory path.
72%
#1747778 Snapcraft.yml in 'snap' directory. prime/parts/stage in '.' snapcraft (launchpad) open Feature request (2018) to let snapcraft put parts/stage/prime build dirs next to snap/snapcraft.yaml instead of the project root. Maintainer kyrofa agreed it is desirable; no implementation exists — lifecycle still uses Path.cwd() as work_dir.
71%
#1538688 Support referencing the stage dir from snapcraft.yaml snapcraft (launchpad) closed Implemented SNAPCRAFT_STAGE substitution for part properties and merged the fix in canonical/snapcraft#270 via eb033b40c.
70%