Skip to content

Fix Android build jobs #1344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
eb0794a
Update Android SDK, NDK (r19c), and API versions (arm:24,x86:28)
gnzlbg May 16, 2019
e42b1ed
Update FILENAME_MAX, L_tmpnam, MS_*, SYS_ and NFT* Android constants
gnzlbg May 16, 2019
a59ea44
[breaking change] __sched_cpucount changed pointer mutability on x86_…
gnzlbg May 16, 2019
841b3eb
[breaking change] sigaction.sa_flags changed signedness on x86_64-and…
gnzlbg May 16, 2019
91ea0b2
[breaking change] sigaction.sa_flags changed from c_ulong to c_int on…
gnzlbg May 16, 2019
eea0102
Enable more tests on Android
gnzlbg May 22, 2019
4774fc1
Deprecate ENOATTR on Linux and Android
gnzlbg May 22, 2019
003c04d
[breaking change] fix types of stat/stat64 structs, atime/mtime/ctime…
gnzlbg May 22, 2019
61c9de8
[breaking change] pthread_key_t is signed on Android
gnzlbg May 22, 2019
8b02725
[breaking change] madvise takes a mut pointer on Android
gnzlbg May 23, 2019
5016f87
[breaking change] msync takes a mut pointer on Android
gnzlbg May 23, 2019
918d371
[breaking change] mprotect takes a mut pointer on Android
gnzlbg May 23, 2019
ebe64f1
[breaking change] recvfrom takes a mut pointer on Android
gnzlbg May 23, 2019
7d5e632
[breaking change] set/getpriority who argument is of type id_t on And…
gnzlbg May 23, 2019
46c60fb
[breaking change] personality takes a c_uint instead of c_ulong on An…
gnzlbg May 23, 2019
d527325
Test strerror_r on Android and Linux
gnzlbg May 23, 2019
8c70f49
Enable more tests (some related to issue 1272) on Android
gnzlbg May 23, 2019
30c853f
[breaking change] remove __progname
gnzlbg May 23, 2019
1c5a36c
[breaking change] remove getdtablesize - removed in Android API 21
gnzlbg May 23, 2019
3efe23b
Enable more tests on Android
gnzlbg May 23, 2019
7f8b946
Document what is wrong with sighandler_t
gnzlbg May 23, 2019
c376231
Add i686-linux-android build job
gnzlbg May 16, 2019
cc13d75
Fix Android build jobs: not allowed to fail anymore
gnzlbg May 23, 2019
ccad8b4
Fix musl build jobs
gnzlbg May 23, 2019
ea31f5a
Increase retries of Android downloads
gnzlbg May 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ matrix:
stage: tier2
- env: TARGET=asmjs-unknown-emscripten
stage: tier2
- env: TARGET=i686-linux-android
stage: tier2
- env: TARGET=i686-unknown-linux-musl
stage: tier2
- env: TARGET=mips-unknown-linux-gnu
Expand Down Expand Up @@ -230,9 +232,6 @@ matrix:


allow_failures:
# FIXME: android build bots time out irregularly
- env: TARGET=aarch64-linux-android
- env: TARGET=arm-linux-androideabi
# FIXME: https://github.com/rust-lang/libc/issues/1226
- env: TARGET=asmjs-unknown-emscripten
- env: TARGET=wasm32-unknown-emscripten
Expand Down
31 changes: 22 additions & 9 deletions ci/android-install-ndk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,40 @@

set -ex

curl --retry 10 -O https://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip
unzip -q android-ndk-r15b-linux-x86_64.zip
NDK=android-ndk-r19c
curl --retry 20 -O https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
unzip -q ${NDK}-linux-x86_64.zip

case "$1" in
arm)
arch=arm
api=24
;;
armv7)
arch=arm
api=24
;;
aarch64)
arch=arm64
api=24
;;

i686)
arch=x86
api=28
;;
x86_64)
arch=x86_64
api=28
;;

*)
arch=$1
echo "invalid arch: $1"
exit 1
;;
esac;

android-ndk-r15b/build/tools/make_standalone_toolchain.py \
--unified-headers \
${NDK}/build/tools/make_standalone_toolchain.py \
--install-dir "/android/ndk-${1}" \
--arch "${arch}" \
--api 24
--api ${api}

rm -rf ./android-ndk-r15b-linux-x86_64.zip ./android-ndk-r15b
rm -rf ./${NDK}-linux-x86_64.zip ./${NDK}
44 changes: 27 additions & 17 deletions ci/android-install-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,56 @@ set -ex
# located in https://github.com/appunite/docker by just wrapping it in a script
# which apparently magically accepts the licenses.

SDK=4333796
mkdir sdk
curl --retry 10 https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O
unzip -d sdk sdk-tools-linux-3859397.zip
curl --retry 20 https://dl.google.com/android/repository/sdk-tools-linux-${SDK}.zip -O
unzip -q -d sdk sdk-tools-linux-${SDK}.zip

case "$1" in
arm | armv7)
abi=armeabi-v7a
api=24
image="system-images;android-${api};google_apis;armeabi-v7a"
;;

aarch64)
abi=arm64-v8a
api=24
image="system-images;android-${api};google_apis;arm64-v8a"
;;

i686)
abi=x86
api=28
image="system-images;android-${api};default;x86"
;;

x86_64)
abi=x86_64
api=28
image="system-images;android-${api};default;x86_64"
;;

*)
echo "invalid arch: $1"
exit 1
;;
esac;

# See: https://stackoverflow.com/a/51644855/1422197
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
# Try to fix warning about missing file.
# See https://askubuntu.com/a/1078784
mkdir -p /root/.android/
echo '### User Sources for Android SDK Manager' >> /root/.android/repositories.cfg
echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg

# Print all available packages
# yes | ./sdk/tools/bin/sdkmanager --list --verbose

# --no_https avoids
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
#
# | grep -v = || true removes the progress bar output from the sdkmanager
# which produces an insane amount of output.
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
yes | ./sdk/tools/bin/sdkmanager --no_https \
"emulator" \
"platform-tools" \
"platforms;android-24" \
"system-images;android-24;default;$abi"
"platforms;android-${api}" \
"${image}" | grep -v = || true

echo "no" |
./sdk/tools/bin/avdmanager create avd \
--name "${1}" \
--package "system-images;android-24;default;$abi"
--package "${image}" | grep -v = || true
2 changes: 1 addition & 1 deletion ci/docker/aarch64-linux-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \
unzip \
expect \
openjdk-11-jre \
openjdk-8-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/arm-linux-androideabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \
unzip \
expect \
openjdk-11-jre \
openjdk-8-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/i686-linux-android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
python \
unzip \
expect \
openjdk-11-jre \
openjdk-8-jre \
libstdc++6:i386 \
libpulse0 \
gcc \
Expand Down
Loading