← Back to issue list

Snapcraft doesn't report no-op file filtering usage

View original Github issue

Metadata

Project
snapcraft
Number
#4853
Type
issue
State
open
Author
dilyn-corner
Labels
Created
2024-06-13 19:52:33+00:00
Updated
2025-03-13 18:37:20+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

### Bug Description In cases where a `snapcraft.yaml` author puts a: ``` stage: - -foo ``` for some part which *never* provides `foo`, snapcraft will never offer a warning that the directive to exclude `foo` is extraneous (or even outright incorrect). This could lead to someone erroneously including some library which they intend to never distribute, but still do. ### To Reproduce Clone the [avahi](https://github.com/kubiko/avahi/tree/master) snap repository and build on commit 1a8c89bb9b0e8c6a375997118f649202f2be13af using `snapcraft` (8.x any release -- I imagine this also applies to 7.x and even earlier but I have not tested yet). Find that `libnss_mdns*` still exists in the final snap (and the several linter warnings associated), and note that snapcraft never warns that in fact the `avahi` part does not provide this library, but instead the `glue` part does. ### Environment Ubuntu 23.10+, building in LXD managed by snapcraft, using at least snapcraft 8.2.10.post50+gita9badaa3 (but probably every earlier version since 6.x) ### snapcraft.yaml Specifically, https://github.com/kubiko/avahi/blob/1a8c89bb9b0e8c6a375997118f649202f2be13af/snap/snapcraft.yaml ### Relevant log output There actually isn't any relevant log output, though I will say: it would be useful if snapcraft could show the list of files being moved from `parts/foo/install/` to `stage/` and from `stage/` to `prime/` to make triaging this behaviour easier if emitting a warning is not feasible. ### Additional context _No response_

Evaluation history

No evaluation history available.