← Back to issue list

Provide option to filter stage packages

View original Github issue

Metadata

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

Current evaluation

Enhancement to exclude unwanted dependency packages from stage-packages after base migrations; triaged and maintainer-endorsed, with reproducible core22/core24 examples showing major snap-size growth, but remains unimplemented.

Suggested action: keep open

Reason: The issue is labeled Status: Triaged and Type: Enhancement, and maintainer mr-cal explicitly agreed that stage-packages filtering is primitive and needs improvement. The reporter provides core22/core24 branches and manifests demonstrating 70% size growth, while the current project model still exposes stage_packages as Grammar[list[str]] and no package-exclusion implementation was found.

Evaluated by: mr-cal-bot

Impact: 58 Quick Win: 18 Complexity: 60 Confidence: 91 Actionability: 79

Issue body

### What needs to get done When migrating from base `core22` to `core24` my snap unexpectedly grew in size by 70%. While inspecting the resulting manifests, it appears that way more stage packages were pulled in unnecessarily. Be this the result of the deb package dependency change or something else, the runtime requirements of the snap did not change. Rather than filter excess files individually, an ideal option would be to allow filtering on the stage package level. For example: ``` stage-packages: - abootimg - bash - bash-completion - bc - -adduser - -llvm ``` Example snap to reproduce the issue: https://github.com/kubiko/toolbox/tree/22 https://github.com/kubiko/toolbox/tree/24 Resulting manifests: [base `core22` manifest](https://paste.ubuntu.com/p/vcMKhdwyfP/) [base `core24` manifest](https://paste.ubuntu.com/p/NS4jYZwwjq/) ### Why it needs to get done Allow additional syntax in the `stage-packages` definition, allowing filtering on the stage package level.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 58
Quick Win: 18
Complexity: 60
Confidence: 91
Actionability: 79
keep open Enhancement to exclude unwanted dependency packages from stage-packages after base migrations; triaged and maintainer-endorsed, with reproducible core22/core24 examples showing major snap-size growth, but remains unimplemented.
qwen/qwen3.6-35b-a3b
Impact: 65
Quick Win: 25
Complexity: 45
Confidence: 70
Actionability: 70
keep open Enhancement to allow filtering stage packages by name using minus prefix syntax (e.g., -adduser). Triaged and acknowledged by maintainers as a valid improvement over current primitive filtering.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 22
Staleness: 65
Complexity: 55
Confidence: 85
Support Request: 10
keep open Feature request to add exclusion syntax (e.g. leading dash) to stage-packages so users can filter out unwanted stage packages, motivated by a 70% snap size increase when migrating from core22 to core24. Triaged, acknowledged by a maintainer, and tracked in internal ticket SNAPCRAFT-1132; not yet implemented.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 45
Confidence: 85
Support Request: 10
keep open Enhancement request to add package-level filtering syntax to stage-packages. Triaged and acknowledged by maintainers, but inactive for over a year. Awaiting implementation or community contribution.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 85
Support Request: 10
keep open Enhancement to allow filtering stage packages via a negative prefix syntax in snapcraft.yaml. Triaged and acknowledged by maintainers, but inactive for over a year.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.