WIP - Support cross-compile darwin builds to aarch64 [ci-full]#7137
Open
moztcampbell wants to merge 4 commits intomozilla:mainfrom
Open
WIP - Support cross-compile darwin builds to aarch64 [ci-full]#7137moztcampbell wants to merge 4 commits intomozilla:mainfrom
moztcampbell wants to merge 4 commits intomozilla:mainfrom
Conversation
moztcampbell
commented
Dec 22, 2025
Comment on lines
23
to
32
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_NSS_STATIC=1 | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_NSS_DIR=/builds/worker/checkouts/vcs/libs/desktop/darwin-${build_path}/nss | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_CC=/builds/worker/clang/bin/clang-20 | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_TOOLCHAIN_PREFIX=/builds/worker/cctools/bin | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_AR=/builds/worker/cctools/bin/${target}-ar | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_RANLIB=/builds/worker/cctools/bin/${target}-ranlib | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_LD_LIBRARY_PATH=/builds/worker/clang/lib | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_RUSTFLAGS="-C linker=/builds/worker/clang/bin/clang-20 -C link-arg=-fuse-ld=/builds/worker/cctools/bin/${target}-ld -C link-arg=-B -C link-arg=/builds/worker/cctools/bin -C link-arg=-target -C link-arg=${target} -C link-arg=-isysroot -C link-arg=/tmp/MacOSX11.0.sdk -C link-arg=-Wl,-syslibroot,/tmp/MacOSX11.0.sdk -C link-arg=-Wl,-dead_strip${extra_rustflags}" | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_CFLAGS_${target_lower}="-B /builds/worker/cctools/bin -target ${target} -isysroot /tmp/MacOSX11.0.sdk -Wl,-syslibroot,/tmp/MacOSX11.0.sdk -Wl,-dead_strip" | ||
| export ORG_GRADLE_PROJECT_RUST_ANDROID_GRADLE_TARGET_${target_upper}_BINDGEN_EXTRA_CLANG_ARGS="--sysroot /tmp/MacOSX11.0.sdk" |
Collaborator
Author
There was a problem hiding this comment.
The diff machinery failed me here, but the values for x86_64 should be unchanged. For aarch64, we add the no_encryption linker flag based on what Glean does. https://github.com/mozilla/glean/blob/8aff55c2b89b9592428034b00bdd2a13a2861c2b/taskcluster/scripts/cross-compile-setup.sh#L22
Collaborator
Author
|
Sigh.. now I see the NSS issue with CI missing nss aarch64 artifacts |
5d36ef8 to
150a3d9
Compare
ab95d00 to
bcc38cd
Compare
To support darwin-aarch64 in the future, avoid using the ambiguous 'darwin' target and also generalize the rust-android-gradle handling.
Build the android unit-test megazords with support for darwin-aarch64 to make it easier to run tests locally that use Nimbus, etc. Since our NSS CI doesn't have darwin-aarch64 artifacts, this patch builds NSPR/NSS directly similar to how libs/build-nss-ios.sh does.
90b3bbe to
8240905
Compare
8240905 to
e223b5f
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To support local android builds on Apple Silicon to use Nimbus in unit-tests, I'd like to extend our
megazord_full_libsForTestsartifacts to include darwin-aarch64. This extends the existing configuration to also target aarch64 following a similar consistent approach with Glean (such as the no_encryption flag).Pushing PR to poke some CI and see what happens...