зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 10 changesets (bug 1718341
) for causing wrench bustages. CLOSED TREE
Backed out changeset e5bd150a58b2 (bug1718341
) Backed out changeset e82e752b8f44 (bug1718341
) Backed out changeset d9462c727c8f (bug1718341
) Backed out changeset 2bd647754780 (bug1718341
) Backed out changeset 31dfce45985f (bug1718341
) Backed out changeset 03266cea345d (bug1718341
) Backed out changeset 3920b27acecb (bug1718341
) Backed out changeset 2b17603c5e65 (bug1718341
) Backed out changeset ebc0d5d4f537 (bug1718341
) Backed out changeset 1c8844157b8d (bug1718341
)
This commit is contained in:
Родитель
069663f683
Коммит
c40ce62c3c
|
@ -220,7 +220,7 @@ modify are listed below:
|
|||
- Linux: `unittests/linux_unittest.py`
|
||||
- Mac: `unittests/mac_unittest.py`
|
||||
- Windows: `unittests/win_unittest.py`
|
||||
- Android: `android/androidarm.py`
|
||||
- Android: `android/androidarm_4_3.py`
|
||||
|
||||
## How to instrument your objects for BloatView
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ support-files =
|
|||
file_font_loading_api_vframe.html
|
||||
# This test checks font loading state. When loaded second time, fonts may be
|
||||
# loaded synchronously, causing this test to fail in test-verify task.
|
||||
skip-if = verify || toolkit == 'android' # Bug 1455824
|
||||
skip-if = verify
|
||||
[test_garbage_at_end_of_declarations.html]
|
||||
[test_grid_container_shorthands.html]
|
||||
[test_grid_item_shorthands.html]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
. "$topsrcdir/mobile/android/config/mozconfigs/android-x86/nightly"
|
||||
. "$topsrcdir/mobile/android/config/mozconfigs/android-arm/nightly"
|
||||
|
||||
mk_add_options "export MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES=0"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
. "$topsrcdir/mobile/android/config/mozconfigs/android-x86_64/nightly"
|
||||
|
||||
mk_add_options "export MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES=0"
|
||||
|
||||
ac_add_options --enable-profile-generate=cross
|
||||
ac_add_options --disable-tests
|
|
@ -479,17 +479,22 @@ class AndroidEmulatorCommands(MachCommandBase):
|
|||
@CommandArgument(
|
||||
"--version",
|
||||
metavar="VERSION",
|
||||
choices=["arm", "x86_64"],
|
||||
choices=["arm-4.3", "x86-7.0"],
|
||||
help="Specify which AVD to run in emulator. "
|
||||
'One of "arm" (Android supporting armv7 binaries), or '
|
||||
'"x86_64" (Android supporting x86 or x86_64 binaries, '
|
||||
'One of "arm-4.3" (Android 4.3 supporting armv7 binaries), or '
|
||||
'"x86-7.0" (Android 7.0 supporting x86 or x86_64 binaries, '
|
||||
"recommended for most applications). "
|
||||
'By default, "arm" will be used if the current build environment '
|
||||
'architecture is arm; otherwise "x86_64".',
|
||||
'By default, "arm-4.3" will be used if the current build environment '
|
||||
'architecture is arm; otherwise "x86-7.0".',
|
||||
)
|
||||
@CommandArgument(
|
||||
"--wait", action="store_true", help="Wait for emulator to be closed."
|
||||
)
|
||||
@CommandArgument(
|
||||
"--force-update",
|
||||
action="store_true",
|
||||
help="Update AVD definition even when AVD is already installed.",
|
||||
)
|
||||
@CommandArgument("--gpu", help="Over-ride the emulator -gpu argument.")
|
||||
@CommandArgument(
|
||||
"--verbose", action="store_true", help="Log informative status messages."
|
||||
|
@ -499,6 +504,7 @@ class AndroidEmulatorCommands(MachCommandBase):
|
|||
command_context,
|
||||
version,
|
||||
wait=False,
|
||||
force_update=False,
|
||||
gpu=None,
|
||||
verbose=False,
|
||||
):
|
||||
|
@ -533,6 +539,15 @@ class AndroidEmulatorCommands(MachCommandBase):
|
|||
)
|
||||
return 2
|
||||
|
||||
if not emulator.check_avd(force_update):
|
||||
self.log(
|
||||
logging.INFO,
|
||||
"emulator",
|
||||
{},
|
||||
"Fetching and installing AVD. This may take a few minutes...",
|
||||
)
|
||||
emulator.update_avd(force_update)
|
||||
|
||||
self.log(
|
||||
logging.INFO,
|
||||
"emulator",
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"emulator_package": "system-images;android-24;default;armeabi-v7a",
|
||||
"emulator_avd_name": "mozemulator-armeabi-v7a",
|
||||
"emulator_extra_args": [
|
||||
"-skip-adb-auth",
|
||||
"-verbose",
|
||||
"-show-kernel",
|
||||
"-ranchu",
|
||||
"-selinux", "permissive",
|
||||
"-memory", "3072",
|
||||
"-cores", "4",
|
||||
"-skin", "800x1280",
|
||||
"-gpu", "on",
|
||||
"-no-snapstorage",
|
||||
"-no-snapshot",
|
||||
"-no-window",
|
||||
"-no-accel",
|
||||
"-prop", "ro.test_harness=true"
|
||||
],
|
||||
"emulator_extra_config": {
|
||||
"hw.lcd.density": "320",
|
||||
"disk.dataPartition.size": "4000MB",
|
||||
"sdcard.size": "600M"
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"emulator_package": "system-images;android-24;default;x86_64",
|
||||
"emulator_avd_name": "mozemulator-x86_64",
|
||||
"emulator_extra_args": [
|
||||
"-skip-adb-auth",
|
||||
"-verbose",
|
||||
"-show-kernel",
|
||||
"-ranchu",
|
||||
"-selinux", "permissive",
|
||||
"-memory", "3072",
|
||||
"-cores", "4",
|
||||
"-skin", "800x1280",
|
||||
"-gpu", "on",
|
||||
"-no-snapstorage",
|
||||
"-no-snapshot",
|
||||
"-no-window",
|
||||
"-no-accel",
|
||||
"-prop", "ro.test_harness=true"
|
||||
],
|
||||
"emulator_extra_config": {
|
||||
"hw.lcd.density": "320",
|
||||
"disk.dataPartition.size": "4000MB",
|
||||
"sdcard.size": "600M"
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
platform-tools
|
||||
build-tools;30.0.2
|
||||
platforms;android-30
|
||||
emulator
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
emulator
|
|
@ -5,12 +5,10 @@
|
|||
from __future__ import absolute_import, print_function, unicode_literals
|
||||
|
||||
import errno
|
||||
import json
|
||||
import os
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
|
||||
# We need the NDK version in multiple different places, and it's inconvenient
|
||||
# to pass down the NDK version to all relevant places, so we have this global
|
||||
|
@ -18,26 +16,6 @@ import time
|
|||
from mozboot.bootstrap import MOZCONFIG_SUGGESTION_TEMPLATE
|
||||
|
||||
NDK_VERSION = "r21d"
|
||||
CMDLINE_TOOLS_VERSION_STRING = "4.0"
|
||||
CMDLINE_TOOLS_VERSION = "7302050"
|
||||
|
||||
# We expect the emulator AVD definitions to be platform agnostic
|
||||
LINUX_X86_64_ANDROID_AVD = "linux64-android-avd-x86_64-repack"
|
||||
LINUX_ARM_ANDROID_AVD = "linux64-android-avd-arm-repack"
|
||||
|
||||
MACOS_X86_64_ANDROID_AVD = "linux64-android-avd-x86_64-repack"
|
||||
MACOS_ARM_ANDROID_AVD = "linux64-android-avd-arm-repack"
|
||||
|
||||
# We don't currently support bootstrapping on Windows yet.
|
||||
# WINDOWS_X86_64_ANDROID_AVD = "linux64-android-avd-x86_64-repack"
|
||||
# WINDOWS_ARM_ANDROID_AVD = "linux64-android-avd-arm-repack"
|
||||
|
||||
AVD_MANIFEST_X86_64 = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "android-avds/x86_64.json")
|
||||
)
|
||||
AVD_MANIFEST_ARM = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "android-avds/arm.json")
|
||||
)
|
||||
|
||||
ANDROID_NDK_EXISTS = """
|
||||
Looks like you have the correct version of the Android NDK installed at:
|
||||
|
@ -206,39 +184,13 @@ def get_paths(os_name):
|
|||
"ANDROID_NDK_HOME",
|
||||
os.path.join(mozbuild_path, "android-ndk-{0}".format(NDK_VERSION)),
|
||||
)
|
||||
avd_path = os.environ.get(
|
||||
"ANDROID_AVD_HOME", os.path.join(mozbuild_path, "android-device", "avd")
|
||||
)
|
||||
emulator_path = os.environ.get(
|
||||
"ANDROID_EMULATOR_HOME", os.path.join(mozbuild_path, "android-device")
|
||||
)
|
||||
return (mozbuild_path, sdk_path, ndk_path, avd_path, emulator_path)
|
||||
return (mozbuild_path, sdk_path, ndk_path)
|
||||
|
||||
|
||||
def sdkmanager_tool(sdk_path):
|
||||
# sys.platform is win32 even if Python/Win64.
|
||||
sdkmanager = "sdkmanager.bat" if sys.platform.startswith("win") else "sdkmanager"
|
||||
return os.path.join(
|
||||
sdk_path, "cmdline-tools", CMDLINE_TOOLS_VERSION_STRING, "bin", sdkmanager
|
||||
)
|
||||
|
||||
|
||||
def avdmanager_tool(sdk_path):
|
||||
# sys.platform is win32 even if Python/Win64.
|
||||
sdkmanager = "avdmanager.bat" if sys.platform.startswith("win") else "avdmanager"
|
||||
return os.path.join(
|
||||
sdk_path, "cmdline-tools", CMDLINE_TOOLS_VERSION_STRING, "bin", sdkmanager
|
||||
)
|
||||
|
||||
|
||||
def adb_tool(sdk_path):
|
||||
adb = "adb.bat" if sys.platform.startswith("win") else "adb"
|
||||
return os.path.join(sdk_path, "platform-tools", adb)
|
||||
|
||||
|
||||
def emulator_tool(sdk_path):
|
||||
emulator = "emulator.bat" if sys.platform.startswith("win") else "emulator"
|
||||
return os.path.join(sdk_path, "emulator", emulator)
|
||||
return os.path.join(sdk_path, "tools", "bin", sdkmanager)
|
||||
|
||||
|
||||
def ensure_dir(dir):
|
||||
|
@ -255,12 +207,8 @@ def ensure_android(
|
|||
os_name,
|
||||
artifact_mode=False,
|
||||
ndk_only=False,
|
||||
system_images_only=False,
|
||||
emulator_only=False,
|
||||
avd_manifest_path=None,
|
||||
prewarm_avd=False,
|
||||
no_interactive=False,
|
||||
list_packages=False,
|
||||
):
|
||||
"""
|
||||
Ensure the Android SDK (and NDK, if `artifact_mode` is falsy) are
|
||||
|
@ -268,23 +216,18 @@ def ensure_android(
|
|||
given URLs. Ensure the required Android SDK packages are
|
||||
installed.
|
||||
|
||||
`os_name` can be 'linux', 'macosx' or 'windows'.
|
||||
`os_name` can be 'linux' or 'macosx'.
|
||||
"""
|
||||
# The user may have an external Android SDK (in which case we
|
||||
# save them a lengthy download), or they may have already
|
||||
# completed the download. We unpack to
|
||||
# ~/.mozbuild/{android-sdk-$OS_NAME, android-ndk-$VER}.
|
||||
mozbuild_path, sdk_path, ndk_path, avd_path, emulator_path = get_paths(os_name)
|
||||
|
||||
if os_name == "macosx":
|
||||
os_tag = "mac"
|
||||
elif os_name == "windows":
|
||||
os_tag = "win"
|
||||
else:
|
||||
os_tag = os_name
|
||||
|
||||
sdk_url = "https://dl.google.com/android/repository/commandlinetools-{0}-{1}_latest.zip".format( # NOQA: E501
|
||||
os_tag, CMDLINE_TOOLS_VERSION
|
||||
mozbuild_path, sdk_path, ndk_path = get_paths(os_name)
|
||||
os_tag = "darwin" if os_name == "macosx" else os_name
|
||||
sdk_url = (
|
||||
"https://dl.google.com/android/repository/sdk-tools-{0}-4333796.zip".format(
|
||||
os_tag
|
||||
)
|
||||
)
|
||||
ndk_url = android_ndk_url(os_name)
|
||||
|
||||
|
@ -303,35 +246,12 @@ def ensure_android(
|
|||
if ndk_only:
|
||||
return
|
||||
|
||||
avd_manifest = None
|
||||
if avd_manifest_path is not None:
|
||||
with open(avd_manifest_path) as f:
|
||||
avd_manifest = json.load(f)
|
||||
|
||||
# We expect the |sdkmanager| tool to be at
|
||||
# ~/.mozbuild/android-sdk-$OS_NAME/tools/cmdline-tools/$CMDLINE_TOOLS_VERSION_STRING/bin/sdkmanager. # NOQA: E501
|
||||
# ~/.mozbuild/android-sdk-$OS_NAME/tools/bin/sdkmanager.
|
||||
ensure_android_packages(
|
||||
sdkmanager_tool=sdkmanager_tool(sdk_path),
|
||||
emulator_only=emulator_only,
|
||||
system_images_only=system_images_only,
|
||||
avd_manifest=avd_manifest,
|
||||
no_interactive=no_interactive,
|
||||
list_packages=list_packages,
|
||||
)
|
||||
|
||||
if emulator_only or system_images_only:
|
||||
return
|
||||
|
||||
ensure_android_avd(
|
||||
avdmanager_tool=avdmanager_tool(sdk_path),
|
||||
adb_tool=adb_tool(sdk_path),
|
||||
emulator_tool=emulator_tool(sdk_path),
|
||||
avd_path=avd_path,
|
||||
sdk_path=sdk_path,
|
||||
emulator_path=emulator_path,
|
||||
no_interactive=no_interactive,
|
||||
avd_manifest=avd_manifest,
|
||||
prewarm_avd=prewarm_avd,
|
||||
)
|
||||
|
||||
|
||||
|
@ -386,141 +306,32 @@ def ensure_android_sdk_and_ndk(
|
|||
# android-sdk-$OS_NAME directory; it no longer does so. We
|
||||
# preserve the old convention to smooth detecting existing SDK
|
||||
# installations.
|
||||
cmdline_tools_path = os.path.join(
|
||||
mozbuild_path, "android-sdk-{0}".format(os_name), "cmdline-tools"
|
||||
)
|
||||
install_mobile_android_sdk_or_ndk(sdk_url, cmdline_tools_path)
|
||||
# The tools package *really* wants to be in
|
||||
# <sdk>/cmdline-tools/$CMDLINE_TOOLS_VERSION_STRING
|
||||
os.rename(
|
||||
os.path.join(cmdline_tools_path, "cmdline-tools"),
|
||||
os.path.join(cmdline_tools_path, CMDLINE_TOOLS_VERSION_STRING),
|
||||
install_mobile_android_sdk_or_ndk(
|
||||
sdk_url, os.path.join(mozbuild_path, "android-sdk-{0}".format(os_name))
|
||||
)
|
||||
|
||||
|
||||
def get_packages_to_install(packages_file_content, avd_manifest):
|
||||
packages = []
|
||||
packages += map(lambda package: package.strip(), packages_file_content)
|
||||
if avd_manifest is not None:
|
||||
packages += [avd_manifest["emulator_package"]]
|
||||
return packages
|
||||
|
||||
|
||||
def ensure_android_avd(
|
||||
avdmanager_tool,
|
||||
adb_tool,
|
||||
emulator_tool,
|
||||
avd_path,
|
||||
sdk_path,
|
||||
emulator_path,
|
||||
no_interactive=False,
|
||||
avd_manifest=None,
|
||||
prewarm_avd=False,
|
||||
):
|
||||
def get_packages_to_install(packages_file_name):
|
||||
"""
|
||||
Use the given sdkmanager tool (like 'sdkmanager') to install required
|
||||
Android packages.
|
||||
"""
|
||||
if avd_manifest is None:
|
||||
return
|
||||
|
||||
ensure_dir(avd_path)
|
||||
# The AVD needs this folder to boot, so make sure it exists here.
|
||||
ensure_dir(os.path.join(sdk_path, "platforms"))
|
||||
|
||||
avd_name = avd_manifest["emulator_avd_name"]
|
||||
args = [
|
||||
avdmanager_tool,
|
||||
"--verbose",
|
||||
"create",
|
||||
"avd",
|
||||
"--force",
|
||||
"--name",
|
||||
avd_name,
|
||||
"--package",
|
||||
avd_manifest["emulator_package"],
|
||||
]
|
||||
|
||||
if not no_interactive:
|
||||
sdkmanager version 26.1.1 (current) and some versions below have a bug that makes
|
||||
the following command fail:
|
||||
args = [sdkmanager_tool, '--package_file={0}'.format(package_file_name)]
|
||||
subprocess.check_call(args)
|
||||
return
|
||||
|
||||
# Flush outputs before running sdkmanager.
|
||||
sys.stdout.flush()
|
||||
env = os.environ.copy()
|
||||
env["ANDROID_AVD_HOME"] = avd_path
|
||||
proc = subprocess.Popen(args, stdin=subprocess.PIPE, env=env)
|
||||
proc.communicate("no\n".encode("UTF-8"))
|
||||
|
||||
retcode = proc.poll()
|
||||
if retcode:
|
||||
cmd = args[0]
|
||||
e = subprocess.CalledProcessError(retcode, cmd)
|
||||
raise e
|
||||
|
||||
config_file_name = os.path.join(avd_path, avd_name + ".avd", "config.ini")
|
||||
|
||||
print("Writing config at %s" % config_file_name)
|
||||
|
||||
if os.path.isfile(config_file_name):
|
||||
with open(config_file_name, "a") as config:
|
||||
for key, value in avd_manifest["emulator_extra_config"].items():
|
||||
config.write("%s=%s\n" % (key, value))
|
||||
else:
|
||||
raise NotImplementedError(
|
||||
"Could not find config file at %s, something went wrong" % config_file_name
|
||||
)
|
||||
if prewarm_avd:
|
||||
run_prewarm_avd(
|
||||
adb_tool, emulator_tool, env, avd_name, avd_manifest, no_interactive
|
||||
)
|
||||
|
||||
|
||||
def run_prewarm_avd(
|
||||
adb_tool, emulator_tool, env, avd_name, avd_manifest, no_interactive=False
|
||||
):
|
||||
The error is in the sdkmanager, where the --package_file param isn't recognized.
|
||||
The error is being tracked here https://issuetracker.google.com/issues/66465833
|
||||
Meanwhile, this workaround achives installing all required Android packages by reading
|
||||
them out of the same file that --package_file would have used, and passing them as strings.
|
||||
So from here: https://developer.android.com/studio/command-line/sdkmanager
|
||||
Instead of:
|
||||
sdkmanager --package_file=package_file [options]
|
||||
We're doing:
|
||||
sdkmanager "platform-tools" "platforms;android-26"
|
||||
"""
|
||||
Ensures the emulator is fully booted to save time on future iterations.
|
||||
"""
|
||||
args = [emulator_tool, "-avd", avd_name] + avd_manifest["emulator_extra_args"]
|
||||
|
||||
# Flush outputs before running emulator.
|
||||
sys.stdout.flush()
|
||||
proc = subprocess.Popen(args, env=env)
|
||||
|
||||
booted = False
|
||||
for i in range(100):
|
||||
boot_completed_cmd = [adb_tool, "shell", "getprop", "sys.boot_completed"]
|
||||
completed_proc = subprocess.Popen(
|
||||
boot_completed_cmd, env=env, stdout=subprocess.PIPE
|
||||
)
|
||||
try:
|
||||
out, err = completed_proc.communicate(timeout=30)
|
||||
boot_completed = out.decode("UTF-8").strip()
|
||||
print("sys.boot_completed = %s" % boot_completed)
|
||||
time.sleep(30)
|
||||
if boot_completed == "1":
|
||||
booted = True
|
||||
break
|
||||
except subprocess.TimeoutExpired:
|
||||
# Sometimes the adb command hangs, that's ok
|
||||
print("sys.boot_completed = Timeout")
|
||||
|
||||
if not booted:
|
||||
raise NotImplementedError("Could not prewarm emulator")
|
||||
|
||||
# We can kill the emulator now
|
||||
proc.terminate()
|
||||
with open(packages_file_name) as package_file:
|
||||
return map(lambda package: package.strip(), package_file.readlines())
|
||||
|
||||
|
||||
def ensure_android_packages(
|
||||
sdkmanager_tool,
|
||||
emulator_only=False,
|
||||
system_images_only=False,
|
||||
avd_manifest=None,
|
||||
no_interactive=False,
|
||||
list_packages=False,
|
||||
):
|
||||
def ensure_android_packages(sdkmanager_tool, emulator_only=False, no_interactive=False):
|
||||
"""
|
||||
Use the given sdkmanager tool (like 'sdkmanager') to install required
|
||||
Android packages.
|
||||
|
@ -528,24 +339,18 @@ def ensure_android_packages(
|
|||
|
||||
# This tries to install all the required Android packages. The user
|
||||
# may be prompted to agree to the Android license.
|
||||
if system_images_only:
|
||||
packages_file_name = "android-system-images-packages.txt"
|
||||
elif emulator_only:
|
||||
packages_file_name = "android-emulator-packages.txt"
|
||||
if emulator_only:
|
||||
package_file_name = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "android-emulator-packages.txt")
|
||||
)
|
||||
else:
|
||||
packages_file_name = "android-packages.txt"
|
||||
|
||||
packages_file_path = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), packages_file_name)
|
||||
)
|
||||
with open(packages_file_path) as packages_file:
|
||||
packages_file_content = packages_file.readlines()
|
||||
|
||||
packages = get_packages_to_install(packages_file_content, avd_manifest)
|
||||
print(INSTALLING_ANDROID_PACKAGES % "\n".join(packages))
|
||||
package_file_name = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), "android-packages.txt")
|
||||
)
|
||||
print(INSTALLING_ANDROID_PACKAGES % open(package_file_name, "rt").read())
|
||||
|
||||
args = [sdkmanager_tool]
|
||||
args.extend(packages)
|
||||
args.extend(get_packages_to_install(package_file_name))
|
||||
|
||||
if not no_interactive:
|
||||
subprocess.check_call(args)
|
||||
|
@ -565,12 +370,10 @@ def ensure_android_packages(
|
|||
cmd = args[0]
|
||||
e = subprocess.CalledProcessError(retcode, cmd)
|
||||
raise e
|
||||
if list_packages:
|
||||
subprocess.check_call([sdkmanager_tool, "--list"])
|
||||
|
||||
|
||||
def generate_mozconfig(os_name, artifact_mode=False):
|
||||
moz_state_dir, sdk_path, ndk_path, avd_path, emulator_path = get_paths(os_name)
|
||||
moz_state_dir, sdk_path, ndk_path = get_paths(os_name)
|
||||
|
||||
extra_lines = []
|
||||
if extra_lines:
|
||||
|
@ -584,7 +387,6 @@ def generate_mozconfig(os_name, artifact_mode=False):
|
|||
kwargs = dict(
|
||||
sdk_path=sdk_path,
|
||||
ndk_path=ndk_path,
|
||||
avd_path=avd_path,
|
||||
moz_state_dir=moz_state_dir,
|
||||
extra_lines="\n".join(extra_lines),
|
||||
)
|
||||
|
@ -626,12 +428,6 @@ def main(argv):
|
|||
action="store_true",
|
||||
help="If true, install only the Android NDK (and not the Android SDK).",
|
||||
)
|
||||
parser.add_option(
|
||||
"--system-images-only",
|
||||
dest="system_images_only",
|
||||
action="store_true",
|
||||
help="If true, install only the system images for the AVDs.",
|
||||
)
|
||||
parser.add_option(
|
||||
"--no-interactive",
|
||||
dest="no_interactive",
|
||||
|
@ -644,23 +440,6 @@ def main(argv):
|
|||
action="store_true",
|
||||
help="If true, install only the Android emulator (and not the SDK or NDK).",
|
||||
)
|
||||
parser.add_option(
|
||||
"--avd-manifest",
|
||||
dest="avd_manifest_path",
|
||||
help="If present, generate AVD from the manifest pointed by this argument.",
|
||||
)
|
||||
parser.add_option(
|
||||
"--prewarm-avd",
|
||||
dest="prewarm_avd",
|
||||
action="store_true",
|
||||
help="If true, boot the AVD and wait until completed to speed up subsequent boots.",
|
||||
)
|
||||
parser.add_option(
|
||||
"--list-packages",
|
||||
dest="list_packages",
|
||||
action="store_true",
|
||||
help="If true, list installed packages.",
|
||||
)
|
||||
|
||||
options, _ = parser.parse_args(argv)
|
||||
|
||||
|
@ -687,12 +466,8 @@ def main(argv):
|
|||
os_name,
|
||||
artifact_mode=options.artifact_mode,
|
||||
ndk_only=options.ndk_only,
|
||||
system_images_only=options.system_images_only,
|
||||
emulator_only=options.emulator_only,
|
||||
avd_manifest_path=options.avd_manifest_path,
|
||||
prewarm_avd=options.prewarm_avd,
|
||||
no_interactive=options.no_interactive,
|
||||
list_packages=options.list_packages,
|
||||
)
|
||||
mozconfig = generate_mozconfig(os_name, options.artifact_mode)
|
||||
|
||||
|
|
|
@ -23,7 +23,12 @@ if sys.version_info < (3,):
|
|||
class ArchlinuxBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
||||
"""Archlinux experimental bootstrapper."""
|
||||
|
||||
SYSTEM_PACKAGES = ["base-devel", "nodejs", "unzip", "zip"]
|
||||
SYSTEM_PACKAGES = [
|
||||
"base-devel",
|
||||
"nodejs",
|
||||
"unzip",
|
||||
"zip",
|
||||
]
|
||||
|
||||
BROWSER_PACKAGES = [
|
||||
"alsa-lib",
|
||||
|
@ -43,7 +48,7 @@ class ArchlinuxBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
]
|
||||
|
||||
BROWSER_AUR_PACKAGES = [
|
||||
"https://aur.archlinux.org/cgit/aur.git/snapshot/uuid.tar.gz"
|
||||
"https://aur.archlinux.org/cgit/aur.git/snapshot/uuid.tar.gz",
|
||||
]
|
||||
|
||||
MOBILE_ANDROID_COMMON_PACKAGES = [
|
||||
|
@ -71,6 +76,12 @@ class ArchlinuxBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_browser_packages(artifact_mode=True)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=True)
|
||||
|
||||
def ensure_browser_packages(self, artifact_mode=False):
|
||||
# TODO: Figure out what not to install for artifact mode
|
||||
self.aur_install(*self.BROWSER_AUR_PACKAGES)
|
||||
|
@ -80,7 +91,7 @@ class ArchlinuxBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
# installed via ensure_browser_packages
|
||||
pass
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
# Multi-part process:
|
||||
# 1. System packages.
|
||||
# 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages.
|
||||
|
@ -103,7 +114,7 @@ class ArchlinuxBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
|
||||
# 2. Android pieces.
|
||||
self.ensure_java(mozconfig_builder)
|
||||
super().install_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
|
||||
def _update_package_manager(self):
|
||||
self.pacman_update()
|
||||
|
|
|
@ -210,14 +210,6 @@ class BaseBootstrapper(object):
|
|||
"%s does not yet implement install_browser_packages()" % __name__
|
||||
)
|
||||
|
||||
def ensure_browser_packages(self, state_dir, checkout_root):
|
||||
"""
|
||||
Install pre-built packages needed to build Firefox for Desktop (application 'browser')
|
||||
|
||||
Currently this is not needed and kept for compatibility with Firefox for Android.
|
||||
"""
|
||||
pass
|
||||
|
||||
def generate_browser_mozconfig(self):
|
||||
"""
|
||||
Print a message to the console detailing what the user's mozconfig
|
||||
|
@ -264,23 +256,14 @@ class BaseBootstrapper(object):
|
|||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
"""
|
||||
Install packages required to build GeckoView (application
|
||||
'mobile/android').
|
||||
Install packages required to build Firefox for Android (application
|
||||
'mobile/android', also known as Fennec).
|
||||
"""
|
||||
raise NotImplementedError(
|
||||
"Cannot bootstrap GeckoView/Firefox for Android: "
|
||||
"%s does not yet implement install_mobile_android_packages()" % __name__
|
||||
)
|
||||
|
||||
def ensure_mobile_android_packages(self, state_dir, checkout_root):
|
||||
"""
|
||||
Install pre-built packages required to run GeckoView (application 'mobile/android')
|
||||
"""
|
||||
raise NotImplementedError(
|
||||
"Cannot bootstrap GeckoView/Firefox for Android: "
|
||||
"%s does not yet implement ensure_mobile_android_packages()" % __name__
|
||||
)
|
||||
|
||||
def generate_mobile_android_mozconfig(self):
|
||||
"""
|
||||
Print a message to the console detailing what the user's mozconfig
|
||||
|
|
|
@ -249,9 +249,7 @@ class Bootstrapper(object):
|
|||
|
||||
return state_dir
|
||||
|
||||
def maybe_install_private_packages_or_exit(
|
||||
self, state_dir, checkout_root, application
|
||||
):
|
||||
def maybe_install_private_packages_or_exit(self, state_dir, checkout_root):
|
||||
# Install the clang packages needed for building the style system, as
|
||||
# well as the version of NodeJS that we currently support.
|
||||
# Also install the clang static-analysis package by default
|
||||
|
@ -267,10 +265,6 @@ class Bootstrapper(object):
|
|||
self.instance.ensure_sccache_packages(state_dir, checkout_root)
|
||||
self.instance.ensure_lucetc_packages(state_dir, checkout_root)
|
||||
self.instance.ensure_wasi_sysroot_packages(state_dir, checkout_root)
|
||||
# Like 'ensure_browser_packages' or 'ensure_mobile_android_packages'
|
||||
getattr(self.instance, "ensure_%s_packages" % application)(
|
||||
state_dir, checkout_root
|
||||
)
|
||||
|
||||
def check_code_submission(self, checkout_root):
|
||||
if self.instance.no_interactive or which("moz-phab"):
|
||||
|
@ -391,9 +385,7 @@ class Bootstrapper(object):
|
|||
which("git"), which("git-cinnabar"), state_dir, checkout_root
|
||||
)
|
||||
|
||||
self.maybe_install_private_packages_or_exit(
|
||||
state_dir, checkout_root, application
|
||||
)
|
||||
self.maybe_install_private_packages_or_exit(state_dir, checkout_root)
|
||||
self.check_code_submission(checkout_root)
|
||||
# Wait until after moz-phab setup to check telemetry so that employees
|
||||
# will be automatically opted-in.
|
||||
|
|
|
@ -84,17 +84,23 @@ class CentOSFedoraBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_browser_packages(artifact_mode=True)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=False)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=True)
|
||||
|
||||
def ensure_browser_packages(self, artifact_mode=False):
|
||||
# TODO: Figure out what not to install for artifact mode
|
||||
self.dnf_groupinstall(*self.browser_group_packages)
|
||||
self.dnf_install(*self.browser_packages)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
# Install Android specific packages.
|
||||
self.dnf_install(*self.mobile_android_packages)
|
||||
|
||||
self.ensure_java(mozconfig_builder)
|
||||
super().install_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
|
||||
def upgrade_mercurial(self, current):
|
||||
if current is None:
|
||||
|
|
|
@ -102,6 +102,12 @@ class DebianBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_browser_packages(artifact_mode=True)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=True)
|
||||
|
||||
def ensure_browser_packages(self, artifact_mode=False):
|
||||
# TODO: Figure out what not to install for artifact mode
|
||||
self.apt_install(*self.BROWSER_COMMON_PACKAGES)
|
||||
|
@ -109,7 +115,7 @@ class DebianBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
if not modern:
|
||||
self.apt_install("nasm")
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
# Multi-part process:
|
||||
# 1. System packages.
|
||||
# 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages.
|
||||
|
@ -117,7 +123,7 @@ class DebianBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
|
||||
# 2. Android pieces.
|
||||
self.ensure_java(mozconfig_builder)
|
||||
super().install_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
|
||||
def _update_package_manager(self):
|
||||
self.apt_update()
|
||||
|
|
|
@ -24,8 +24,21 @@ class GentooBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_browser_packages(artifact_mode=True)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=False)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=True)
|
||||
|
||||
def ensure_system_packages(self):
|
||||
self.run_as_root(["emerge", "--noreplace", "--quiet", "app-arch/zip"])
|
||||
self.run_as_root(
|
||||
[
|
||||
"emerge",
|
||||
"--noreplace",
|
||||
"--quiet",
|
||||
"app-arch/zip",
|
||||
]
|
||||
)
|
||||
|
||||
def ensure_browser_packages(self, artifact_mode=False):
|
||||
# TODO: Figure out what not to install for artifact mode
|
||||
|
@ -43,11 +56,11 @@ class GentooBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
]
|
||||
)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
self.run_as_root(["emerge", "--noreplace", "--quiet", "dev-java/openjdk-bin"])
|
||||
|
||||
self.ensure_java(mozconfig_builder)
|
||||
super().install_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
|
||||
def _update_package_manager(self):
|
||||
self.run_as_root(["emerge", "--sync"])
|
||||
|
|
|
@ -146,39 +146,12 @@ class MobileAndroidBootstrapper(object):
|
|||
def __init__(self, **kwargs):
|
||||
pass
|
||||
|
||||
def install_mobile_android_packages(self, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, artifact_mode=False):
|
||||
from mozboot import android
|
||||
|
||||
android.ensure_android(
|
||||
"linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive
|
||||
)
|
||||
android.ensure_android(
|
||||
"linux",
|
||||
artifact_mode=artifact_mode,
|
||||
no_interactive=self.no_interactive,
|
||||
system_images_only=True,
|
||||
avd_manifest_path=android.AVD_MANIFEST_X86_64,
|
||||
)
|
||||
android.ensure_android(
|
||||
"linux",
|
||||
artifact_mode=artifact_mode,
|
||||
no_interactive=self.no_interactive,
|
||||
system_images_only=True,
|
||||
avd_manifest_path=android.AVD_MANIFEST_ARM,
|
||||
)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self):
|
||||
self.install_mobile_android_packages(artifact_mode=True)
|
||||
|
||||
def ensure_mobile_android_packages(self, state_dir, checkout_root):
|
||||
from mozboot import android
|
||||
|
||||
self.install_toolchain_artifact(
|
||||
state_dir, checkout_root, android.LINUX_X86_64_ANDROID_AVD
|
||||
)
|
||||
self.install_toolchain_artifact(
|
||||
state_dir, checkout_root, android.LINUX_ARM_ANDROID_AVD
|
||||
)
|
||||
|
||||
def generate_mobile_android_mozconfig(self, artifact_mode=False):
|
||||
from mozboot import android
|
||||
|
|
|
@ -154,7 +154,13 @@ class MozillaBuildBootstrapper(BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
pass
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=True)
|
||||
|
||||
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
java_bin_dir = self.ensure_java(mozconfig_builder)
|
||||
from mach.util import setenv
|
||||
|
||||
|
|
|
@ -35,9 +35,15 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
"patterns-gnome-devel_gnome",
|
||||
]
|
||||
|
||||
BROWSER_GROUP_PACKAGES = ["devel_C_C++", "devel_gnome"]
|
||||
BROWSER_GROUP_PACKAGES = [
|
||||
"devel_C_C++",
|
||||
"devel_gnome",
|
||||
]
|
||||
|
||||
MOBILE_ANDROID_COMMON_PACKAGES = ["java-1_8_0-openjdk", "wget"]
|
||||
MOBILE_ANDROID_COMMON_PACKAGES = [
|
||||
"java-1_8_0-openjdk",
|
||||
"wget",
|
||||
]
|
||||
|
||||
def __init__(self, version, dist_id, **kwargs):
|
||||
print("Using an experimental bootstrapper for openSUSE.")
|
||||
|
@ -55,6 +61,12 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_browser_packages(artifact_mode=True)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages()
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(artifact_mode=True)
|
||||
|
||||
def install_mercurial(self):
|
||||
self(["pip", "install", "--upgrade", "pip", "--user"])
|
||||
self(["pip", "install", "--upgrade", "Mercurial", "--user"])
|
||||
|
@ -74,7 +86,7 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
# TODO: Figure out what not to install for artifact mode
|
||||
self.zypper_patterninstall(*self.BROWSER_GROUP_PACKAGES)
|
||||
|
||||
def install_mobile_android_packages(self, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, artifact_mode=False):
|
||||
# Multi-part process:
|
||||
# 1. System packages.
|
||||
# 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages.
|
||||
|
@ -93,7 +105,7 @@ class OpenSUSEBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
raise e
|
||||
|
||||
# 2. Android pieces.
|
||||
super().install_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
|
||||
def _update_package_manager(self):
|
||||
self.zypper_update
|
||||
|
|
|
@ -163,16 +163,6 @@ class OSXBootstrapper(BaseBootstrapper):
|
|||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_homebrew_mobile_android_packages(mozconfig_builder)
|
||||
|
||||
def ensure_mobile_android_packages(self, state_dir, checkout_root):
|
||||
from mozboot import android
|
||||
|
||||
self.install_toolchain_artifact(
|
||||
state_dir, checkout_root, android.MACOS_X86_64_ANDROID_AVD
|
||||
)
|
||||
self.install_toolchain_artifact(
|
||||
state_dir, checkout_root, android.MACOS_ARM_ANDROID_AVD
|
||||
)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_homebrew_mobile_android_packages(
|
||||
mozconfig_builder, artifact_mode=True
|
||||
|
@ -277,20 +267,6 @@ class OSXBootstrapper(BaseBootstrapper):
|
|||
android.ensure_android(
|
||||
"macosx", artifact_mode=artifact_mode, no_interactive=self.no_interactive
|
||||
)
|
||||
android.ensure_android(
|
||||
"macosx",
|
||||
system_images_only=True,
|
||||
artifact_mode=artifact_mode,
|
||||
no_interactive=self.no_interactive,
|
||||
avd_manifest_path=android.AVD_MANIFEST_X86_64,
|
||||
)
|
||||
android.ensure_android(
|
||||
"macosx",
|
||||
system_images_only=True,
|
||||
artifact_mode=artifact_mode,
|
||||
no_interactive=self.no_interactive,
|
||||
avd_manifest_path=android.AVD_MANIFEST_ARM,
|
||||
)
|
||||
|
||||
def ensure_homebrew_installed(self):
|
||||
"""
|
||||
|
|
|
@ -20,8 +20,14 @@ if sys.version_info < (3,):
|
|||
class SolusBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
||||
"""Solus experimental bootstrapper."""
|
||||
|
||||
SYSTEM_PACKAGES = ["nodejs", "unzip", "zip"]
|
||||
SYSTEM_COMPONENTS = ["system.devel"]
|
||||
SYSTEM_PACKAGES = [
|
||||
"nodejs",
|
||||
"unzip",
|
||||
"zip",
|
||||
]
|
||||
SYSTEM_COMPONENTS = [
|
||||
"system.devel",
|
||||
]
|
||||
|
||||
BROWSER_PACKAGES = [
|
||||
"alsa-lib",
|
||||
|
@ -62,6 +68,12 @@ class SolusBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_browser_packages(artifact_mode=True)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=True)
|
||||
|
||||
def ensure_browser_packages(self, artifact_mode=False):
|
||||
self.package_install(*self.BROWSER_PACKAGES)
|
||||
|
||||
|
@ -69,7 +81,7 @@ class SolusBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
# installed via ensure_browser_packages
|
||||
pass
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
try:
|
||||
self.package_install(*self.MOBILE_ANDROID_COMMON_PACKAGES)
|
||||
except Exception as e:
|
||||
|
@ -78,7 +90,7 @@ class SolusBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
|
||||
# 2. Android pieces.
|
||||
self.ensure_java(mozconfig_builder)
|
||||
super().install_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
|
||||
def _update_package_manager(self):
|
||||
pass
|
||||
|
|
|
@ -14,7 +14,14 @@ from mozboot.linux_common import LinuxBootstrapper
|
|||
|
||||
class VoidBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
||||
|
||||
PACKAGES = ["clang", "make", "mercurial", "nodejs", "unzip", "zip"]
|
||||
PACKAGES = [
|
||||
"clang",
|
||||
"make",
|
||||
"mercurial",
|
||||
"nodejs",
|
||||
"unzip",
|
||||
"zip",
|
||||
]
|
||||
|
||||
BROWSER_PACKAGES = [
|
||||
"dbus-devel",
|
||||
|
@ -77,10 +84,16 @@ class VoidBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
def install_browser_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_browser_packages(artifact_mode=True)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
self.ensure_mobile_android_packages(mozconfig_builder, artifact_mode=True)
|
||||
|
||||
def ensure_browser_packages(self, artifact_mode=False):
|
||||
self.xbps_install(*self.browser_packages)
|
||||
|
||||
def install_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False):
|
||||
# Multi-part process:
|
||||
# 1. System packages.
|
||||
# 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages.
|
||||
|
@ -88,7 +101,7 @@ class VoidBootstrapper(LinuxBootstrapper, BaseBootstrapper):
|
|||
|
||||
# 2. Android pieces.
|
||||
self.ensure_java(mozconfig_builder)
|
||||
super().install_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
super().ensure_mobile_android_packages(artifact_mode=artifact_mode)
|
||||
|
||||
def _update_package_manager(self):
|
||||
self.xbps_update()
|
||||
|
|
|
@ -56,7 +56,10 @@ class WindowsBootstrapper(BaseBootstrapper):
|
|||
"mingw-w64-i686-toolchain",
|
||||
]
|
||||
|
||||
BROWSER_PACKAGES = ["mingw-w64-x86_64-nasm", "mingw-w64-i686-nsis"]
|
||||
BROWSER_PACKAGES = [
|
||||
"mingw-w64-x86_64-nasm",
|
||||
"mingw-w64-i686-nsis",
|
||||
]
|
||||
|
||||
MOBILE_ANDROID_COMMON_PACKAGES = ["wget"]
|
||||
|
||||
|
@ -93,11 +96,6 @@ class WindowsBootstrapper(BaseBootstrapper):
|
|||
"We do not support building Android on Windows. Sorry!"
|
||||
)
|
||||
|
||||
def ensure_mobile_android_packages(self, state_dir, checkout_root):
|
||||
raise NotImplementedError(
|
||||
"We do not support building Android on Windows. Sorry!"
|
||||
)
|
||||
|
||||
def install_mobile_android_artifact_mode_packages(self, mozconfig_builder):
|
||||
raise NotImplementedError(
|
||||
"We do not support building Android on Windows. Sorry!"
|
||||
|
|
|
@ -117,7 +117,6 @@ android-x86-fuzzing/debug:
|
|||
|
||||
android-x86-shippable/opt:
|
||||
description: "Android 4.2 x86 Shippable"
|
||||
use-pgo: true
|
||||
attributes:
|
||||
enable-full-crashsymbols: true
|
||||
shippable: true
|
||||
|
@ -172,7 +171,7 @@ android-arm/opt:
|
|||
|
||||
android-arm-shippable/opt:
|
||||
description: "Android 4.0 Arm Shippable"
|
||||
use-pgo: android-x86-shippable/opt
|
||||
use-pgo: true
|
||||
attributes:
|
||||
enable-full-crashsymbols: true
|
||||
shippable: true
|
||||
|
@ -199,7 +198,6 @@ android-arm-shippable/opt:
|
|||
fetches:
|
||||
toolchain:
|
||||
- linux64-clang
|
||||
- android-gradle-dependencies
|
||||
|
||||
android-aarch64/opt:
|
||||
description: "Android 5.0 AArch64 Opt"
|
||||
|
@ -252,7 +250,7 @@ android-aarch64/debug:
|
|||
|
||||
android-aarch64-shippable/opt:
|
||||
description: "Android 5.0 AArch64 Shippable"
|
||||
use-pgo: android-x86_64-shippable/opt
|
||||
use-pgo: android-arm-shippable/opt
|
||||
attributes:
|
||||
enable-full-crashsymbols: true
|
||||
shippable: true
|
||||
|
@ -279,7 +277,6 @@ android-aarch64-shippable/opt:
|
|||
fetches:
|
||||
toolchain:
|
||||
- linux64-clang
|
||||
- android-gradle-dependencies
|
||||
|
||||
android-x86_64/opt:
|
||||
description: "Android 5.0 x86-64 Opt"
|
||||
|
@ -308,7 +305,6 @@ android-x86_64/opt:
|
|||
|
||||
android-x86_64-shippable/opt:
|
||||
description: "Android 5.0 x86-64 Shippable"
|
||||
use-pgo: true
|
||||
attributes:
|
||||
enable-full-crashsymbols: true
|
||||
shippable: true
|
||||
|
|
|
@ -85,15 +85,15 @@ jobs:
|
|||
- linux64-clang
|
||||
- linux64-minidump-stackwalk
|
||||
|
||||
android-x86-shippable/opt:
|
||||
description: "Android 4.0 x86 Profile Generation"
|
||||
android-arm-shippable/opt:
|
||||
description: "Android 4.0 Arm Profile Generation"
|
||||
shipping-phase: build
|
||||
shipping-product: fennec
|
||||
index:
|
||||
product: mobile
|
||||
job-name: android-x86-profile
|
||||
job-name: android-arm-profile
|
||||
treeherder:
|
||||
platform: android-4-0-x86/pgo
|
||||
platform: android-4-0-armv7/pgo
|
||||
worker-type: t-linux-xlarge-pgo
|
||||
worker:
|
||||
chain-of-trust: true
|
||||
|
@ -115,55 +115,12 @@ jobs:
|
|||
options: [installer-path=/builds/worker/fetches/geckoview-androidTest.apk]
|
||||
config:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64-profile-generation.py
|
||||
- android/androidarm_4_3.py
|
||||
- android/android_pgo.py
|
||||
fetches:
|
||||
toolchain:
|
||||
- linux64-clang
|
||||
- linux64-minidump-stackwalk
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
|
||||
android-x86_64-shippable/opt:
|
||||
description: "Android 5.0 x86_64 Profile Generation"
|
||||
shipping-phase: build
|
||||
shipping-product: fennec
|
||||
index:
|
||||
product: mobile
|
||||
job-name: android-x86_64-profile
|
||||
treeherder:
|
||||
platform: android-5-0-x86_64/pgo
|
||||
worker-type: t-linux-xlarge-pgo
|
||||
worker:
|
||||
chain-of-trust: true
|
||||
max-run-time: 2700
|
||||
docker-image: {in-tree: ubuntu1804-test}
|
||||
env:
|
||||
WORKING_DIR: "/builds/worker"
|
||||
MOZHARNESS_PATH: "/builds/worker/checkouts/gecko/testing/mozharness"
|
||||
artifacts:
|
||||
- type: directory
|
||||
name: public/build
|
||||
path: /builds/worker/artifacts/
|
||||
run:
|
||||
using: mozharness
|
||||
need-xvfb: true
|
||||
job-script: taskcluster/scripts/tester/test-linux.sh
|
||||
script: android_emulator_pgo.py
|
||||
tooltool-downloads: internal
|
||||
options: [installer-path=/builds/worker/fetches/geckoview-androidTest.apk]
|
||||
config:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64-profile-generation.py
|
||||
- android/android_pgo.py
|
||||
fetches:
|
||||
toolchain:
|
||||
- linux64-clang
|
||||
- linux64-minidump-stackwalk
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
|
||||
win32-shippable/opt:
|
||||
description: "Win32 Profile Generation"
|
||||
|
|
|
@ -137,14 +137,14 @@ jobs:
|
|||
- sysroot-x86_64-linux-gnu
|
||||
- wasi-sysroot
|
||||
|
||||
android-x86-shippable/opt:
|
||||
description: "Android 4.0 x86 PGO instrumented"
|
||||
android-arm-shippable/opt:
|
||||
description: "Android 4.0 Arm PGO instrumented"
|
||||
index:
|
||||
product: mobile
|
||||
job-name: instrumented-android-x86
|
||||
job-name: instrumented-android-arm
|
||||
shipping-product: fennec
|
||||
treeherder:
|
||||
platform: android-4-0-x86/pgo
|
||||
platform: android-4-0-armv7/pgo
|
||||
worker-type: b-linux
|
||||
worker:
|
||||
docker-image: {in-tree: android-build}
|
||||
|
@ -164,48 +164,7 @@ jobs:
|
|||
run:
|
||||
config:
|
||||
- builds/releng_base_android_64_builds.py
|
||||
custom-build-variant-cfg: x86-profile-generate
|
||||
tooltool-downloads: internal
|
||||
fetches:
|
||||
toolchain:
|
||||
- android-gradle-dependencies
|
||||
- android-ndk-linux
|
||||
- android-sdk-linux
|
||||
- linux64-clang-android-cross
|
||||
- linux64-rust-android
|
||||
- linux64-rust-size
|
||||
- linux64-cbindgen
|
||||
- linux64-nasm
|
||||
- linux64-node
|
||||
|
||||
android-x86_64-shippable/opt:
|
||||
description: "Android 5.0 x86_64 PGO instrumented"
|
||||
index:
|
||||
product: mobile
|
||||
job-name: instrumented-android-x86_64
|
||||
shipping-product: fennec
|
||||
treeherder:
|
||||
platform: android-5-0-x86_64/pgo
|
||||
worker-type: b-linux
|
||||
worker:
|
||||
docker-image: {in-tree: android-build}
|
||||
env:
|
||||
GRADLE_USER_HOME: "/builds/worker/checkouts/gecko/mobile/android/gradle/dotgradle-offline"
|
||||
TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
|
||||
artifacts:
|
||||
- name: public/build
|
||||
path: /builds/worker/artifacts/
|
||||
type: directory
|
||||
- name: public/build/geckoview-androidTest.apk
|
||||
path: /builds/worker/workspace/obj-build/gradle/build/mobile/android/geckoview/outputs/apk/androidTest/withGeckoBinaries/debug/geckoview-withGeckoBinaries-debug-androidTest.apk
|
||||
type: file
|
||||
- name: public/build/geckoview_example.apk
|
||||
path: /builds/worker/workspace/obj-build/gradle/build/mobile/android/geckoview_example/outputs/apk/withGeckoBinaries/debug/geckoview_example-withGeckoBinaries-debug.apk
|
||||
type: file
|
||||
run:
|
||||
config:
|
||||
- builds/releng_base_android_64_builds.py
|
||||
custom-build-variant-cfg: x86_64-profile-generate
|
||||
custom-build-variant-cfg: arm-profile-generate
|
||||
tooltool-downloads: internal
|
||||
fetches:
|
||||
toolchain:
|
||||
|
|
|
@ -19,7 +19,7 @@ job-defaults:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
android-hw.*:
|
||||
- android/android_common.py
|
||||
- android/android_hw.py
|
||||
|
|
|
@ -63,8 +63,6 @@ job-defaults:
|
|||
- macosx64-minidump-stackwalk
|
||||
- macosx64-fix-stacks
|
||||
android-em-7.*:
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
- android-emulator-linux
|
||||
- linux64-minidump-stackwalk
|
||||
- linux64-fix-stacks
|
||||
|
|
|
@ -26,7 +26,7 @@ geckoview-junit:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
extra-options:
|
||||
- --test-suite=geckoview-junit
|
||||
|
||||
|
@ -99,7 +99,7 @@ test-verify:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
linux.*:
|
||||
- unittests/linux_unittest.py
|
||||
- remove_executables.py
|
||||
|
@ -133,8 +133,6 @@ test-verify:
|
|||
- win32-fix-stacks
|
||||
android-em-7.*:
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
- linux64-node
|
||||
- linux64-minidump-stackwalk
|
||||
- linux64-fix-stacks
|
||||
|
@ -173,7 +171,7 @@ test-verify-gpu:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
linux.*:
|
||||
- unittests/linux_unittest.py
|
||||
- remove_executables.py
|
||||
|
@ -210,7 +208,7 @@ test-coverage:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
linux.*:
|
||||
- unittests/linux_unittest.py
|
||||
- remove_executables.py
|
||||
|
@ -244,8 +242,6 @@ test-coverage:
|
|||
- win32-fix-stacks
|
||||
android-em-7.*:
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
- linux64-node
|
||||
- linux64-minidump-stackwalk
|
||||
- linux64-fix-stacks
|
||||
|
@ -280,7 +276,7 @@ test-coverage-gpu:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
linux.*:
|
||||
- unittests/linux_unittest.py
|
||||
- remove_executables.py
|
||||
|
|
|
@ -36,7 +36,7 @@ job-defaults:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
android-hw.*:
|
||||
- android/android_common.py
|
||||
- android/android_hw.py
|
||||
|
|
|
@ -27,7 +27,7 @@ job-defaults:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
android-hw.*:
|
||||
- android/android_common.py
|
||||
- android/android_hw.py
|
||||
|
|
|
@ -26,7 +26,7 @@ job-defaults:
|
|||
macosx.*:
|
||||
- web_platform_tests/prod_config_mac.py
|
||||
android-em.*:
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
- web_platform_tests/prod_config_android.py
|
||||
default:
|
||||
- web_platform_tests/prod_config.py
|
||||
|
|
|
@ -22,7 +22,7 @@ job-defaults:
|
|||
by-test-platform:
|
||||
android-em-7.*:
|
||||
- android/android_common.py
|
||||
- android/android-x86_64.py
|
||||
- android/androidx86_7_0.py
|
||||
linux.*:
|
||||
- unittests/linux_unittest.py
|
||||
- remove_executables.py
|
||||
|
@ -101,8 +101,6 @@ xpcshell:
|
|||
- win32-minidump-stackwalk
|
||||
- win32-fix-stacks
|
||||
android-em-7.*:
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
- android-emulator-linux
|
||||
- linux64-node
|
||||
- linux64-minidump-stackwalk
|
||||
|
|
|
@ -8,64 +8,6 @@ job-defaults:
|
|||
docker-image: {in-tree: android-build}
|
||||
max-run-time: 1800
|
||||
|
||||
# In automation, we generate the AVD using the linux64-android-avd jobs. On
|
||||
# developers' machines, bootstrap will download the artifact from the avd job
|
||||
# instead of generating it.
|
||||
#
|
||||
# The Android AVD needs the corresponding system image generated in the
|
||||
# linux64-android-system-image TL job. System images are not redistributable,
|
||||
# so locally bootstrap will use sdkmanager to download the corresponding system
|
||||
# images.
|
||||
linux64-android-avd-x86_64-repack:
|
||||
attributes:
|
||||
local-toolchain: true
|
||||
description: "Android AVD (Linux) repack toolchain build"
|
||||
treeherder:
|
||||
symbol: TL(avd-x86_64-linux)
|
||||
run-on-projects: [trunk]
|
||||
run:
|
||||
script: repack-android-avd-linux.sh
|
||||
arguments:
|
||||
- 'python/mozboot/mozboot/android-avds/x86_64.json'
|
||||
resources:
|
||||
- 'python/mozboot/**/*android*'
|
||||
toolchain-artifact: public/build/android-avd-linux.tar.zst
|
||||
toolchain-alias: android-avd-x86_64-linux
|
||||
|
||||
linux64-android-avd-arm-repack:
|
||||
attributes:
|
||||
local-toolchain: true
|
||||
description: "Android AVD (Linux) repack toolchain build"
|
||||
treeherder:
|
||||
symbol: TL(avd-arm-linux)
|
||||
run-on-projects: [trunk]
|
||||
run:
|
||||
script: repack-android-avd-linux.sh
|
||||
arguments:
|
||||
- 'python/mozboot/mozboot/android-avds/arm.json'
|
||||
resources:
|
||||
- 'python/mozboot/**/*android*'
|
||||
toolchain-artifact: public/build/android-avd-linux.tar.zst
|
||||
toolchain-alias: android-avd-arm-linux
|
||||
|
||||
linux64-android-system-image-x86_64-repack:
|
||||
description: "Android System Images (Linux) repack toolchain build"
|
||||
treeherder:
|
||||
symbol: TL(x86_64-avd-img-linux)
|
||||
worker:
|
||||
artifacts:
|
||||
- name: project/gecko/android-system-images
|
||||
path: /builds/worker/project/gecko/android-system-images/
|
||||
type: directory
|
||||
run:
|
||||
script: repack-android-system-images-linux.sh
|
||||
arguments:
|
||||
- 'python/mozboot/mozboot/android-avds/x86_64.json'
|
||||
resources:
|
||||
- 'python/mozboot/**/*android*'
|
||||
toolchain-artifact: project/gecko/android-system-images/android-system-images-linux.tar.zst
|
||||
toolchain-alias: android-system-image-x86_64-linux
|
||||
|
||||
linux64-android-sdk-linux-repack:
|
||||
description: "Android SDK (Linux) repack toolchain build"
|
||||
treeherder:
|
||||
|
|
|
@ -271,8 +271,6 @@ jobs:
|
|||
- android-gradle-dependencies
|
||||
- android-ndk-linux
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
- linux64-rust-android
|
||||
- wrench-deps
|
||||
treeherder:
|
||||
|
@ -313,8 +311,6 @@ jobs:
|
|||
- android-gradle-dependencies
|
||||
- android-ndk-linux
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
- linux64-rust-android
|
||||
- wrench-deps
|
||||
treeherder:
|
||||
|
@ -351,8 +347,6 @@ jobs:
|
|||
- 'wrench-debug.apk'
|
||||
toolchain:
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
run:
|
||||
using: run-task
|
||||
tooltool-downloads: internal
|
||||
|
@ -395,8 +389,6 @@ jobs:
|
|||
- 'wrench-release.apk'
|
||||
toolchain:
|
||||
- android-sdk-linux
|
||||
- android-system-image-x86_64-linux
|
||||
- android-avd-x86_64-linux
|
||||
run:
|
||||
using: run-task
|
||||
tooltool-downloads: internal
|
||||
|
|
|
@ -31,8 +31,6 @@ RUN apt-get update && \
|
|||
uuid \
|
||||
valgrind \
|
||||
vim \
|
||||
x11-utils \
|
||||
xvfb \
|
||||
wget \
|
||||
zip \
|
||||
zstd
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -x -e -v
|
||||
|
||||
# Initialize XVFB for the AVD
|
||||
. /builds/worker/scripts/xvfb.sh
|
||||
|
||||
cleanup() {
|
||||
local rv=$?
|
||||
cleanup_xvfb
|
||||
exit $rv
|
||||
}
|
||||
trap cleanup EXIT INT
|
||||
|
||||
start_xvfb '1024x768x24' 2
|
||||
|
||||
# This script is for fetching and repacking the Android SDK (for
|
||||
# Linux), the tools required to produce Android packages.
|
||||
|
||||
UPLOAD_DIR=/builds/worker/artifacts/
|
||||
AVD_JSON_CONFIG="$1"
|
||||
|
||||
mkdir -p $HOME/artifacts $UPLOAD_DIR
|
||||
|
||||
# Populate /builds/worker/.mozbuild/android-device
|
||||
cd $GECKO_PATH
|
||||
./mach python python/mozboot/mozboot/android.py --artifact-mode --prewarm-avd --avd-manifest="$AVD_JSON_CONFIG" --no-interactive --list-packages
|
||||
|
||||
tar cavf $UPLOAD_DIR/android-avd-linux.tar.zst -C /builds/worker/.mozbuild android-device
|
||||
|
||||
ls -al $UPLOAD_DIR
|
|
@ -10,7 +10,7 @@ mkdir -p $HOME/artifacts $UPLOAD_DIR
|
|||
|
||||
# Populate /builds/worker/.mozbuild/android-emulator-linux.
|
||||
cd $GECKO_PATH
|
||||
./mach python python/mozboot/mozboot/android.py --emulator-only --no-interactive --list-packages
|
||||
./mach python python/mozboot/mozboot/android.py --emulator-only --no-interactive
|
||||
|
||||
# Remove extra files we don't need
|
||||
rm -rfv /builds/worker/.mozbuild/android-sdk-linux/tools
|
||||
|
|
|
@ -10,7 +10,11 @@ mkdir -p $HOME/artifacts $UPLOAD_DIR
|
|||
|
||||
# Populate /builds/worker/.mozbuild/android-sdk-linux.
|
||||
cd $GECKO_PATH
|
||||
./mach python python/mozboot/mozboot/android.py --artifact-mode --no-interactive --list-packages
|
||||
./mach python python/mozboot/mozboot/android.py --artifact-mode --no-interactive
|
||||
|
||||
# It's nice to have the build logs include the state of the world upon
|
||||
# completion.
|
||||
/builds/worker/.mozbuild/android-sdk-linux/tools/bin/sdkmanager --list
|
||||
|
||||
tar cavf $UPLOAD_DIR/android-sdk-linux.tar.zst -C /builds/worker/.mozbuild android-sdk-linux
|
||||
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -x -e -v
|
||||
|
||||
# This script is for fetching and repacking the Android SDK (for
|
||||
# Linux), the tools required to produce Android packages.
|
||||
|
||||
AVD_JSON_CONFIG="$1"
|
||||
UPLOAD_DIR=$HOME/project/gecko/android-system-images
|
||||
|
||||
mkdir -p $HOME/artifacts $UPLOAD_DIR
|
||||
|
||||
# Populate /builds/worker/.mozbuild/android-sdk-linux.
|
||||
cd $GECKO_PATH
|
||||
./mach python python/mozboot/mozboot/android.py --artifact-mode --system-images-only --avd-manifest="$AVD_JSON_CONFIG" --no-interactive --list-packages
|
||||
|
||||
tar cavf $UPLOAD_DIR/android-system-images-linux.tar.zst -C /builds/worker/.mozbuild android-sdk-linux/system-images
|
||||
|
||||
ls -al $UPLOAD_DIR
|
|
@ -19,6 +19,7 @@ import time
|
|||
from distutils.spawn import find_executable
|
||||
from enum import Enum
|
||||
|
||||
from mozbuild.base import MozbuildObject
|
||||
from mozdevice import ADBHost, ADBDeviceFactory
|
||||
from six.moves import input, urllib
|
||||
|
||||
|
@ -83,9 +84,16 @@ class AvdInfo(object):
|
|||
Simple class to contain an AVD description.
|
||||
"""
|
||||
|
||||
def __init__(self, description, name, extra_args, x86):
|
||||
def __init__(
|
||||
self, description, name, tooltool_manifest, toolchain_job, extra_args, x86
|
||||
):
|
||||
assert not (tooltool_manifest and toolchain_job), (
|
||||
"%s: specify manifest or toolchain job, not both" % description
|
||||
)
|
||||
self.description = description
|
||||
self.name = name
|
||||
self.tooltool_manifest = tooltool_manifest
|
||||
self.toolchain_job = toolchain_job
|
||||
self.extra_args = extra_args
|
||||
self.x86 = x86
|
||||
|
||||
|
@ -97,34 +105,19 @@ class AvdInfo(object):
|
|||
and the parameters for each reflect those used in mozharness.
|
||||
"""
|
||||
AVD_DICT = {
|
||||
"arm": AvdInfo(
|
||||
"Android arm",
|
||||
"mozemulator-armeabi-v7a",
|
||||
[
|
||||
"-skip-adb-auth",
|
||||
"-verbose",
|
||||
"-show-kernel",
|
||||
"-ranchu",
|
||||
"-selinux",
|
||||
"permissive",
|
||||
"-memory",
|
||||
"3072",
|
||||
"-cores",
|
||||
"4",
|
||||
"-skin",
|
||||
"800x1280",
|
||||
"-gpu",
|
||||
"on",
|
||||
"-no-snapstorage",
|
||||
"-no-snapshot",
|
||||
"-prop",
|
||||
"ro.test_harness=true",
|
||||
],
|
||||
"arm-4.3": AvdInfo(
|
||||
"Android 4.3",
|
||||
"mozemulator-4.3",
|
||||
"testing/config/tooltool-manifests/androidarm_4_3/mach-emulator.manifest",
|
||||
None,
|
||||
["-skip-adb-auth", "-verbose", "-show-kernel"],
|
||||
False,
|
||||
),
|
||||
"x86_64": AvdInfo(
|
||||
"Android x86_64",
|
||||
"mozemulator-x86_64",
|
||||
"x86-7.0": AvdInfo(
|
||||
"Android 7.0 x86/x86_64",
|
||||
"mozemulator-x86-7.0",
|
||||
"testing/config/tooltool-manifests/androidx86_7_0/mach-emulator.manifest",
|
||||
None,
|
||||
[
|
||||
"-skip-adb-auth",
|
||||
"-verbose",
|
||||
|
@ -136,12 +129,6 @@ AVD_DICT = {
|
|||
"3072",
|
||||
"-cores",
|
||||
"4",
|
||||
"-skin",
|
||||
"800x1280",
|
||||
"-prop",
|
||||
"ro.test_harness=true",
|
||||
"-no-snapstorage",
|
||||
"-no-snapshot",
|
||||
],
|
||||
True,
|
||||
),
|
||||
|
@ -296,8 +283,8 @@ def verify_android_device(
|
|||
).strip()
|
||||
if response.lower().startswith("y") or response == "":
|
||||
if not emulator.check_avd():
|
||||
_log_info("Android AVD not found, please run |mach bootstrap|")
|
||||
return
|
||||
_log_info("Fetching AVD...")
|
||||
emulator.update_avd()
|
||||
_log_info(
|
||||
"Starting emulator running %s..." % emulator.get_avd_description()
|
||||
)
|
||||
|
@ -544,7 +531,7 @@ class AndroidEmulator(object):
|
|||
emulator = AndroidEmulator()
|
||||
if not emulator.is_running() and emulator.is_available():
|
||||
if not emulator.check_avd():
|
||||
print("Android Emulator AVD not found, please run |mach bootstrap|")
|
||||
emulator.update_avd()
|
||||
emulator.start()
|
||||
emulator.wait_for_start()
|
||||
emulator.wait()
|
||||
|
@ -594,18 +581,56 @@ class AndroidEmulator(object):
|
|||
found = True
|
||||
return found
|
||||
|
||||
def check_avd(self):
|
||||
def check_avd(self, force=False):
|
||||
"""
|
||||
Determine if the AVD is already installed locally.
|
||||
(This is usually used to determine if update_avd() is likely
|
||||
to require a download.)
|
||||
|
||||
Returns True if the AVD is installed.
|
||||
"""
|
||||
avd = os.path.join(EMULATOR_HOME_DIR, "avd", self.avd_info.name + ".avd")
|
||||
if force and os.path.exists(avd):
|
||||
shutil.rmtree(avd)
|
||||
if os.path.exists(avd):
|
||||
_log_debug("AVD found at %s" % avd)
|
||||
return True
|
||||
return False
|
||||
|
||||
def update_avd(self, force=False):
|
||||
"""
|
||||
If required, update the AVD via tooltool.
|
||||
|
||||
If the AVD directory is not found, or "force" is requested,
|
||||
download the tooltool manifest associated with the AVD and then
|
||||
invoke tooltool.py on the manifest. tooltool.py will download the
|
||||
required archive (unless already present in the local tooltool
|
||||
cache) and install the AVD.
|
||||
"""
|
||||
avd = os.path.join(EMULATOR_HOME_DIR, "avd", self.avd_info.name + ".avd")
|
||||
ini_file = os.path.join(EMULATOR_HOME_DIR, "avd", self.avd_info.name + ".ini")
|
||||
if force and os.path.exists(avd):
|
||||
shutil.rmtree(avd)
|
||||
if force:
|
||||
for f in glob.glob(os.path.join(EMULATOR_HOME_DIR, "AVD*.checksum")):
|
||||
os.remove(f)
|
||||
if not os.path.exists(avd):
|
||||
if os.path.exists(ini_file):
|
||||
os.remove(ini_file)
|
||||
if self.avd_info.tooltool_manifest:
|
||||
path = self.avd_info.tooltool_manifest
|
||||
_get_tooltool_manifest(
|
||||
self.substs, path, EMULATOR_HOME_DIR, "releng.manifest"
|
||||
)
|
||||
_tooltool_fetch(self.substs)
|
||||
elif self.avd_info.toolchain_job:
|
||||
_install_toolchain_artifact(self.avd_info.toolchain_job)
|
||||
else:
|
||||
raise Exception(
|
||||
"either a tooltool manifest or a toolchain job is required"
|
||||
)
|
||||
self._update_avd_paths()
|
||||
|
||||
def start(self, gpu_arg=None):
|
||||
"""
|
||||
Launch the emulator.
|
||||
|
@ -620,7 +645,6 @@ class AndroidEmulator(object):
|
|||
auth_file.close()
|
||||
|
||||
env = os.environ
|
||||
env["ANDROID_EMULATOR_HOME"] = EMULATOR_HOME_DIR
|
||||
env["ANDROID_AVD_HOME"] = os.path.join(EMULATOR_HOME_DIR, "avd")
|
||||
command = [self.emulator_path, "-avd", self.avd_info.name]
|
||||
override = os.environ.get("MOZ_EMULATOR_COMMAND_ARGS")
|
||||
|
@ -835,10 +859,10 @@ class AndroidEmulator(object):
|
|||
return requested
|
||||
if self.substs:
|
||||
if not self.substs["TARGET_CPU"].startswith("arm"):
|
||||
return "x86_64"
|
||||
return "x86-7.0"
|
||||
else:
|
||||
return "arm"
|
||||
return "x86_64"
|
||||
return "arm-4.3"
|
||||
return "x86-7.0"
|
||||
|
||||
|
||||
def _find_sdk_exe(substs, exe, tools):
|
||||
|
@ -988,6 +1012,34 @@ def _tooltool_fetch(substs):
|
|||
_log_warning(str(e))
|
||||
|
||||
|
||||
def _install_toolchain_artifact(toolchain_job, no_unpack=False):
|
||||
build_obj = MozbuildObject.from_environment()
|
||||
mach_binary = os.path.join(build_obj.topsrcdir, "mach")
|
||||
mach_binary = os.path.abspath(mach_binary)
|
||||
if not os.path.exists(mach_binary):
|
||||
raise ValueError("mach not found at %s" % mach_binary)
|
||||
|
||||
# If Python can't figure out what its own executable is, there's little
|
||||
# chance we're going to be able to execute mach on its own, particularly
|
||||
# on Windows.
|
||||
if not sys.executable:
|
||||
raise ValueError("cannot determine path to Python executable")
|
||||
|
||||
cmd = [
|
||||
sys.executable,
|
||||
mach_binary,
|
||||
"artifact",
|
||||
"toolchain",
|
||||
"--from-build",
|
||||
toolchain_job,
|
||||
]
|
||||
|
||||
if no_unpack:
|
||||
cmd += ["--no-unpack"]
|
||||
|
||||
subprocess.check_call(cmd, cwd=EMULATOR_HOME_DIR)
|
||||
|
||||
|
||||
def _get_host_platform():
|
||||
plat = None
|
||||
if "darwin" in str(sys.platform).lower():
|
||||
|
|
|
@ -97,7 +97,7 @@ def ChromiumRunner(*args, **kwargs):
|
|||
|
||||
|
||||
def FennecEmulatorRunner(
|
||||
avd="mozemulator-arm",
|
||||
avd="mozemulator-4.3",
|
||||
adb_path=None,
|
||||
avd_home=None,
|
||||
logdir=None,
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# mozharness configuration for Android x86/x86_64 7.0 unit tests
|
||||
#
|
||||
# This configuration should be combined with suite definitions and other
|
||||
# mozharness configuration from android_common.py, or similar.
|
||||
|
||||
config = {
|
||||
"emulator_avd_name": "mozemulator-x86_64",
|
||||
"emulator_process_name": "qemu-system-x86_64",
|
||||
"emulator_extra_args": [
|
||||
"-gpu",
|
||||
"on",
|
||||
"-skip-adb-auth",
|
||||
"-verbose",
|
||||
"-show-kernel",
|
||||
"-ranchu",
|
||||
"-selinux",
|
||||
"permissive",
|
||||
"-memory",
|
||||
"3072",
|
||||
"-cores",
|
||||
"4",
|
||||
"-skin",
|
||||
"800x1280",
|
||||
# Build machines cannot use KVM (because it requires a privileged docker
|
||||
# container) so we run the profile generation with -no-accel which disables
|
||||
# hardware acceleration.
|
||||
"-no-accel",
|
||||
"-no-snapstorage",
|
||||
"-no-snapshot",
|
||||
# Disables first-run dialogs
|
||||
"-prop",
|
||||
"ro.test_harness=true",
|
||||
],
|
||||
"exes": {
|
||||
"adb": "%(abs_sdk_dir)s/platform-tools/adb",
|
||||
},
|
||||
"env": {
|
||||
"DISPLAY": ":0.0",
|
||||
"PATH": "%(PATH)s:%(abs_sdk_dir)s/emulator:%(abs_sdk_dir)s/tools:%(abs_sdk_dir)s/tools/bin:%(abs_sdk_dir)s/platform-tools",
|
||||
# "LIBGL_DEBUG": "verbose"
|
||||
},
|
||||
"bogomips_minimum": 3000,
|
||||
"android_version": 24,
|
||||
"is_fennec": False,
|
||||
"is_emulator": True,
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
# Shared/common mozharness configuration for Android unit tests.
|
||||
#
|
||||
# This configuration should be combined with platform-specific mozharness
|
||||
# configuration such as android-x86_64.py, android_hw, or similar.
|
||||
# configuration such as androidx86_7_0.py, android_hw, or similar.
|
||||
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
# Mozharness configuration for Android PGO.
|
||||
#
|
||||
# This configuration should be combined with platform-specific mozharness
|
||||
# configuration such as androidarm.py, or similar.
|
||||
# configuration such as androidarm_4_3.py, or similar.
|
||||
|
||||
config = {
|
||||
"default_actions": [
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
# mozharness configuration for Android 4.3 unit tests
|
||||
#
|
||||
# This configuration should be combined with suite definitions and other
|
||||
# mozharness configuration from android_common.py, or similar.
|
||||
|
||||
config = {
|
||||
"deprecated_sdk_path": True,
|
||||
"tooltool_manifest_path": "testing/config/tooltool-manifests/androidarm_4_3/releng.manifest",
|
||||
"emulator_manifest": """
|
||||
[
|
||||
{
|
||||
"algorithm": "sha512",
|
||||
"visibility": "internal",
|
||||
"filename": "android-sdk_r24.0.2a-linux.tar.gz",
|
||||
"unpack": true,
|
||||
"digest": "9b7d4a6fcb33d80884c68e9099a3e11963a79ec0a380a5a9e1a093e630f960d0a5083392c8804121c3ad27ee8ba29ca8df785d19d5a7fdc89458c4e51ada5120",
|
||||
"size": 38591399
|
||||
}
|
||||
]""",
|
||||
"emulator_avd_name": "test-1",
|
||||
"emulator_process_name": "emulator64-arm",
|
||||
"emulator_extra_args": "-show-kernel -debug init,console,gles,memcheck,adbserver,adbclient,adb,avd_config,socket",
|
||||
"exes": {
|
||||
"adb": "%(abs_work_dir)s/android-sdk-linux/platform-tools/adb",
|
||||
},
|
||||
"env": {
|
||||
"DISPLAY": ":0.0",
|
||||
"PATH": "%(PATH)s:%(abs_work_dir)s/android-sdk-linux/tools:%(abs_work_dir)s/android-sdk-linux/platform-tools",
|
||||
},
|
||||
"bogomips_minimum": 250,
|
||||
# in support of test-verify
|
||||
"android_version": 18,
|
||||
"is_fennec": True,
|
||||
"is_emulator": True,
|
||||
}
|
|
@ -8,29 +8,10 @@
|
|||
# mozharness configuration from android_common.py, or similar.
|
||||
|
||||
config = {
|
||||
"emulator_avd_name": "mozemulator-x86_64",
|
||||
"tooltool_manifest_path": "testing/config/tooltool-manifests/androidx86_7_0/releng.manifest",
|
||||
"emulator_avd_name": "test-1",
|
||||
"emulator_process_name": "qemu-system-x86_64",
|
||||
"emulator_extra_args": [
|
||||
"-gpu",
|
||||
"on",
|
||||
"-skip-adb-auth",
|
||||
"-verbose",
|
||||
"-show-kernel",
|
||||
"-ranchu",
|
||||
"-selinux",
|
||||
"permissive",
|
||||
"-memory",
|
||||
"3072",
|
||||
"-cores",
|
||||
"4",
|
||||
"-skin",
|
||||
"800x1280",
|
||||
"-no-snapstorage",
|
||||
"-no-snapshot",
|
||||
# Skips first-run dialogs
|
||||
"-prop",
|
||||
"ro.test_harness=true",
|
||||
],
|
||||
"emulator_extra_args": "-gpu on -skip-adb-auth -verbose -show-kernel -ranchu -selinux permissive -memory 3072 -cores 4",
|
||||
"exes": {
|
||||
"adb": "%(abs_sdk_dir)s/platform-tools/adb",
|
||||
},
|
|
@ -8,29 +8,10 @@
|
|||
# mozharness configuration from android_common.py, or similar.
|
||||
|
||||
config = {
|
||||
"emulator_avd_name": "mozemulator-x86_64",
|
||||
"emulator_process_name": "qemu-system-x86_64",
|
||||
"emulator_extra_args": [
|
||||
"-gpu",
|
||||
"on",
|
||||
"-skip-adb-auth",
|
||||
"-verbose",
|
||||
"-show-kernel",
|
||||
"-ranchu",
|
||||
"-selinux",
|
||||
"permissive",
|
||||
"-memory",
|
||||
"3072",
|
||||
"-cores",
|
||||
"4",
|
||||
"-skin",
|
||||
"800x1280",
|
||||
"-no-snapstorage",
|
||||
"-no-snapshot",
|
||||
# Skips first-run dialogs
|
||||
"-prop",
|
||||
"ro.test_harness=true",
|
||||
],
|
||||
"tooltool_manifest_path": "testing/config/tooltool-manifests/androidx86_7_0/releng.manifest",
|
||||
"emulator_avd_name": "test-1",
|
||||
"emulator_process_name": "emulator64-x86",
|
||||
"emulator_extra_args": "-gpu on -skip-adb-auth -verbose -show-kernel -ranchu -selinux permissive -memory 3072 -cores 4",
|
||||
"exes": {
|
||||
"adb": "%(abs_sdk_dir)s/platform-tools/adb",
|
||||
},
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
config = {
|
||||
"stage_platform": "android-x86",
|
||||
"src_mozconfig": "mobile/android/config/mozconfigs/android-x86/profile-generate",
|
||||
"stage_platform": "android-arm",
|
||||
"src_mozconfig": "mobile/android/config/mozconfigs/android-arm/profile-generate",
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
config = {
|
||||
"stage_platform": "android-x86_64",
|
||||
"src_mozconfig": "mobile/android/config/mozconfigs/android-x86_64/profile-generate",
|
||||
}
|
|
@ -301,6 +301,7 @@ class BuildOptionParser(object):
|
|||
"arm-debug-ccov": path_base + "%s_arm_debug_ccov.py",
|
||||
"arm-debug-searchfox": path_base + "%s_arm_debug_searchfox.py",
|
||||
"arm-gradle": path_base + "%s_arm_gradle.py",
|
||||
"arm-profile-generate": path_base + "%s_arm_profile_generate.py",
|
||||
"rusttests": path_base + "%s_rusttests.py",
|
||||
"rusttests-debug": path_base + "%s_rusttests_debug.py",
|
||||
"x86": path_base + "%s_x86.py",
|
||||
|
@ -308,7 +309,6 @@ class BuildOptionParser(object):
|
|||
"x86-beta-debug": path_base + "%s_x86_beta_debug.py",
|
||||
"x86-debug": path_base + "%s_x86_debug.py",
|
||||
"x86-fuzzing-debug": path_base + "%s_x86_fuzzing_debug.py",
|
||||
"x86-profile-generate": path_base + "%s_x86_profile_generate.py",
|
||||
"x86_64": path_base + "%s_x86_64.py",
|
||||
"x86_64-beta": path_base + "%s_x86_64_beta.py",
|
||||
"x86_64-beta-debug": path_base + "%s_x86_64_beta_debug.py",
|
||||
|
@ -316,7 +316,6 @@ class BuildOptionParser(object):
|
|||
"x86_64-debug-isolated-process": path_base
|
||||
+ "%s_x86_64_debug_isolated_process.py",
|
||||
"x86_64-fuzzing-asan": path_base + "%s_x86_64_fuzzing_asan.py",
|
||||
"x86_64-profile-generate": path_base + "%s_x86_64_profile_generate.py",
|
||||
"arm-partner-sample1": path_base + "%s_arm_partner_sample1.py",
|
||||
"aarch64": path_base + "%s_aarch64.py",
|
||||
"aarch64-beta": path_base + "%s_aarch64_beta.py",
|
||||
|
|
|
@ -136,7 +136,6 @@ class AndroidMixin(object):
|
|||
except Exception:
|
||||
self.warning("failed to remove %s" % AUTH_FILE)
|
||||
|
||||
env["ANDROID_EMULATOR_HOME"] = avd_home_dir
|
||||
avd_path = os.path.join(avd_home_dir, "avd")
|
||||
if os.path.exists(avd_path):
|
||||
env["ANDROID_AVD_HOME"] = avd_path
|
||||
|
@ -150,39 +149,15 @@ class AndroidMixin(object):
|
|||
sdk_path = self.abs_dirs["abs_sdk_dir"]
|
||||
if os.path.exists(sdk_path):
|
||||
env["ANDROID_SDK_HOME"] = sdk_path
|
||||
env["ANDROID_SDK_ROOT"] = sdk_path
|
||||
self.info("Found sdk at %s" % sdk_path)
|
||||
else:
|
||||
self.warning("Android sdk missing? Not found at %s" % sdk_path)
|
||||
|
||||
avd_config_path = os.path.join(
|
||||
avd_path, "%s.ini" % self.config["emulator_avd_name"]
|
||||
)
|
||||
avd_folder = os.path.join(avd_path, "%s.avd" % self.config["emulator_avd_name"])
|
||||
if os.path.isfile(avd_config_path):
|
||||
# The ini file points to the absolute path to the emulator folder,
|
||||
# which might be different, so we need to update it.
|
||||
old_config = ""
|
||||
with open(avd_config_path, "r") as config_file:
|
||||
old_config = config_file.readlines()
|
||||
self.info("Old Config: %s" % old_config)
|
||||
with open(avd_config_path, "w") as config_file:
|
||||
for line in old_config:
|
||||
if line.startswith("path="):
|
||||
config_file.write("path=%s\n" % avd_folder)
|
||||
self.info("Updating path from: %s" % line)
|
||||
else:
|
||||
config_file.write("%s\n" % line)
|
||||
else:
|
||||
self.warning("Could not find config path at %s" % avd_config_path)
|
||||
|
||||
# enable EGL 3.0 in advancedFeatures.ini
|
||||
AF_FILE = os.path.join(avd_home_dir, "advancedFeatures.ini")
|
||||
with open(AF_FILE, "w") as f:
|
||||
if self.use_gles3:
|
||||
if self.use_gles3:
|
||||
# enable EGL 3.0 in advancedFeatures.ini
|
||||
AF_FILE = os.path.join(sdk_path, "advancedFeatures.ini")
|
||||
with open(AF_FILE, "w") as f:
|
||||
f.write("GLESDynamicVersion=on\n")
|
||||
else:
|
||||
f.write("GLESDynamicVersion=off\n")
|
||||
|
||||
# extra diagnostics for kvm acceleration
|
||||
emu = self.config.get("emulator_process_name")
|
||||
|
@ -194,10 +169,9 @@ class AndroidMixin(object):
|
|||
except Exception as e:
|
||||
self.warning("Extra kvm diagnostics failed: %s" % str(e))
|
||||
|
||||
self.info("emulator env: %s" % str(env))
|
||||
command = ["emulator", "-avd", self.config["emulator_avd_name"]]
|
||||
if "emulator_extra_args" in self.config:
|
||||
command += self.config["emulator_extra_args"]
|
||||
command += self.config["emulator_extra_args"].split()
|
||||
|
||||
dir = self.query_abs_dirs()["abs_blob_upload_dir"]
|
||||
tmp_file = tempfile.NamedTemporaryFile(
|
||||
|
@ -426,7 +400,9 @@ class AndroidMixin(object):
|
|||
import mozdevice
|
||||
|
||||
try:
|
||||
return self.device.is_device_ready(timeout=30)
|
||||
out = self.device.get_prop("sys.boot_completed", timeout=30)
|
||||
if out.strip() == "1":
|
||||
return True
|
||||
except (ValueError, mozdevice.ADBError, mozdevice.ADBTimeoutError):
|
||||
pass
|
||||
return False
|
||||
|
@ -612,10 +588,35 @@ class AndroidMixin(object):
|
|||
if not self.is_emulator:
|
||||
return
|
||||
|
||||
c = self.config
|
||||
dirs = self.query_abs_dirs()
|
||||
self.mkdir_p(dirs["abs_work_dir"])
|
||||
self.mkdir_p(dirs["abs_blob_upload_dir"])
|
||||
|
||||
# Always start with a clean AVD: AVD includes Android images
|
||||
# which can be stateful.
|
||||
self.rmtree(dirs["abs_avds_dir"])
|
||||
self.mkdir_p(dirs["abs_avds_dir"])
|
||||
if "avd_url" in c:
|
||||
# Intended for experimental setups to evaluate an avd prior to
|
||||
# tooltool deployment.
|
||||
url = c["avd_url"]
|
||||
self.download_unpack(url, dirs["abs_avds_dir"])
|
||||
else:
|
||||
url = self._get_repo_url(c["tooltool_manifest_path"])
|
||||
self._tooltool_fetch(url, dirs["abs_avds_dir"])
|
||||
|
||||
avd_home_dir = self.abs_dirs["abs_avds_dir"]
|
||||
if avd_home_dir != "/home/cltbld/.android":
|
||||
# Modify the downloaded avds to point to the right directory.
|
||||
cmd = [
|
||||
"bash",
|
||||
"-c",
|
||||
'sed -i "s|/home/cltbld/.android|%s|" %s/test-*.ini'
|
||||
% (avd_home_dir, os.path.join(avd_home_dir, "avd")),
|
||||
]
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
def start_emulator(self):
|
||||
"""
|
||||
Starts the emulator
|
||||
|
|
|
@ -103,17 +103,7 @@ class AndroidProfileRun(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
|
|||
dirs["abs_test_install_dir"] = os.path.join(abs_dirs["abs_src_dir"], "testing")
|
||||
dirs["abs_xre_dir"] = os.path.join(abs_dirs["abs_work_dir"], "hostutils")
|
||||
dirs["abs_blob_upload_dir"] = "/builds/worker/artifacts/blobber_upload_dir"
|
||||
fetches_dir = os.environ.get("MOZ_FETCHES_DIR")
|
||||
if fetches_dir:
|
||||
dirs["abs_sdk_dir"] = os.path.join(fetches_dir, "android-sdk-linux")
|
||||
dirs["abs_avds_dir"] = os.path.join(fetches_dir, "android-device")
|
||||
else:
|
||||
dirs["abs_sdk_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-sdk-linux"
|
||||
)
|
||||
dirs["abs_avds_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-device"
|
||||
)
|
||||
dirs["abs_avds_dir"] = os.path.join(abs_dirs["abs_work_dir"], ".android")
|
||||
|
||||
for key in dirs.keys():
|
||||
if key not in abs_dirs:
|
||||
|
|
|
@ -204,17 +204,14 @@ class AndroidEmulatorTest(
|
|||
dirs["abs_xpcshell_dir"] = os.path.join(
|
||||
dirs["abs_test_install_dir"], "xpcshell"
|
||||
)
|
||||
dirs["abs_avds_dir"] = os.path.join(abs_dirs["abs_work_dir"], ".android")
|
||||
fetches_dir = os.environ.get("MOZ_FETCHES_DIR")
|
||||
if fetches_dir:
|
||||
dirs["abs_sdk_dir"] = os.path.join(fetches_dir, "android-sdk-linux")
|
||||
dirs["abs_avds_dir"] = os.path.join(fetches_dir, "android-device")
|
||||
else:
|
||||
dirs["abs_sdk_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-sdk-linux"
|
||||
)
|
||||
dirs["abs_avds_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-device"
|
||||
)
|
||||
|
||||
for key in dirs.keys():
|
||||
if key not in abs_dirs:
|
||||
|
|
|
@ -78,6 +78,7 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
|
|||
if "abs_work_dir" in parent_abs_dirs:
|
||||
abs_dirs["abs_work_dir"] = parent_abs_dirs["abs_work_dir"]
|
||||
|
||||
abs_dirs["abs_avds_dir"] = os.path.join(abs_dirs["abs_work_dir"], "avds")
|
||||
abs_dirs["abs_blob_upload_dir"] = os.path.join(abs_dirs["abs_work_dir"], "logs")
|
||||
abs_dirs["abs_apk_path"] = os.environ.get(
|
||||
"WRENCH_APK", "gfx/wr/target/android-artifacts/debug/apk/wrench.apk"
|
||||
|
@ -89,14 +90,10 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
|
|||
fetches_dir = os.environ.get("MOZ_FETCHES_DIR")
|
||||
if self.is_emulator and fetches_dir:
|
||||
abs_dirs["abs_sdk_dir"] = os.path.join(fetches_dir, "android-sdk-linux")
|
||||
abs_dirs["abs_avds_dir"] = os.path.join(fetches_dir, "android-device")
|
||||
else:
|
||||
abs_dirs["abs_sdk_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-sdk-linux"
|
||||
)
|
||||
abs_dirs["abs_avds_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-device"
|
||||
)
|
||||
else:
|
||||
mozbuild_path = os.environ.get(
|
||||
"MOZBUILD_STATE_PATH", os.path.expanduser("~/.mozbuild")
|
||||
|
@ -105,10 +102,6 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
|
|||
"ANDROID_SDK_HOME", os.path.join(mozbuild_path, "android-sdk-linux")
|
||||
)
|
||||
abs_dirs["abs_sdk_dir"] = mozbuild_sdk
|
||||
avds_dir = os.environ.get(
|
||||
"ANDROID_AVD_HOME", os.path.join(mozbuild_path, "android-device")
|
||||
)
|
||||
abs_dirs["abs_avds_dir"] = avds_dir
|
||||
|
||||
self.abs_dirs = abs_dirs
|
||||
return self.abs_dirs
|
||||
|
@ -242,10 +235,8 @@ class AndroidWrench(TestingMixin, BaseScript, MozbaseMixin, AndroidMixin):
|
|||
# Running setup_avds will clobber the existing AVD and redownload it.
|
||||
# For local testing that's kinda expensive, so we omit that if we
|
||||
# already have that dir.
|
||||
avds_dir = self.query_abs_dirs()["abs_avds_dir"]
|
||||
if not os.path.exists(avds_dir):
|
||||
self.error("Unable to find android AVDs at %s" % avds_dir)
|
||||
return
|
||||
if not os.path.exists(self.query_abs_dirs()["abs_avds_dir"]):
|
||||
self.setup_avds()
|
||||
|
||||
sdk_path = self.query_abs_dirs()["abs_sdk_dir"]
|
||||
if not os.path.exists(sdk_path):
|
||||
|
|
|
@ -233,17 +233,14 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
|
|||
if self.is_android:
|
||||
dirs["abs_xre_dir"] = os.path.join(abs_dirs["abs_work_dir"], "hostutils")
|
||||
if self.is_emulator:
|
||||
dirs["abs_avds_dir"] = os.path.join(abs_dirs["abs_work_dir"], ".android")
|
||||
fetches_dir = os.environ.get("MOZ_FETCHES_DIR")
|
||||
if fetches_dir:
|
||||
dirs["abs_sdk_dir"] = os.path.join(fetches_dir, "android-sdk-linux")
|
||||
dirs["abs_avds_dir"] = os.path.join(fetches_dir, "android-device")
|
||||
else:
|
||||
dirs["abs_sdk_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-sdk-linux"
|
||||
)
|
||||
dirs["abs_avds_dir"] = os.path.join(
|
||||
abs_dirs["abs_work_dir"], "android-device"
|
||||
)
|
||||
if self.config["enable_webrender"]:
|
||||
# AndroidMixin uses this when launching the emulator. We only want
|
||||
# GLES3 if we're running WebRender
|
||||
|
|
|
@ -87,6 +87,7 @@ def install_android_packages(logger, sdk_path, no_prompt=False):
|
|||
if not os.path.exists(sdk_manager_path):
|
||||
raise OSError("Can't find sdkmanager at %s" % sdk_manager_path)
|
||||
|
||||
#TODO: Not sure what's really needed here
|
||||
packages = ["platform-tools",
|
||||
"build-tools;30.0.2",
|
||||
"platforms;android-30",
|
||||
|
@ -133,6 +134,7 @@ def install(logger, reinstall=False, no_prompt=False):
|
|||
os.environ["ANDROID_SDK_ROOT"] = dest
|
||||
|
||||
emulator = get_emulator(dest)
|
||||
emulator.update_avd()
|
||||
return emulator
|
||||
|
||||
|
||||
|
@ -146,8 +148,7 @@ def start(logger, emulator=None, reinstall=False):
|
|||
emulator = get_emulator(sdk_path)
|
||||
|
||||
if not emulator.check_avd():
|
||||
logger.critical("Android AVD not found, please run |mach bootstrap|")
|
||||
raise NotImplementedError
|
||||
emulator.update_avd()
|
||||
|
||||
emulator.start()
|
||||
emulator.wait_for_start()
|
||||
|
|
Загрузка…
Ссылка в новой задаче