posit-dev / posit-dev/positron
Linux arm64: Binaries not stripped on arm64 RPM builds
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 195
Description
Positron's RPM installer builds for arm64 do not have stripped binaries. This results in binaries that are slightly larger than they need to be, in addition to including unnecessary debug information.
https://www.man7.org/linux/man-pages/man1/strip.1.html
The reason we don't run strip on the bundle (during RPM build) is that, if run, it chokes on some pre-built files from Python vendored dependencies in pydevd, such as cpython-311-x86_64-linux-gnu.so and attach_linux_amd64.so.
Error: Command failed: HOME="$(pwd)/.build/linux/rpm/aarch64" rpmbuild -bb .build/linux/rpm/aarch64/rpmbuild/SPECS/positron.spec --target=aarch64
+ /usr/lib/rpm/brp-strip /usr/bin/strip
/usr/bin/strip: Unable to recognise the format of the input file `/home/runner/work/positron-builds/positron-builds/positron/.build/linux/rpm/aarch64/rpmbuild/BUILDROOT/positron-2025.01.0+999-1735940742.el8.aarch64/usr/share/positron/resources/app/extensions/ms-python.debugpy/bundled/libs/debugpy/_vendored/pydevd/pydevd_attach_to_process/attach_linux_amd64.so'
/usr/bin/strip: Unable to recognise the format of the input file `/home/runner/work/positron-builds/positron-builds/positron/.build/linux/rpm/aarch64/rpmbuild/BUILDROOT/positron-2025.01.0+999-1735940742.el8.aarch64/usr/share/positron/resources/app/extensions/ms-python.debugpy/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_cython.cpython-311-x86_64-linux-gnu.so'
We could:
- stop vendoring this dependency on arm64, or
- delete the offending files before reaching the RPM bundle step (they have no use on an arm64 machine anyway), or
- instead of having rpmbuild perform stripping, do the strip step ourselves so we can control the files for which debug stripping is performed, or
- run away from home and live in the woods
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the aarch64 RPM command with .build/linux/rpm/aarch64/rpmbuild/SPECS/positron.spec and inspect the /usr/lib/rpm/brp-strip step. Check how the vendored pydevd files under resources/app/extensions/ms-python.debugpy are included. Done means the arm64 RPM build completes, strips applicable binaries, and does not pass incompatible x86_64 files to strip.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python, shell
- Domain
- build-system, operating-systems, release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100