-
Notifications
You must be signed in to change notification settings - Fork 27
Add cross-compilation for x86 and arm64 targets (including Apple Silicon) #7
Add cross-compilation for x86 and arm64 targets (including Apple Silicon) #7
Conversation
This is great! Can you also add in support for Apple silicon Macs? I believe the Rust target is |
Potentially - will have a look later today! 😊 |
I did a find and replace all of |
Gotta love Rust for their compilers! 🎉 Can you also confirm it works if you use it in combination with Signal Desktop? Having a native binary isn't always a guarantee that it works in combination with the consuming app 😊 |
Yep! That's what I confirmed it with :) (altho not the entire Signal-Desktop but a stripped down, forked version of v1.39.6) |
Awesome! Will incorporate your changes into this PR later today :) |
I realized that, just like you, I only tested by replacing the build arch to arm64 back in September. But in a real-world scenario, this library would be supporting multiple architectures at the same time. I think 2f4bdfc would be a feasible option (it doesn't consider cross-compilation from e.g. x64 to arm64 yet though), but I haven't had time to test it yet. Will do so in the coming days. Given that this PR has been open for a while, I don't think we have to rush too much to squeeze in these changes. |
@KishanBagaria this PR now supports cross-compiling for Apple Silicon, but the downside is that I had to bump the Rust toolchain to 1.49.0 which introduces some negative side-effects: https://github.com/dennisameling/zkgroup/runs/1882504030?check_suite_focus=true Could you try cloning this PR locally and then running:
You should then be able to find I also updated zkgroup/ffi/node/zkgroup/internal/Native.ts Lines 19 to 20 in a463848
I'll try to fix CI later this week 👍🏼 |
@dennisameling I'll DM you access to my rented arm64 Mac, not using it for anything atm :) |
Was able to let CI generate the binaries both for Windows and Mac arm64 (Apple Silicon), so that's good news! 🚀 https://github.com/dennisameling/zkgroup/releases/tag/v0.7.1-test6 |
Is arm64 for Linux on the roadmap as well? |
@sebdanielsson I tried cross-compiling for Linux arm64 as well, but on a x86_64 host that leads to linker errors:
Building on an arm64 host (Surface Pro X using WSL2 Ubuntu 20.04) works though. Since GH Actions is x64-only, an option might be to add a Dockerfile which uses things like Do you have any other suggestions? If not, I'll go ahead and try with the Dockerfile. Should do the trick |
Since there were some updates in this repo currently which are conflicting with my changes, I decided to just create a new PR as that was the fastest: #14 Closing this PR in favor of the newer one |
@sebdanielsson I got it to work with cross-compilation on Linux to arm64 and ia32: #14 Pre-built binaries are now in dennisameling/signal-zkgroup-node@5f28c4b 🎉 |
Currently,
zkgroup
only supports x64. This PR adds cross-compilation support tozkgroup
. It assumes that a x64 host is being used.Also bumps the Rust toolchain to 1.49.0 as that's needed for Apple Silicon support.
Related to signalapp/Signal-Desktop#3745 and signalapp/Signal-Desktop#4461.
Supported architectures: