Skip to content

Commit f775bea

Browse files
committed
Auto merge of #1344 - gnzlbg:fix_android_bj, r=gnzlbg
Fix Android build jobs
2 parents ecb4e97 + ea31f5a commit f775bea

File tree

23 files changed

+240
-281
lines changed

23 files changed

+240
-281
lines changed

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ matrix:
174174
stage: tier2
175175
- env: TARGET=asmjs-unknown-emscripten
176176
stage: tier2
177+
- env: TARGET=i686-linux-android
178+
stage: tier2
177179
- env: TARGET=i686-unknown-linux-musl
178180
stage: tier2
179181
- env: TARGET=mips-unknown-linux-gnu
@@ -230,9 +232,6 @@ matrix:
230232

231233

232234
allow_failures:
233-
# FIXME: android build bots time out irregularly
234-
- env: TARGET=aarch64-linux-android
235-
- env: TARGET=arm-linux-androideabi
236235
# FIXME: https://github.com/rust-lang/libc/issues/1226
237236
- env: TARGET=asmjs-unknown-emscripten
238237
- env: TARGET=wasm32-unknown-emscripten

ci/android-install-ndk.sh

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,40 @@
1111

1212
set -ex
1313

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

1718
case "$1" in
19+
arm)
20+
arch=arm
21+
api=24
22+
;;
23+
armv7)
24+
arch=arm
25+
api=24
26+
;;
1827
aarch64)
1928
arch=arm64
29+
api=24
2030
;;
21-
2231
i686)
2332
arch=x86
33+
api=28
34+
;;
35+
x86_64)
36+
arch=x86_64
37+
api=28
2438
;;
25-
2639
*)
27-
arch=$1
40+
echo "invalid arch: $1"
41+
exit 1
2842
;;
2943
esac;
3044

31-
android-ndk-r15b/build/tools/make_standalone_toolchain.py \
32-
--unified-headers \
45+
${NDK}/build/tools/make_standalone_toolchain.py \
3346
--install-dir "/android/ndk-${1}" \
3447
--arch "${arch}" \
35-
--api 24
48+
--api ${api}
3649

37-
rm -rf ./android-ndk-r15b-linux-x86_64.zip ./android-ndk-r15b
50+
rm -rf ./${NDK}-linux-x86_64.zip ./${NDK}

ci/android-install-sdk.sh

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,56 @@ set -ex
1818
# located in https://github.com/appunite/docker by just wrapping it in a script
1919
# which apparently magically accepts the licenses.
2020

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

2526
case "$1" in
2627
arm | armv7)
27-
abi=armeabi-v7a
28+
api=24
29+
image="system-images;android-${api};google_apis;armeabi-v7a"
2830
;;
29-
3031
aarch64)
31-
abi=arm64-v8a
32+
api=24
33+
image="system-images;android-${api};google_apis;arm64-v8a"
3234
;;
33-
3435
i686)
35-
abi=x86
36+
api=28
37+
image="system-images;android-${api};default;x86"
3638
;;
37-
3839
x86_64)
39-
abi=x86_64
40+
api=28
41+
image="system-images;android-${api};default;x86_64"
4042
;;
41-
4243
*)
4344
echo "invalid arch: $1"
4445
exit 1
4546
;;
4647
esac;
4748

48-
# See: https://stackoverflow.com/a/51644855/1422197
49-
export JAVA_OPTS='-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
49+
# Try to fix warning about missing file.
50+
# See https://askubuntu.com/a/1078784
51+
mkdir -p /root/.android/
52+
echo '### User Sources for Android SDK Manager' >> /root/.android/repositories.cfg
53+
echo '#Fri Nov 03 10:11:27 CET 2017 count=0' >> /root/.android/repositories.cfg
54+
55+
# Print all available packages
56+
# yes | ./sdk/tools/bin/sdkmanager --list --verbose
5057

5158
# --no_https avoids
52-
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
53-
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https
59+
# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
60+
#
61+
# | grep -v = || true removes the progress bar output from the sdkmanager
62+
# which produces an insane amount of output.
63+
yes | ./sdk/tools/bin/sdkmanager --licenses --no_https | grep -v = || true
5464
yes | ./sdk/tools/bin/sdkmanager --no_https \
5565
"emulator" \
5666
"platform-tools" \
57-
"platforms;android-24" \
58-
"system-images;android-24;default;$abi"
67+
"platforms;android-${api}" \
68+
"${image}" | grep -v = || true
5969

6070
echo "no" |
6171
./sdk/tools/bin/avdmanager create avd \
6272
--name "${1}" \
63-
--package "system-images;android-24;default;$abi"
73+
--package "${image}" | grep -v = || true

ci/docker/aarch64-linux-android/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
99
python \
1010
unzip \
1111
expect \
12-
openjdk-11-jre \
12+
openjdk-8-jre \
1313
libstdc++6:i386 \
1414
libpulse0 \
1515
gcc \

ci/docker/arm-linux-androideabi/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
99
python \
1010
unzip \
1111
expect \
12-
openjdk-11-jre \
12+
openjdk-8-jre \
1313
libstdc++6:i386 \
1414
libpulse0 \
1515
gcc \

ci/docker/i686-linux-android/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN dpkg --add-architecture i386 && \
99
python \
1010
unzip \
1111
expect \
12-
openjdk-11-jre \
12+
openjdk-8-jre \
1313
libstdc++6:i386 \
1414
libpulse0 \
1515
gcc \

0 commit comments

Comments
 (0)