← Back to issue list

elf: use snapped strip

View original Github issue

Metadata

Project
snapcraft
Number
#2051
Type
pull request
State
merged
Author
kyrofa
Labels
—
Created
Updated
Closed

Current evaluation

PR snapcraft#2051 by kyrofa merged as commit c8dc5b115: added binutils to debian/control and as a stage-package, and made ELF build-ID stripping use the in-snap strip instead of a host-installed one.

Resolution: closed resolved

Reason: The pull request itself was merged into snapcraft's master as commit c8dc5b115 ("elf: use snapped strip (#2051)"), with +145/-61 lines across 5 files. It fixed the missing binutils dependency by declaring binutils in debian/control and staging it into the snap, then using the bundled strip.

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] 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`? ----- Currently Snapcraft uses the `strip` utility to remove the .note.go.buildid section from ELF files if necessary. However, there are a few issues with the implementation: 1. The Debian package doesn't depend upon binutils (which contains `strip`). 2. The snap doesn't bundle `strip`, thereby relying on its presence on the host. Binutils isn't always available (e.g. in the Docker images), and snaps should bundle all their dependencies. Fix this issue by adding binutils as a dependency in debian/control and as a `stage-package`, and use the snapped version if running as a snap.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PR snapcraft#2051 by kyrofa merged as commit c8dc5b115: added binutils to debian/control and as a stage-package, and made ELF build-ID stripping use the in-snap strip instead of a host-installed one.
stealth/space-bunny-alpha — closed resolved Merged in snapcraft#2051 (commit c8dc5b115), bundling binutils and using the snapped strip utility to remove ELF build IDs without relying on the host.
qwen/qwen3.6-35b-a3b — — Merged a fix that resolves Snapcraft's reliance on the host strip utility by bundling binutils as a stage-package and Debian dependency, ensuring reliable ELF file stripping in isolated environments.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Snapcraft now bundles binutils as a stage-package and Debian dependency, replacing the host-dependent strip utility with the snapped version for ELF file processing.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#1798 (confidence 72%)

    Earlier commit fa8b7b174 introduced the .note.go.buildid stripping that this PR reworked to use the snapped strip.

Related issues

No related issues found above the similarity threshold.