linters: add classic confinement linter
Metadata
Current evaluation
Merged addition of a classic confinement linter warning about incorrect elf binary interpreter or rpath values and staged libc. Adjusts existing elf infrastructure, passed review and CI, was rebased on main, and increased code coverage.
Suggested action: —
No scores available.
Issue body
The classic linter warns if elf binary interpreter or rpath values
are not set to expected values for classic confinement or if libc
is staged. In this case, values from the base snap or `$ORIGIN`
should be used.
Note: this PR includes many adjustments to the existing elf
infrastructure used by the classic linter.
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
- [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/)?
- [ ] Have you successfully run `make lint`?
- [ ] Have you successfully run `pytest tests/unit`?
-----
CRAFT-1090
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged addition of a classic confinement linter warning about incorrect elf binary interpreter or rpath values and staged libc. Adjusts existing elf infrastructure, passed review and CI, was rebased on main, and increased code coverage. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged addition of a classic confinement linter to validate ELF interpreter and rpath values against base snap or $ORIGIN settings. Includes underlying ELF infrastructure updates and was rebased on main before integration. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Added a classic confinement linter to validate ELF interpreter and rpath values, preventing incorrect libc staging. Includes ELF infrastructure updates, rebased on main, and increased test coverage by 0.14%. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3872 linters: add missing library linter | snapcraft | merged | Merged changes add a missing library linter to list ELF dependencies in the payload directory and fix filename filtering in the classic linter. Approved, passed CI, and increased coverage by 0.02%. | |
| #3978 linters: fix classic linter interpreter warning | snapcraft | merged | Merged into hotfix/7.2. Resolves a classic linter interpreter warning by conditionally verifying the interpreter section. Approved, passed CI, and achieved 100% diff coverage. | |
| #1094 core: switch to using rpath for clasic confinement. | snapcraft | merged | Merged after reviewer approval and CI checks. The change switches the core module to use RPATH for classic confinement, resolving LP #1657504. The minimal two-file diff adjusts ELF dynamic linker path resolution behavior. |