Repository navigation
Add mach bootstrap-android and test-android-startup commands - #21094
Conversation
|
r? @jdm With this I can compile Servo and run it on an hardware phone and have web content show up on the screen. In the emulator however, I get a crash at startup and logcat contains This means that none of the available EGL configurations satisfy what is requested by Glutin, but there is no error message to say more about this. I wrote a stand-alone program that is cross-compiled and run remotely by I am starting the emulator with Release notes claim that the emulator gained a few versions ago support for GLES3 in Swiftshader, but "Extended controls" docs describes a configurable choice:
Unfortunately this seems to be a GUI-only config, there is no command-line equivalent documented there. I feel like I’m running out leads on the software-GL-in-emulator front. In the meantime I can run Servo on a hardware device to look at plumbing wptrunner and adb-logcat together. |
|
I recommend using @paul as a resource, since I'm going to be returning to stealth vacation mode. However, are you able to run Servo in an emulator? I certainly was able to as part of my android-x86 work (on Mac), and it worked (slowly) for ARM builds too. One important change in my setup was using the most recent system image for the AVD device, rather than one that matched the API level that we build with. |
|
No, r? @paul |
|
No luck either with |
|
Ah I see:
But |
|
Success! When starting the emulator with |
|
However this is with x86. Still no GLES3 on emulated ARM. |
|
I'll be looking at this soon. About the emulator, I never managed to get servo to work with an Arm emulator. As for x86, it works here both on Mac and linux. Also, you copy pasted a typo multiple time: s/intall/install/ |
There was a problem hiding this comment.
I get this message:
Parsing /home/Paul/git/servo/android-toolchains/sdk-tools-linux-4333796/build-tools/25.0.2/package.xmlParsing /home/Paul/git/servo/android-toolchains/sdk-tools-linux-4333796/emulator/package.xmlParsing /home/Paul/git/servo/android-toolchains/sdk-tools-linux-4333796/patcher/v4/package.xmlParsing /home/Paul/git/servo/android-toolchains/sdk-tools-linux-4333796/platform-tools/package.xmlParsing /home/Paul/git/servo/android-toolchains/sdk-tools-linux-4333796/platforms/android-25/package.xmlParsing /home/Paul/git/servo/android-toolchains/sdk-tools-linux-4333796/system-images/android-25/google_apis/armeabi-v7a/package.xmlParsing /home/Paul/git/servo/android-toolchains/sdk-tools-linux-4333796/tools/package.xmlAuto-selecting single ABI armeabi-v7a
Do you wish to create a custom hardware profile? [no]
Can we skip it somehow?
After bootstrap, the exports and the command line to start the emulator are printed. Would be great to explain what these do and what to do with it.
Also, can we make it so that we don't have to manually export them? When running mach build --android, we should check if ANDROID_NDK/SDK is set, and if not, check if android-toolchains is present?
| archive = path.join(toolchains, filename) | ||
|
|
||
| if not path.isfile(archive): | ||
| download_file(filename, url, archive) |
There was a problem hiding this comment.
If the download gets interrupted, don't we need a way to force the download? Also, in the initial commit you were checking the md5 of the file. Can't we keep that?
| "--name", avd_name, | ||
| "--package", image, | ||
| "--force", | ||
| ]) |
There was a problem hiding this comment.
If I'm not mistaken, we need hardware acceleration for GLES 3 to work. Maybe we can test emulator -accel-check here to see if things will run fine.
There was a problem hiding this comment.
For using the host GPU, I think so. But that’s likely not the config we’ll use on CI.
| api_level = "25" | ||
| sdk_build_tools = "25.0.2" | ||
| system_image = "google_apis;armeabi-v7a" | ||
| avd_name = "servo-armv7" |
There was a problem hiding this comment.
Is it worth also creating the x86 emulator?
| print("Cannot install to both emulator and USB at the same time.") | ||
| return 1 | ||
| if emulator: | ||
| exec_command += ["-e"] |
There was a problem hiding this comment.
Do we need a helper to start the emulator? We installed it. We push and run to the emulator. Maybe we should also start it somehow? Or test if it's running, and if not, check if the toolchain is present and print the command to run it.
There was a problem hiding this comment.
Added ./mach android-emulator which just forwards arguments to the emulator script. I’ll look later into having ./mach run start it automatically.
There was a problem hiding this comment.
One difficulty is that after starting the emulator and after adb wait-for-device returns (which shows that adb shell is responsive), the userland might not have finished booting yet. In particular, there is an indeterminate amount of time until the Activity Manager is running and the am start command would success. This time can be especially long for emulator ARM. (Or x86 without working CPU acceleration.)
| os.remove(src) | ||
|
|
||
|
|
||
| def check_hash(filename, expected, algorithm): |
There was a problem hiding this comment.
I don't think this is used anywhere.
|
|
||
| [target.i686-linux-android] | ||
| linker = "./ld-i686.sh" | ||
| runner = "./run.sh" |
There was a problem hiding this comment.
Per IRC discussion, I’ve removed all of egl-config now that it has served its purpose.
| # USB | ||
| #target="-d" | ||
|
|
||
| path="${1}" |
There was a problem hiding this comment.
Can you add a short readme in this directory to summarize what this is about.
There was a problem hiding this comment.
Per IRC discussion, I’ve removed all of egl-config now that it has served its purpose.
#21094 (comment) explains what this was about.
| @@ -0,0 +1,10 @@ | |||
| [build] | |||
| target = "i686-linux-android" | |||
There was a problem hiding this comment.
Why not arm by default? We usually assume armv7-linux-androideabi by default.
|
Made the custom hardware profile prompt automatic and silent (but not the license acceptance, so far). Change |
7915668 to
caf5f40
Compare
|
@bors-servo try |
Add `./mach bootstrap-android` + EGL config diagnostics This adds a `./mach boostrap-android` subcommand that downloads and installs the tools, SDK, NDK, emulator, and system image for Android. In an environment that can build Servo at all, this should be enough to get all additional dependencies to cross-compile to Android, package an APK, and load it onto a device or an emulator. At the moment it requires an interactive user to accept the license (and confirm no customization of the emulated virtual device hardware), and then prints environment variables to set for `mach` as well as the command to run to start the emulator (with an already-configured image). A possible next step could be to automate all this, and have `./mach build` run it automatically when needed. (I don’t know if auto-accepting the license is something we should do though.) This also adds `--emulator` and `--usb` parameters to `./mach install --android` and `./mach run --android`, which tell `adb` what device to pick when both are present. And makes `./mach run --android` print the new process’s PID, for use with e.g. `adb -e logcat --pid 2263`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21094) <!-- Reviewable:end -->
|
💔 Test failed - android |
390612a to
4f08d98
Compare
|
@bors-servo try |
Add `./mach bootstrap-android` + EGL config diagnostics This adds a `./mach boostrap-android` subcommand that downloads and installs the tools, SDK, NDK, emulator, and system image for Android. In an environment that can build Servo at all, this should be enough to get all additional dependencies to cross-compile to Android, package an APK, and load it onto a device or an emulator. At the moment it requires an interactive user to accept the license (and confirm no customization of the emulated virtual device hardware), and then prints environment variables to set for `mach` as well as the command to run to start the emulator (with an already-configured image). A possible next step could be to automate all this, and have `./mach build` run it automatically when needed. (I don’t know if auto-accepting the license is something we should do though.) This also adds `--emulator` and `--usb` parameters to `./mach install --android` and `./mach run --android`, which tell `adb` what device to pick when both are present. And makes `./mach run --android` print the new process’s PID, for use with e.g. `adb -e logcat --pid 2263`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21094) <!-- Reviewable:end -->
|
💔 Test failed - mac-rel-wpt4 |
On the builder ( CC @edunham, @aneeshusa |
|
@SimonSapin you said you got Servo to run in the android emulator with rust-windowing/glutin#1036. It's merged into glutin 0.17.0, but compiling Servo with that version of glutin fails: Did you cherry-pick that PR and apply it to glutin 0.13.1? |
|
@asajeffrey I first made that PR on top of 0.13.1 and tested that in Servo. I then rebased it on top of upstream/master in order to add the changelog entry. The correct fix is to update glutin to 0.17, but to get something running in the meantime try cherry-picking and using |
./mach bootstrap-android + EGL config diagnostics./mach bootstrap-android and ./mach test-android-startup
./mach bootstrap-android and ./mach test-android-startupAvoid INSTALL_FAILED_INSUFFICIENT_STORAGE on install.
5a41d8e to
c0d1b8e
Compare
|
@bors-servo r=paul
I’ve filed #21116 with some findings. |
|
📌 Commit c0d1b8e has been approved by |
Add mach bootstrap-android and test-android-startup commands This adds a `./mach boostrap-android` subcommand that downloads and installs the tools, SDK, NDK, emulator, and system image for Android. In an environment that can build Servo at all, this should be enough to get all additional dependencies to cross-compile to Android, package an APK, and load it onto a device or an emulator. At the moment it requires an interactive user to accept the license (and confirm no customization of the emulated virtual device hardware), and then prints environment variables to set for `mach` as well as the command to run to start the emulator (with an already-configured image). A possible next step could be to automate all this, and have `./mach build` run it automatically when needed. (I don’t know if auto-accepting the license is something we should do though.) This also adds `--emulator` and `--usb` parameters to `./mach install --android` and `./mach run --android`, which tell `adb` what device to pick when both are present. And makes `./mach run --android` print the new process’s PID, for use with e.g. `adb -e logcat --pid 2263`. Finally, adds the `./mach boostrap-android` subcommand which starts an emulator, installs the APK (it assumes that `mach build` and `mach package` were already executed), runs a single HTML test case, and checks for a message coming from JS through `console.log()` and `adb logcat`. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21094) <!-- Reviewable:end -->
|
💔 Test failed - mac-rel-css2 |
|
@bors-servo retry #15719 |
|
⚡ Previous build results for android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev are reusable. Rebuilding only mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2... |
|
💔 Test failed - mac-rel-css1 |
|
@bors-servo retry #19995 |
|
⚡ Previous build results for android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-wpt1, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev are reusable. Rebuilding only mac-rel-css1, mac-rel-css2, mac-rel-wpt2... |
|
💔 Test failed - mac-rel-wpt2 |
|
@bors-servo retry #19221 |
|
⚡ Previous build results for android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev are reusable. Rebuilding only mac-rel-wpt2... |
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
#21094 automates some things.
Update README for Android #21094 automates some things. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21125) <!-- Reviewable:end -->
This adds a
./mach boostrap-androidsubcommand that downloads and installs the tools, SDK, NDK, emulator, and system image for Android. In an environment that can build Servo at all, this should be enough to get all additional dependencies to cross-compile to Android, package an APK, and load it onto a device or an emulator.At the moment it requires an interactive user to accept the license (and confirm no customization of the emulated virtual device hardware), and then prints environment variables to set for
machas well as the command to run to start the emulator (with an already-configured image). A possible next step could be to automate all this, and have./mach buildrun it automatically when needed. (I don’t know if auto-accepting the license is something we should do though.)This also adds
--emulatorand--usbparameters to./mach install --androidand./mach run --android, which telladbwhat device to pick when both are present. And makes./mach run --androidprint the new process’s PID, for use with e.g.adb -e logcat --pid 2263.Finally, adds the
./mach boostrap-androidsubcommand which starts an emulator, installs the APK (it assumes thatmach buildandmach packagewere already executed), runs a single HTML test case, and checks for a message coming from JS throughconsole.log()andadb logcat.This change is