← Back to issue list

elf: remove dead code

View original Github issue

Metadata

Project
snapcraft
Number
#2000
Type
pull request
State
merged
Author
sergiusens
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #2000 in adc0d3692 removed the unused ELF magic-string return after parsing logic moved to ElfFile.

Resolution: closed resolved

Reason: The cleanup was merged into snapcraft as commit adc0d3692, removing four dead lines from the ELF implementation.

Evaluated by: mr-cal-bot

No scores available.

Issue body

The logic migrated to the ElfFile class which does not use the string returned from magic. Signed-off-by: Sergio Schvezov <sergio.schvezov@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/)? - [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)? - [x] 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`? -----

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #2000 in adc0d3692 removed the unused ELF magic-string return after parsing logic moved to ElfFile.
stealth/space-bunny-alpha — closed resolved Merged PR #2000 (adc0d3692) removed dead ELF code after its logic migrated to ElfFile; the obsolete magic string was no longer used.
qwen/qwen3.6-35b-a3b — — Merged removal of dead code in the ELF module. The unused magic string was eliminated after the logic migrated to the ElfFile class. Approved by a reviewer and passed CI checks.
qwen3.6-35b-a3b-mtp-q6 — — Merged removal of dead ELF code. Logic migrated to the ElfFile class, making the previous magic string handling obsolete. Cleaned up by maintainer sergiusens.

Update history

No update history recorded yet.

Related work

  • Caused By: snapcraft#1989 (confidence 85%)

    The preceding ELF parsing refactor in 393ba2c63 moved logic to ElfFile, leaving the returned magic string unused.

Related issues

Issue Project State Summary Similarity
#1870 elf: remove dependency on magic snapcraft merged Merged PR #1870 in commit d20b9678d, replacing python-magic with readelf for ELF parsing and cleaning up the implementation.
75%
#1989 elf: don't parse elf more than necessary snapcraft merged Merged #1989 (commit 393ba2c63) to avoid parsing ELF files more than necessary, reducing redundant work for a small performance gain.
75%
#2867 elf: remove return parameters for ElfFile's _extract() snapcraft merged Merged PR #2867 as commit fd99d8368, refactoring ElfFile to update attributes directly via _extract_attributes() instead of returning a large tuple.
73%