From 5a507fc18e1dc8a69083a2328d38f3657639aa15 Mon Sep 17 00:00:00 2001 From: Stanca Serban Date: Thu, 23 Mar 2023 14:13:08 +0200 Subject: [PATCH] Backed out changeset df6f338d6a26 (bug 1820876) for causing build bustages on Android Shippable. CLOSED TREE --- build/moz.configure/android-ndk.configure | 48 +++++++++++++-------- build/unix/build-binutils/build-binutils.sh | 2 +- media/libcubeb/src/moz.build | 1 - python/mozboot/mozboot/android.py | 11 +++-- taskcluster/ci/build/android.yml | 1 - taskcluster/ci/toolchain/rust.yml | 20 +++++++++ taskcluster/ci/webrender/kind.yml | 4 +- 7 files changed, 62 insertions(+), 25 deletions(-) diff --git a/build/moz.configure/android-ndk.configure b/build/moz.configure/android-ndk.configure index 333a5ea499c6..04a58944c39f 100644 --- a/build/moz.configure/android-ndk.configure +++ b/build/moz.configure/android-ndk.configure @@ -139,29 +139,18 @@ def host_dir(host, base_dir): return dir -@depends(host, ndk, "--with-android-toolchain") -@checking("for the Android toolchain directory", lambda x: x or "not found") -def android_toolchain(host, ndk, toolchain): - if not ndk: - return - if toolchain: - return toolchain[0] - - toolchain = host_dir(host, os.path.join(ndk, "toolchains", "llvm", "prebuilt")) - if toolchain: - return toolchain - die("You have to specify --with-android-toolchain=" "/path/to/ndk/toolchain.") - - -@depends(target, android_toolchain) +@depends(ndk, target, host) @checking("for android sysroot directory") @imports(_from="os.path", _import="isdir") -def android_sysroot(target, android_toolchain): +def android_sysroot(ndk, target, host): if target.os != "Android": return search_dirs = [ - os.path.join(android_toolchain, "sysroot"), + os.path.join( + host_dir(host, os.path.join(ndk, "toolchains", "llvm", "prebuilt")), + "sysroot", + ), ] for sysroot_dir in search_dirs: @@ -174,6 +163,31 @@ def android_sysroot(target, android_toolchain): ) +@depends(target, host, ndk, "--with-android-toolchain") +@checking("for the Android toolchain directory", lambda x: x or "not found") +def android_toolchain(target, host, ndk, toolchain): + if not ndk: + return + if toolchain: + return toolchain[0] + else: + if target.cpu == "arm" and target.endianness == "little": + target_base = "arm-linux-androideabi" + elif target.cpu == "x86": + target_base = "x86" + elif target.cpu == "x86_64": + target_base = "x86_64" + elif target.cpu == "aarch64" and target.endianness == "little": + target_base = "aarch64-linux-android" + else: + die("Target cpu is not supported.") + + toolchain = host_dir(host, "%s/toolchains/%s-4.9/prebuilt" % (ndk, target_base)) + if toolchain: + return toolchain + die("You have to specify --with-android-toolchain=" "/path/to/ndk/toolchain.") + + @depends(target, host, ndk, "--with-android-lldb-server") @checking("for the Android LLDB server", lambda x: x or "not found") @imports(_from="os", _import="listdir") diff --git a/build/unix/build-binutils/build-binutils.sh b/build/unix/build-binutils/build-binutils.sh index c1db61761ffd..e3934e9f8d0c 100755 --- a/build/unix/build-binutils/build-binutils.sh +++ b/build/unix/build-binutils/build-binutils.sh @@ -62,7 +62,7 @@ EOF cd .. -TARGETS="aarch64-linux-gnu arm-linux-gnueabi i686-w64-mingw32" +TARGETS="aarch64-linux-gnu i686-w64-mingw32" if [ -d $MOZ_FETCHES_DIR/sysroot ]; then # Don't silently use a non-existing directory for C++ headers. diff --git a/media/libcubeb/src/moz.build b/media/libcubeb/src/moz.build index 8dd28502bf1f..5a864c239f87 100644 --- a/media/libcubeb/src/moz.build +++ b/media/libcubeb/src/moz.build @@ -97,7 +97,6 @@ if CONFIG['MOZ_AAUDIO'] or CONFIG['MOZ_OPENSL']: if CONFIG['MOZ_AAUDIO']: SOURCES += ['cubeb_aaudio.cpp'] - SOURCES['cubeb_aaudio.cpp'].flags += ['-D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__'] DEFINES['USE_AAUDIO'] = True if CONFIG['MOZ_OPENSL']: diff --git a/python/mozboot/mozboot/android.py b/python/mozboot/mozboot/android.py index bb8170b0d3ef..9ccf6819f7fd 100644 --- a/python/mozboot/mozboot/android.py +++ b/python/mozboot/mozboot/android.py @@ -20,7 +20,7 @@ from tqdm import tqdm # variable. from mozboot.bootstrap import MOZCONFIG_SUGGESTION_TEMPLATE -NDK_VERSION = "r23c" +NDK_VERSION = "r21d" CMDLINE_TOOLS_VERSION_STRING = "9.0" CMDLINE_TOOLS_VERSION = "9477386" @@ -676,14 +676,19 @@ def generate_mozconfig(os_name, artifact_mode=False): def android_ndk_url(os_name, ver=NDK_VERSION): # Produce a URL like - # 'https://dl.google.com/android/repository/android-ndk-$VER-linux.zip + # 'https://dl.google.com/android/repository/android-ndk-$VER-linux-x86_64.zip base_url = "https://dl.google.com/android/repository/android-ndk" if os_name == "macosx": # |mach bootstrap| uses 'macosx', but Google uses 'darwin'. os_name = "darwin" - return "%s-%s-%s.zip" % (base_url, ver, os_name) + if sys.maxsize > 2 ** 32: + arch = "x86_64" + else: + arch = "x86" + + return "%s-%s-%s-%s.zip" % (base_url, ver, os_name, arch) def main(argv): diff --git a/taskcluster/ci/build/android.yml b/taskcluster/ci/build/android.yml index 74d2be208acb..d45d4532c610 100644 --- a/taskcluster/ci/build/android.yml +++ b/taskcluster/ci/build/android.yml @@ -46,7 +46,6 @@ job-defaults: toolchain: - android-ndk-linux - android-sdk-linux - - linux64-binutils - linux64-jdk - linux64-rust-android - linux64-rust-size diff --git a/taskcluster/ci/toolchain/rust.yml b/taskcluster/ci/toolchain/rust.yml index 35cead148171..19d7c942f435 100644 --- a/taskcluster/ci/toolchain/rust.yml +++ b/taskcluster/ci/toolchain/rust.yml @@ -176,6 +176,26 @@ linux64-rust-macos-1.68: ] toolchain-alias: linux64-rust-macos +linux64-rust-android-1.67: + description: "rust repack with android-cross support" + treeherder: + symbol: TL(rust-android-1.67) + run: + arguments: [ + '--channel', '1.67.0', + '--host', 'x86_64-unknown-linux-gnu', + '--target', 'x86_64-unknown-linux-gnu', + '--target', 'armv7-linux-androideabi', + '--target', 'thumbv7neon-linux-androideabi', + '--target', 'aarch64-linux-android', + '--target', 'i686-linux-android', + '--target', 'x86_64-linux-android', + '--compiler-builtins-hack', + ] + fetches: + toolchain: + - linux64-clang-toolchain + linux64-rust-android-1.68: description: "rust repack with android-cross support" treeherder: diff --git a/taskcluster/ci/webrender/kind.yml b/taskcluster/ci/webrender/kind.yml index 7396d6319bc4..7268224449a7 100644 --- a/taskcluster/ci/webrender/kind.yml +++ b/taskcluster/ci/webrender/kind.yml @@ -272,7 +272,7 @@ jobs: - android-system-image-x86_64-linux - android-avd-x86_64-linux - linux64-jdk - - linux64-rust-android + - linux64-rust-android-1.67 - wrench-deps treeherder: platform: android-em-7-0-x86/debug @@ -317,7 +317,7 @@ jobs: - android-system-image-x86_64-linux - android-avd-x86_64-linux - linux64-jdk - - linux64-rust-android + - linux64-rust-android-1.67 - wrench-deps treeherder: platform: android-em-7-0-x86/opt