-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add support for M1 Macbook desktop testing #4665
Comments
Thanks for the excellent write-up on issues onboarding onto application-services via M1. A couple of things initially:
Do those commands above show that they successfully installed? I think the warning can only be ignored if those actually get installed
|
|
Progress update from today: Turns out I should follow directions (who knew) and was missing the Xcode install. I can now successfully run
As a reminder, I've added
|
Glad you're able to move forward! I think you might want to remove the relevant switches as I think the current iterations build for M1s without that (but we can look into that to see if there is something we're missing). It looks like you need to run the steps to build NSS + other deps (I noticed our steps to make this clear).
Then try run the gradle command again and report back! |
Got a successful build! Needed to update this switch with the following case:
It looks like the Unfortunately, running tests fails with an unsatisfied linker error:
|
No my local.properties doesn't have any specific hack for this. Hmmmm I would be a little surprised that the above snippet allowed your build to run sucessfully as we already add arm64 to the rustTargets before any platform-specific switches: However I do see Glean (a project at mozilla we work with heavily) adds Regarding the linker error. Do you know if the megazord lib actually exists in Thanks for continuing to push through this! This has been really helpful to identify areas we need to improve on for onboarding. |
Switching the case to also set What is |
After chatting offline with Matt, turns out I can repro this. I had a x86_64 version of the JVM -- switching to an arm-based produces the same errors as above -- Will be investigating further! |
Looks like this issue is going to block me from a subset of A-C contributions as well. Trying to run these tests fails with the error at the bottom of this post. Looks like it's potentially the same runtime linking issue we ran into in this post above. For context, the test suite in that class is instantiating a PlacesApi from A-S.
|
@badboy have you run into this issue at all trying to build application-services? I didn't run into it because I had a x86_64 jdk but I think I recall you having an arm64 homebrew jdk |
@skhamis helped worked me through this issue offline. This can be circumvented by ensuring that Android Studio (or however you're running your gradle tasks) is using an x86_64 version of Java |
I've never built the android part of a-s on this machine. I do indeed have a x64 java around. @MatthewTighe That makes sense. How would one verify that? |
@badboy You can find and change the JDK version being used by Android Studio by searching "gradle" in the preferences menu, as seen here: The |
Just as a point of clarity: I hit this issue in Android Studio running |
I'll need to be switching gears for a little bit but wanted to do a bit of a brain dump: It seems the issue is relating to the wrong target_arch being computed during the application-services/publish.gradle Line 283 in c40fd3a
Which gets the application-services/build.gradle Line 232 in c40fd3a
This means that there will be a megazord generated for dawin under the task application-services/components/support/rc_crypto/nss/nss_build_common/src/lib.rs Lines 109 to 111 in c40fd3a
This means the rust line Removing those lines to try and get it to compile fails (expectantly) on the linker part with something like:
Which confirms that the bug is basically when rust is being compiled from gradle, there is not proper support for detecting M1 (Mac/Darwin arm). Haven't gone further than that for now but will investigate further when time permits. Things I've tried:
|
Update: It's most likely the rust gradle plugin (by Mozilla!) that might be causing the x86_64 to be built. I think we'll need some kind of patch on their end to support darwin arm64 specifically here: https://github.com/mozilla/rust-android-gradle/blob/master/plugin/src/main/kotlin/com/nishtahir/RustAndroidPlugin.kt#L28-L33 When I get time I'll try to locally test that plugin with some potential changes and see if I'm able to get it building nss correctly |
➤ Janet Dragojevic commented: This is ready for testing by people with macs (m1 or intel) and should check all the way through to Fenix. |
Building A-S for Android needs some updates to be out-of-the-box compatible with M1 Macbooks. I'm trying to work through the issues locally, but am new to the project so it's a bit slow going. I'll keep this issue updated with blockers and their solutions as I encounter them:
sdkmanager
command line tools required by build not compatible with M1. The error I saw wasCould not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
, but there may be others. See this SO post.Users/<user>/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager
../libs/verify-android-environment.sh
fails withCannot get property 'nativeRustTarget' on extra properties extension as it does not exist
../libs/verify-android-environment.sh
appears to have another error:Running
cargo test
causes the following error. This happens with different crates on subsequent runs:error: failed to run custom build command for
sql-support v0.1.0 (/Users/matthewtighe/dev/application-services/components/support/sql)
Caused by:
process didn't exit successfully:
/Users/matthewtighe/dev/application-services/target/debug/build/sql-support-22f2ec6dbcbc1fcd/build-script-build
(exit status: 101)--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=NSS_DIR
--- stderr
thread 'main' panicked at 'It looks like NSS is not built. Please run
libs/verify-[platform]-environment.sh
first!', components/support/rc_crypto/nss/nss_build_common/src/lib.rs:55:9note: run with
RUST_BACKTRACE=1
environment variable to display a backtracewarning: build failed, waiting for other jobs to finish...
error: build failedMy guess now is that
nss
is being compiled forx86_64
instead ofaarch64
, but I'm still trying to figure out how to check/change that.┆Issue is synchronized with this Jira Task
┆Epic: local development, ci and release (backlog)
┆Sprint End Date: 2022-02-03
The text was updated successfully, but these errors were encountered: