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 upNew Android suppport #8288
New Android suppport #8288
Conversation
|
Review status: 0 of 24 files reviewed at latest revision, 3 unresolved discussions. .gitmodules, line 3 [r1] (raw file): components/servo/build.rs, line 11 [r1] (raw file): support/android/build-apk/Cargo.toml, line 15 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 0 of 24 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. components/servo/build.rs, line 11 [r1] (raw file): support/android/build-apk/Cargo.toml, line 15 [r1] (raw file): Comments from the review on Reviewable.io |
|
@eefriedman re "Did you mean to delete this file?" Yup, I'm remove the last git submodule in our tree - woo-hoo! |
|
Err, I meant "Did you mean to delete this file, as opposed to leaving it in the tree as a zero-byte file". |
|
Aha, then yes, I'll delete it - that was the intent :-) |
|
From tidy: |
|
BTW, definitely don't merge this; there's a small linker problem on Android release-only where it's stripping some of the critical public symbols (e.g., |
| // build.rs is not platform-specific, so we have to check the target here. | ||
| let target = env::var("TARGET").unwrap(); | ||
| if !target.contains("android") { | ||
| return; |
This comment has been minimized.
This comment has been minimized.
|
(This looks fine in terms of style, but I don't know enough about how building for Android works to review this properly.) |
|
Reviewed 17 of 24 files at r1. python/servo/post_build_commands.py, line 185 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 13 of 25 files reviewed at latest revision, 5 unresolved discussions. python/servo/post_build_commands.py, line 185 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 13 of 25 files reviewed at latest revision, 5 unresolved discussions. components/servo/build.rs, line 14 [r3] (raw file): Comments from the review on Reviewable.io |
|
Review status: 13 of 25 files reviewed at latest revision, 5 unresolved discussions. .gitmodules, line 3 [r1] (raw file): Comments from the review on Reviewable.io |
|
Reviewed 6 of 24 files at r1. python/servo/post_build_commands.py, line 185 [r1] (raw file):
Yes, that sounds good. support/android/apk/src/rust/glutin/MainActivity.java, line 1 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 18 of 25 files reviewed at latest revision, 6 unresolved discussions. support/android/apk/src/rust/glutin/MainActivity.java, line 1 [r1] (raw file): Comments from the review on Reviewable.io |
|
@mbrubeck OK, set to go (modulo having to open a bunch of E-Easy issues ) |
|
Reviewed 1 of 25 files at r1, 5 of 5 files at r2, 1 of 1 files at r3, 2 of 2 files at r4, 3 of 3 files at r5. support/android/build-apk/src/main.rs, line 99 [r1] (raw file): Comments from the review on Reviewable.io |
|
r=mbrubeck, needs squash |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions. support/android/build-apk/src/main.rs, line 99 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, 5 unresolved discussions. support/android/build-apk/src/main.rs, line 99 [r1] (raw file): Comments from the review on Reviewable.io |
11f806c
to
17a6cb5
|
@bors-servo r=mbrubeck |
|
|
New Android suppport r/f? @mbrubeck No need to r+ urgently; I want to do a little bit more testing of the release build, but I'm hoping to land this bit (moving to a more sane build process) next week. The new version of building an APK: 1) Removes the glutin-based APK builder from the link step 2) Adds a build.rs step to the build of the final Servo library that adds the native code required by glutin's android_rs_glue (e.g., `ANativeActivity_onCreate` definition) 3) Replaces the link step with a `fake-ld.sh` script that instead creates a libservo.so 4) Adds a new mach `package` step to build the APK that has some Rust code that builds the library from a set of in-tree build files This setup fixes a number of problems: 1) We can use gdb, because we use `ndk-build`, which adds the .gdbserver info, plus we keep around all of the build files (also required by the ndk gdb) 2) We can add more Java code & hooks to handle Android intents 3) We no longer have any git submodules or the awkward two-step build with android-rs-glue Many other setups were tried (and failed). The most obvious ones is building a libservo.so from a `dylib` target from the servo build on Android. This doesn't work because you can't have a different default lib target on one platform than others in Cargo, and you also can't pass it in from the commandline (e.g., --lib does not have a dylib arg). Additionally, if you don't go through the intermediate libservo.rlib step (which removes unused symbols), then you end up with a TON of missing symbols because our -sys crates are super sloppy about that. I spent a few weeks beginning to clean them up, but since it's something we can't easily enforce (and new -sys packages will have this problem, too, since it's only an issue with the Android loader), it made more sense to me to just have the build set up to discard those unused bits of code before they ever get to the linker, much less the loader. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8288) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
New Android suppport r/f? @mbrubeck No need to r+ urgently; I want to do a little bit more testing of the release build, but I'm hoping to land this bit (moving to a more sane build process) next week. The new version of building an APK: 1) Removes the glutin-based APK builder from the link step 2) Adds a build.rs step to the build of the final Servo library that adds the native code required by glutin's android_rs_glue (e.g., `ANativeActivity_onCreate` definition) 3) Replaces the link step with a `fake-ld.sh` script that instead creates a libservo.so 4) Adds a new mach `package` step to build the APK that has some Rust code that builds the library from a set of in-tree build files This setup fixes a number of problems: 1) We can use gdb, because we use `ndk-build`, which adds the .gdbserver info, plus we keep around all of the build files (also required by the ndk gdb) 2) We can add more Java code & hooks to handle Android intents 3) We no longer have any git submodules or the awkward two-step build with android-rs-glue Many other setups were tried (and failed). The most obvious ones is building a libservo.so from a `dylib` target from the servo build on Android. This doesn't work because you can't have a different default lib target on one platform than others in Cargo, and you also can't pass it in from the commandline (e.g., --lib does not have a dylib arg). Additionally, if you don't go through the intermediate libservo.rlib step (which removes unused symbols), then you end up with a TON of missing symbols because our -sys crates are super sloppy about that. I spent a few weeks beginning to clean them up, but since it's something we can't easily enforce (and new -sys packages will have this problem, too, since it's only an issue with the Android loader), it made more sense to me to just have the build set up to discard those unused bits of code before they ever get to the linker, much less the loader. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8288) <!-- Reviewable:end -->
|
|
Add the new packaging step to the nightly builder This should wait for servo/servo#8288 to land; I'll ping the review then. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/154) <!-- Reviewable:end -->
Added in servo#8288 for Android support, but should be unnecessary in current Rust (which uses `alloc_jemalloc` by default on Android and Linux).
larsbergstrom commentedOct 31, 2015
r/f? @mbrubeck
No need to r+ urgently; I want to do a little bit more testing of the release build, but I'm hoping to land this bit (moving to a more sane build process) next week.
The new version of building an APK:
ANativeActivity_onCreatedefinition)fake-ld.shscript that instead creates a libservo.sopackagestep to build the APK that has some Rust code that builds the library from a set of in-tree build filesThis setup fixes a number of problems:
ndk-build, which adds the .gdbserver info, plus we keep around all of the build files (also required by the ndk gdb)Many other setups were tried (and failed). The most obvious ones is building a libservo.so from a
dylibtarget from the servo build on Android. This doesn't work because you can't have a different default lib target on one platform than others in Cargo, and you also can't pass it in from the commandline (e.g., --lib does not have a dylib arg). Additionally, if you don't go through the intermediate libservo.rlib step (which removes unused symbols), then you end up with a TON of missing symbols because our -sys crates are super sloppy about that. I spent a few weeks beginning to clean them up, but since it's something we can't easily enforce (and new -sys packages will have this problem, too, since it's only an issue with the Android loader), it made more sense to me to just have the build set up to discard those unused bits of code before they ever get to the linker, much less the loader.