elf: only consider regular files as possible ELF binaries
Metadata
Current evaluation
Merged a fix restricting ELF binary detection to regular files, resolving Snapcraft core snap build failures caused by device files being misidentified. Approved by reviewers and passed CI checks.
Suggested action: —
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] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
Only consider regular files (or symlinks to regular files) as possible ELF binaries in `ElfFile.is_elf`. At present, Snapcraft has trouble building the core snap due to the presence of device files.
LP: #1752766
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix restricting ELF binary detection to regular files, resolving Snapcraft core snap build failures caused by device files being misidentified. Approved by reviewers and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix restricting ELF binary detection to regular files and symlinks. Resolves core snap build failures caused by device files being incorrectly identified as ELF binaries. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix to ElfFile.is_elf that restricts ELF detection to regular files and symlinks. This resolves core snap build failures caused by device files being incorrectly processed as ELF binaries. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2830 elf: properly handle corrupted ELF files | snapcraft | merged | Merged. Snapcraft now catches errors and issues warnings instead of crashing during priming when encountering corrupted ELF files. Test binaries from Qt 5.13 were added, and commits were squashed with source attribution included per reviewer feedback. | |
| #75 refactor: rewrite elf file support | debcraft | merged | Merged rewrite of ELF file support to better match deb building needs, replacing Snapcraft's implementation. Handles needed libraries; symbol support deferred. Approved by two reviewers, passed all CI checks, and resolves #72. | |
| #2021 pluginhandler: only resort to elf mangling if the snap type is app | snapcraft | merged | Merged a fix restricting ELF mangling to app-type snaps only. Approved, passed CI, and updated one file with 12 additions and 4 deletions. | |
| #2081 elf: patch everything instead of a subset of elf files | snapcraft | merged | Merged a pull request that restores Snapcraft 2.39 behavior by patching all ELF files instead of a subset, reverting a prior change. Approved and passed CI. |