Skip to content

Update the Android build system - #13945

Merged
bors-servo merged 1 commit into
servo:masterfrom
mmatyas:android_libcpp_change
Oct 28, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
mmatyas:android_libcpp_change

Conversation

@mmatyas

@mmatyas mmatyas commented Oct 27, 2016 •

Copy link
Copy Markdown
Contributor

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 Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @wafflespeanut: python/servo/build_commands.py

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 27, 2016
@Ms2ger

Ms2ger commented Oct 27, 2016

Copy link
Copy Markdown
Contributor

r? @larsbergstrom

Comment thread components/servo/build.rs
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is darwin-x86 a relevant option? I don't see it listed below, although it is mentioned in other places.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we don't actually build for Mac 32-bit :-)

Comment thread components/servo/fake-ld.sh Outdated
touch "${TARGET_DIR}/servo"

export _ANDROID_ARCH=arch-arm
export ANDROID_SYSROOT="$ANDROID_NDK/platforms/android-18/$_ANDROID_ARCH"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the full "${ANDROID_NDK}/platforms ... quoting style per the style guide

Comment thread components/servo/fake-ld.sh Outdated
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit: use a ; do at the end of this line instead of putting it on the next line

Comment thread python/servo/build_commands.py Outdated
os_type = platform.system().lower()
cpu_type = platform.machine().lower()
if os_type == "linux":
if cpu_type in ["i386", "i486", "i686", "i768", "x86"]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread components/servo/fake-ld.sh Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread python/servo/build_commands.py Outdated
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']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']

@mmatyas

mmatyas commented Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

Ok, here's an update. I've added quotes in fake-ld.sh, though mach test-tidy still throws warnings; I wonder if that's a bug or did I miss something? I've also changed the indentation of the paths and C/CXXFLAGS' inbuild_commands.py`, tell me what do you think.

@larsbergstrom

Copy link
Copy Markdown
Contributor
./components/servo/fake-ld.sh:18: Line is longer than 80 characters

./components/servo/fake-ld.sh:19: Line is longer than 80 characters

./components/servo/fake-ld.sh:25: Line is longer than 80 characters

./components/servo/fake-ld.sh:32: Line is longer than 80 characters

./components/servo/fake-ld.sh:18: variable substitutions should use the full "${VAR}" form

./components/servo/fake-ld.sh:19: variable substitutions should use the full "${VAR}" form

./components/servo/fake-ld.sh:32: variable substitutions should use the full "${VAR}" form

./python/servo/build_commands.py:251: Line is longer than 120 characters

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...

bors-servo pushed a commit that referenced this pull request Oct 28, 2016
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 -->
@mmatyas

mmatyas commented Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

I just noticed I've forgot to put $host between {}.

Comment thread components/servo/fake-ld.sh Outdated
echo "sysroot: ${ANDROID_SYSROOT}"

"${ANDROID_TOOLCHAIN}/arm-linux-androideabi-gcc" \
--sysroot="${ANDROID_SYSROOT}" -L "${ANDROID_CXX_LIBS}" $@ ${LDFLAGS:-} -lc++ \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tidy is looking for "${@}" to be quoted.

Also, can you see if $LDFLAGS is required? See #12562.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah my bad, I've forget the {}s, tidy does acccept it now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this script is only for Android, so in that case I'm comfortable removing LDFLAGS.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I might start to get sleepy, to start talking about other targets for fake-ld... It's safe to remove then.

@mmatyas

mmatyas commented Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

As for the last "${VAR}" warning, I think that's for the LDFLAGS, but that's probably fine.

bors-servo pushed a commit that referenced this pull request Oct 28, 2016
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 -->
@mmatyas
mmatyas force-pushed the android_libcpp_change branch from 1131d68 to 889416e Compare October 28, 2016 19:46
@mmatyas

mmatyas commented Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

I've double checked just in case, but yes, LDFLAGS is unbound, so I've removed it now. I've also merged my fixups into one commit.

@mmatyas
mmatyas force-pushed the android_libcpp_change branch from 889416e to 743d432 Compare October 28, 2016 20:04
@mmatyas
mmatyas force-pushed the android_libcpp_change branch from 743d432 to 5bb550d Compare October 28, 2016 20:17
@mmatyas

mmatyas commented Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

I've fixed the tidy errors: I've removed the unnecessary bits from the URL in build_commands.py, and added fake-ld.sh to the ignore list, as discussed on IRC.

@larsbergstrom

Copy link
Copy Markdown
Contributor

@bors-servo r=larsbergstrom,aneeshusa

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 5bb550d has been approved by larsbergstrom,aneeshusa

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Oct 28, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 5bb550d with merge b933015...

bors-servo pushed a commit that referenced this pull request Oct 28, 2016
…,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 -->
@bors-servo

Copy link
Copy Markdown
Contributor

@bors-servo
bors-servo merged commit 5bb550d into servo:master Oct 28, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 28, 2016
@mmatyas
mmatyas deleted the android_libcpp_change branch November 14, 2016 11:12
@mmatyas
mmatyas restored the android_libcpp_change branch November 14, 2016 11:12
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 4, 2017
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants