Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd 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: https://android-developers.googleblog.com/2017/05/android-studio-3-0-canary1.html
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/ |
|
I get this message:
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 |
| archive = path.join(toolchains, filename) | ||
|
|
||
| if not path.isfile(archive): | ||
| download_file(filename, url, archive) |
This comment has been minimized.
This comment has been minimized.
paulrouget
Jun 28, 2018
•
Contributor
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?
This comment has been minimized.
This comment has been minimized.
| "--name", avd_name, | ||
| "--package", image, | ||
| "--force", | ||
| ]) |
This comment has been minimized.
This comment has been minimized.
paulrouget
Jun 28, 2018
Contributor
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.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jun 28, 2018
Author
Member
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" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| print("Cannot install to both emulator and USB at the same time.") | ||
| return 1 | ||
| if emulator: | ||
| exec_command += ["-e"] |
This comment has been minimized.
This comment has been minimized.
paulrouget
Jun 28, 2018
Contributor
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.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jun 28, 2018
Author
Member
Added ./mach android-emulator which just forwards arguments to the emulator script. I’ll look later into having ./mach run start it automatically.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jun 28, 2018
Author
Member
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): |
This comment has been minimized.
This comment has been minimized.
|
|
||
| [target.i686-linux-android] | ||
| linker = "./ld-i686.sh" | ||
| runner = "./run.sh" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jun 29, 2018
Author
Member
Per IRC discussion, I’ve removed all of egl-config now that it has served its purpose.
| # USB | ||
| #target="-d" | ||
|
|
||
| path="${1}" |
This comment has been minimized.
This comment has been minimized.
paulrouget
Jun 28, 2018
Contributor
Can you add a short readme in this directory to summarize what this is about.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Jun 29, 2018
Author
Member
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" | |||
This comment has been minimized.
This comment has been minimized.
paulrouget
Jun 28, 2018
Contributor
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 |
|
@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 -->
|
|
|
@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 -->
|
|
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 |
Avoid INSTALL_FAILED_INSUFFICIENT_STORAGE on install.
|
@bors-servo r=paul
I’ve filed #21116 with some findings. |
|
|
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 -->
|
|
|
@bors-servo retry #15719 |
|
|
|
|
|
@bors-servo retry #19995 |
|
|
|
|
|
@bors-servo retry #19221 |
|
|
|
|
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 -->
SimonSapin commentedJun 25, 2018
•
edited
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