-
Notifications
You must be signed in to change notification settings - Fork 231
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
Running cargo test
fails out-of-the-box on an M1 Mac
#473
Comments
This is an excellent write-up! I think you covered everything here. The only thing I'll add is the actual error log for verbosity:
and running a |
So wanted to update on this as I had time to finally fix it! The real issue was indeed having incompatible Java and JNA versions which is "fixed" by installing an arm64 java.
While this definitely over-complicates things for M1 users. I actually believe this is the way to go for the near future as it allows flexibility for arm64 and x86_64 when one or the other is needed for simple compiling. I do think this was in part contributing to "operator error" as I had x86_64 JVM but JNA auto-detects and "forces" arm64 since it detects that platform. Don't necessarily know what the "right" way to fix this would be other than possibly detecting what JVM they have and generating the libs based on that but this seems really specific to Apple silicon. Possibly a doc that FAQ with what is happening? Definitely open to any ideas! |
@badboy this could be an interesting one for you to take a look at as well, and in fact I'm curious if you encountered this problem yourself. |
Indeed, I'll take a look here |
It seems in the meantime the offered JDK is native and thus all things already work? Native run:
Rosetta 2 run (x86_64 emulation):
|
cc @rfk -- IMO we can close this now. wdyt? |
@skhamis, WDYT? ^ |
I think we can safely close this, seems to be a mis-configure of binaries JDK/JNA and anyone running into this issue will be able to work thru their potential JNA issues. |
Thanks for digging in! |
Some notes from a discussion earlier today with @skhamis; please add your own notes here as appropriate.
On a checkout of
uniffi-rs
on an M1 Mac,cargo test
fails when running the Kotlin bindings tests. IIUC the issue we ran into was:arm64
by default.x86_64
binary, meaning that Java programs would run in virtualized mode.x64_64
dylibs, and is not able to loadarm64
dylibs. (ref Platform.RESOURCE_PREFIX on Darwin x64 and M1 java-native-access/jna#1313 for a bit of discussion about this in JNA).cargo build
the target crate for the native host, making anarm64
dylib.Two things we could try to solve this:
x86_64
binaries for use in these tests.┆Issue is synchronized with this Jira Task
┆Issue Number: UNIFFI-64
The text was updated successfully, but these errors were encountered: