ref: Cross-compile aarch64 python pkg#699
Conversation
This ports getsentry/relay#1438 to symbolic. It is using a x86_64 docker container configured for cross compiling that builds a aarch64 symbolic binary which is then re-used when building the aarch64 wheel. Thus it avoids running the whole cargo build in aarch64 qemu which can be extremely slow.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #699 +/- ##
==========================================
+ Coverage 72.82% 72.85% +0.03%
==========================================
Files 92 92
Lines 18418 18428 +10
==========================================
+ Hits 13412 13426 +14
+ Misses 5006 5002 -4 |
|
Here is a quick summary of what goes wrong in this PR and our options to fix this. Breaking builds All the Linux builds in the connected release action break because of the incorrect environmental setup of the C++ toolchains (aarch64 as an example where g++ cannot even find the Incompatible Compiler The bigger problem is the supplied compiler. The versioned symbol requirements of The thus preferred distribution Centos 7, only provides GCC at version Building an I started a quick prototype of a docker-image which builds a cross-compilation toolchain from source using Building the image takes around an hour on GitHub (run), but this image needs to be built very rarely, and the actual build for I see no reason we couldn't extend this docker-image with the pypa image as the last stage to include the python wheel building environment (which would allow us to conditionally run Counter to the repository's name, the currently built toolchain is not compatible with I could not find another publicly uploaded cross-compilation image that targets anything below Open questions/Next steps
|
I believe we can bump quite a bit higher than that. I will defer to @asottile-sentry to give an authoritative answer and to also chime in on the other questions. Another alternative would be to just stop pulling in the C++ (swift-demangle) dependency into the CABI crate. We might as well just remove the need to build the C++ code alltogether. We might need to do an API-breaking release soon anyway due to #729. |
|
All our de-mangling happens in dump_syms so we never access it from Python. |
|
@loewenheim noticed that we have a symbolic/py/symbolic/symcache.py Lines 41 to 44 in 0b39652 @gabrielesvelto can I assume that you are never using that? In which case we can just safely remove it with the next breaking change. |
|
Mozilla Symbolication Service is not using |
|
for manylinux, sentry only cares about 2_28+ so go wild |
This ports getsentry/relay#1438 to symbolic. It is using a x86_64 docker container configured for cross compiling that builds a aarch64 symbolic binary which is then re-used when building the aarch64 wheel. Thus it avoids running the whole cargo build in aarch64 qemu which can be extremely slow.
Currently the complete build for the binary python package runs in an arm64 qemu, which is super slow. The idea would be to cross-compile the symbolic-cabi library and then move that into the arm64 qemu image. That way, the cross-compile would be slow, and only a tiny part of packaging up the python bits is run in qemu.
The difficulty here is to find the right way to cross-compile the library, where the C/C++ bits (mostly related to demangling) need a C++ cross-compiling setup, and the image that does the cross compilation is "sufficiently old" to have a build-time glibc dependency that matches the one required by the python target.
As I believe python
manylinux2014is already outdated itself, we might jump to the next higher version (manylinux_2_24I believe?) which has newer glibc requirements, requiring a "less old" image / C++ compiler to build.