New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI Cross-building #1279
Comments
I managed to cross-build linux arm64 in docker/qemu, which is maybe not the "rust way" and is slow, but seems to work. So, I guess the only thing left is mac arm64. Should I try to just build it for x86_64, but static? I think this would trigger the emulator on M1, and since SDL2 would be inlined, it would use that, instead of system SDL2 with arch-mismatch. What is the best way to do this? I tried adding
|
This may be out of scope for this project, but I am having a heck of a time getting a rust SDL2 project to build in Github CI for linux/mac for arm64, and hope that someone has some experience with this.
Here is what I tried:
For my first pass, I just download SDL for each platform and build it normally. Here is a complete x86-64 build, that seems to work ok.
I tried running the outputted mac x86-64 build on an M1, and although it will start (I think because mac triggers an emulator on incorrect platform) it fails trying to link against my system-installed (via
brew
) SDL2.If I understand the system correctly, I need to use
lipo
to make a universal binary for both platforms, in a single executable.The next step is trying to cross-build for arm64 on mac/linux.
On linux, this fails:
Which seems like an issue with
cross
, but I can't really tell.Mac has a similar fail:
I think this may be related to
cross
not correctly installing the targets it needs, so I addrustup target add aarch64-unknown-linux-gnu
andrustup target add aarch64-apple-darwin
to linux/mac. That fails the same on linux and has an SDL2 linkage error on Mac.This may be an entirely different issue, but on my M1, I tried to simulate building (in docker) the other way (linux arm64 building for linux x86-64) without
cross
, and that didn't work either (I get apkg-config
error):Does anyone know any tricks to getting this to work?
The text was updated successfully, but these errors were encountered: