linters: add linter check for unused libraries
Metadata
Current evaluation
Merged PR #4028 as commit e82a4434d, adding a linter warning when a snap packages a library that is not used.
Resolution: closed resolved
Reason: PR #4028 was approved and merged as commit e82a4434d. The library linter now reports unused packaged libraries, implementing CRAFT-1588.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint`?
- [x] Have you successfully run `pytest tests/unit`?
-----
This PR adds a new linter warning when a library is packaged into a snap but not used.
The changes are split into 5 smaller commits.
These changes are inspired by some of the excellent work in https://github.com/snapcore/snapcraft/pull/3413
(CRAFT-1588)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4028 as commit e82a4434d, adding a linter warning when a snap packages a library that is not used. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #4028 as e82a4434d, adding a linter warning when packaged libraries are unused; the five-part CRAFT-1588 change was approved. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged following reviewer approval and successful CI checks. Adds a linter warning to flag unused libraries packaged into snaps. The update modifies 22 files with 449 additions and 40 deletions across five commits. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a five-commit change adding a linter warning for unused libraries packaged in snaps. Authored by maintainer mr-cal, this update addresses CRAFT-1588 and enhances build-time validation. |
Update history
No update history recorded yet.
Related work
-
Related To:
snapcraft#3413
(confidence 95%)
Closed PR #3413 inspired the unused-library checking work.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3872 linters: add missing library linter | snapcraft | merged | Merged PR #3872 as c5f4d8b53, adding a linter for missing ELF payload dependencies and fixing filename filtering in the classic linter. | |
| #4149 Add a linter for staged libraries included in the base snap | snapcraft | open | Add a library linter that reports staged libraries also supplied by the base snap, reducing snap size and attack surface; triaged and still unimplemented. |