Use staticx for Aarch64 exe builds #355
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #342
Description
The problem starts with #342 - we needed to solve the glibc issue after upgrading the base image to CentOS 8.
staticx is the easiest solution because that's what we already do for x86_64. However, simply enabling staticx with this patch:
Results in this binary:
Not good.
gdb shows this trace:
Tar extraction calling into
getpwnamwhich ends up loading DSOs... sigh.We don't need this functionality.
So, this PR:
getpwnamandgetgrnam.Known issues
The exe build doesn't pass on x86_64 anymore.
I suspect this to be a bug with the QEMU that emulates the usermode environment for Aarch64 binaries. It doesn't set up a correct environment for
ldd.Before we merge this PR, I plan to inspect if now after #350 I can provision an Aarch64 runner and separate the Aarch64 build steps to run on it instead. This will also make the build faster :) but mostly it will not crash haha.
Alternatively we need to fix the build when running on x86_64. Maybe upgrade QEMU? We all run
multiarch/qemu-user-static:latestso IDK....How Has This Been Tested?
All current binaries used in Aarch64 builds of gProfiler are static - only PyPerf is dynamically built, hence this PR is also in preparation for #287 which finally uses PyPerf in Aarch64.
For the mean time, the only thing "tested" here is that gProfiler's Python starts - staticx provides us with libc. So the tests I have performed for Aarch64 are just
gprofiler --version. For x86_64, I tested PyPerf on appropriate kernel versions as well, and not justgprofiler --version.