← 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

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.

Suggested action: keep open

Reason: The issue is labelled Status: Triaged / Type: Enhancement, a maintainer (mr-cal) explicitly endorsed it ('I like this idea and agree that the stage-packages key would benefit from improvements'), and an internal ticket SNAPCRAFT-1132 was created. Code inspection confirms the feature is still absent: stage_packages is still Grammar[list[str]] in snapcraft/models/project.py with no exclusion syntax, so the request remains valid and should stay open despite ~13 months of inactivity.

Impact: 50 Quick Win: 22.5 Staleness: 65 Complexity: 55 Confidence: 85 Support Request: 10

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
qwen/qwen3.8-27b
Impact: 50
Quick Win: 22.5
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 30
Confidence: 90
Support Request: 0
keep open Enable filtering stage packages via a minus prefix syntax to reduce snap size and exclude unnecessary dependencies. Currently triaged and under discussion, awaiting implementation. Last updated 392 days ago.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.