mozilla / rust-android-gradle

Apache License 2.0
1.08k stars 70 forks source link

Support for Apple M1 aarch64 #77

Closed skhamis closed 2 years ago

skhamis commented 2 years ago

Application-services is currently running into an issue with compiling NSS via rust-android-gradle https://github.com/mozilla/application-services/issues/4665.

I believe it's potentially something to do with rust-android-gradle associating Darwin = x86_64 https://github.com/mozilla/application-services/issues/4665#issuecomment-984161587 which works if the Mac is using a JDK = x86_64 but M1's are now defaulting to downloading arm64 (homebrew) JDKs which causes the builds to break.

We probably need to allow the ability for Darwin to = arm64

ncalexan commented 2 years ago

@skhamis thanks for the report. As we discussed on Slack, I'm not aware of any fundamental blocker to making this work. My expectation is that we need to split darwin into darwin-{x86-64,aarch64}. We do run some tests in CI these days, but I'm not sure that we can target macOS aarch64 machines in Github Actions, nor am I sure that we're running any Robolectric style tests.

Let me know how you get on with a patch. Thanks!

skhamis commented 2 years ago

@ncalexan I think it the PR ended up being pretty straightforward! To keep things straightforward and prevent anyone from breaking too bad. I decided to go with keeping darwin and simply adding darwin-x86-64 and aarch64 as new targets to keep things moving. At some point I can make a PR to remove the darwin target once the dust has settled a bit and seems to be stable.

ncalexan commented 2 years ago

This landed and is, I believe, working well for application-services.