Repository navigation
Update the Android build system - #13945
Conversation
|
Heads up! This PR modifies the following files:
|
| let standalone_path = env::var("NDK_STANDALONE").ok().expect("Please set the NDK_STANDALONE environment variable"); | ||
| let standalone_path = Path::new(&standalone_path); | ||
| // Build up the path to the NDK compilers | ||
| // Options for host are: "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86" |
There was a problem hiding this comment.
Is darwin-x86 a relevant option? I don't see it listed below, although it is mentioned in other places.
There was a problem hiding this comment.
I guess we don't actually build for Mac 32-bit :-)
| touch "${TARGET_DIR}/servo" | ||
|
|
||
| export _ANDROID_ARCH=arch-arm | ||
| export ANDROID_SYSROOT="$ANDROID_NDK/platforms/android-18/$_ANDROID_ARCH" |
There was a problem hiding this comment.
Please use the full "${ANDROID_NDK}/platforms ... quoting style per the style guide
| export ANDROID_SYSROOT="$ANDROID_NDK/platforms/android-18/$_ANDROID_ARCH" | ||
| export _ANDROID_EABI=arm-linux-androideabi-4.9 | ||
| ANDROID_TOOLCHAIN="" | ||
| for host in "linux-x86_64" "linux-x86" "darwin-x86_64" "darwin-x86" |
There was a problem hiding this comment.
style nit: use a ; do at the end of this line instead of putting it on the next line
| os_type = platform.system().lower() | ||
| cpu_type = platform.machine().lower() | ||
| if os_type == "linux": | ||
| if cpu_type in ["i386", "i486", "i686", "i768", "x86"]: |
There was a problem hiding this comment.
You only need to have this block once to find the host suffix (e.g. x86_64), and then can append it to os_type + '-' directly.
| ANDROID_CXX_LIBS=$ANDROID_NDK/sources/cxx-stl/llvm-libc++/libs/$ANDROID_CPU_ARCH_DIR | ||
| echo libs dir: $ANDROID_CXX_LIBS | ||
|
|
||
| echo sysroot: $ANDROID_SYSROOT |
There was a problem hiding this comment.
style nit: The echo calls looks like they're left over from debugging but may still be useful; if you keep them please quote the whole argument to echo.
| else: | ||
| raise Exception("Android cross builds are only supported on Linux and macOS.") | ||
| env['PATH'] = path.join(env['ANDROID_NDK'], "toolchains", "arm-linux-androideabi-4.9", | ||
| "prebuilt", host, "bin") + ':' + env['PATH'] |
There was a problem hiding this comment.
style/indentation nit: I've always found this style more readable than trying to line up the next line with the first, which always ends up changing and drifting and causes diff line noise.
env['PATH'] = path.join(
env['ANDROID_NDK'], "toolchains", "arm-linux-androideabi-4.9", "prebuilt", host, "bin"
) + ':' + env['PATH']
|
Ok, here's an update. I've added quotes in |
Other than the errors from tidy, this looks good. The line length ones seem legit, but I'm not sure what's going on with the substitution errors... |
Update `etc/ci/check_dynamic_symbols.py` Update `etc/ci/check_dynamic_symbols.py` to work after [the latest changes](#13945) in the Android build system. Part of #13154. <!-- 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/13946) <!-- Reviewable:end -->
|
I just noticed I've forgot to put |
| echo "sysroot: ${ANDROID_SYSROOT}" | ||
|
|
||
| "${ANDROID_TOOLCHAIN}/arm-linux-androideabi-gcc" \ | ||
| --sysroot="${ANDROID_SYSROOT}" -L "${ANDROID_CXX_LIBS}" $@ ${LDFLAGS:-} -lc++ \ |
There was a problem hiding this comment.
I think tidy is looking for "${@}" to be quoted.
Also, can you see if $LDFLAGS is required? See #12562.
There was a problem hiding this comment.
Interesting, not even
--sysroot="${ANDROID_SYSROOT}" -L "${ANDROID_CXX_LIBS}" "$@" "${LDFLAGS:-}" -lc++ \
pleases the tidy check!
As for LDFLAGS, it's empty on Android, but I'm not sure about other targets.
There was a problem hiding this comment.
Ah my bad, I've forget the {}s, tidy does acccept it now.
There was a problem hiding this comment.
I'm pretty sure this script is only for Android, so in that case I'm comfortable removing LDFLAGS.
There was a problem hiding this comment.
Ok, I might start to get sleepy, to start talking about other targets for fake-ld... It's safe to remove then.
|
As for the last |
Update `etc/ci/check_dynamic_symbols.py` Update `etc/ci/check_dynamic_symbols.py` to work after [the latest changes](#13945) in the Android build system. Part of #13154. <!-- 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/13946) <!-- Reviewable:end -->
1131d68 to
889416e
Compare
|
I've double checked just in case, but yes, |
889416e to
743d432
Compare
743d432 to
5bb550d
Compare
|
I've fixed the tidy errors: I've removed the unnecessary bits from the URL in |
|
@bors-servo r=larsbergstrom,aneeshusa |
|
📌 Commit 5bb550d has been approved by |
…,aneeshusa Update the Android build system A huge update for the Android build system, which makes the Android target build again. There are still some runtime issues, see #13154. CC & created by @larsbergstrom. Fixes #12562. <!-- 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/13945) <!-- Reviewable:end -->
|
☀️ Test successful - arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-dev |
…mmatyas:android_dyncheck); r=larsbergstrom Update `etc/ci/check_dynamic_symbols.py` to work after [the latest changes](servo/servo#13945) in the Android build system. Part of #13154. Source-Repo: https://github.com/servo/servo Source-Revision: b661f0691611c8c568840b75ac646af960aa683d
…mmatyas:android_dyncheck); r=larsbergstrom Update `etc/ci/check_dynamic_symbols.py` to work after [the latest changes](servo/servo#13945) in the Android build system. Part of #13154. Source-Repo: https://github.com/servo/servo Source-Revision: b661f0691611c8c568840b75ac646af960aa683d UltraBlame original commit: 757a8ecaa3c845cab0707dae7ce8266f12181fd3
…mmatyas:android_dyncheck); r=larsbergstrom Update `etc/ci/check_dynamic_symbols.py` to work after [the latest changes](servo/servo#13945) in the Android build system. Part of #13154. Source-Repo: https://github.com/servo/servo Source-Revision: b661f0691611c8c568840b75ac646af960aa683d UltraBlame original commit: 757a8ecaa3c845cab0707dae7ce8266f12181fd3
…mmatyas:android_dyncheck); r=larsbergstrom Update `etc/ci/check_dynamic_symbols.py` to work after [the latest changes](servo/servo#13945) in the Android build system. Part of #13154. Source-Repo: https://github.com/servo/servo Source-Revision: b661f0691611c8c568840b75ac646af960aa683d UltraBlame original commit: 757a8ecaa3c845cab0707dae7ce8266f12181fd3
A huge update for the Android build system, which makes the Android target build again.
There are still some runtime issues, see #13154. CC & created by @larsbergstrom.
Fixes #12562.
This change is