From a9115d5e4b073d2a22ca380e62c2c49dd59ed7d2 Mon Sep 17 00:00:00 2001 From: Marco A L Barbosa Date: Fri, 27 Oct 2017 16:46:32 -0200 Subject: [PATCH 1/2] Fix android ci --- ci/android-accept-licenses.sh | 15 ------------- ci/android-install-sdk.sh | 25 ++++++++++++---------- ci/docker/aarch64-linux-android/Dockerfile | 4 ++-- ci/docker/arm-linux-androideabi/Dockerfile | 4 ++-- ci/docker/i686-linux-android/Dockerfile | 4 ++-- 5 files changed, 20 insertions(+), 32 deletions(-) delete mode 100755 ci/android-accept-licenses.sh diff --git a/ci/android-accept-licenses.sh b/ci/android-accept-licenses.sh deleted file mode 100755 index 8d8f60a5..00000000 --- a/ci/android-accept-licenses.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/expect -f -# ignore-license - -set timeout 1800 -set cmd [lindex $argv 0] -set licenses [lindex $argv 1] - -spawn {*}$cmd -expect { - "Do you accept the license '*'*" { - exp_send "y\r" - exp_continue - } - eof -} diff --git a/ci/android-install-sdk.sh b/ci/android-install-sdk.sh index 7e6147cc..ab7e14d9 100644 --- a/ci/android-install-sdk.sh +++ b/ci/android-install-sdk.sh @@ -19,10 +19,8 @@ set -ex # which apparently magically accepts the licenses. mkdir sdk -curl https://dl.google.com/android/repository/tools_r25.2.5-linux.zip -O -unzip -d sdk tools_r25.2.5-linux.zip - -filter="platform-tools,android-24" +curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip -O +unzip -d sdk sdk-tools-linux-3859397.zip case "$1" in arm | armv7) @@ -47,11 +45,16 @@ case "$1" in ;; esac; -filter="$filter,sys-img-$abi-android-24" +# --no_https avoids +# javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found +echo "yes" | \ + ./sdk/tools/bin/sdkmanager --no_https \ + "emulator" \ + "platform-tools" \ + "platforms;android-24" \ + "system-images;android-24;default;$abi" -./android-accept-licenses.sh "android - update sdk -a --no-ui --filter $filter --no-https" - -echo "no" | android create avd \ - --name $1 \ - --target android-24 \ - --abi $abi +echo "no" | + ./sdk/tools/bin/avdmanager create avd \ + --name $1 \ + --package "system-images;android-24;default;$abi" diff --git a/ci/docker/aarch64-linux-android/Dockerfile b/ci/docker/aarch64-linux-android/Dockerfile index 345540a3..5fc83aad 100644 --- a/ci/docker/aarch64-linux-android/Dockerfile +++ b/ci/docker/aarch64-linux-android/Dockerfile @@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH RUN sh /android/android-install-sdk.sh $ANDROID_ARCH RUN mv /root/.android /tmp RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* +RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* ENV PATH=$PATH:/rust/bin \ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \ @@ -38,7 +38,7 @@ ENTRYPOINT [ \ "-c", \ # set SHELL so android can detect a 64bits system, see # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash emulator @aarch64 -no-window & \ + "SHELL=/bin/dash /android/sdk/emulator/emulator @aarch64 -no-window & \ rustc /tmp/runtest.rs -o /tmp/runtest && \ exec \"$@\"", \ "--" \ diff --git a/ci/docker/arm-linux-androideabi/Dockerfile b/ci/docker/arm-linux-androideabi/Dockerfile index 554f0787..a3fc64bf 100644 --- a/ci/docker/arm-linux-androideabi/Dockerfile +++ b/ci/docker/arm-linux-androideabi/Dockerfile @@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH RUN sh /android/android-install-sdk.sh $ANDROID_ARCH RUN mv /root/.android /tmp RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* +RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* ENV PATH=$PATH:/rust/bin \ CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \ @@ -38,7 +38,7 @@ ENTRYPOINT [ \ "-c", \ # set SHELL so android can detect a 64bits system, see # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash emulator @arm -no-window & \ + "SHELL=/bin/dash /android/sdk/emulator/emulator @arm -no-window & \ rustc /tmp/runtest.rs -o /tmp/runtest && \ exec \"$@\"", \ "--" \ diff --git a/ci/docker/i686-linux-android/Dockerfile b/ci/docker/i686-linux-android/Dockerfile index 7671f78b..f0836c38 100644 --- a/ci/docker/i686-linux-android/Dockerfile +++ b/ci/docker/i686-linux-android/Dockerfile @@ -25,7 +25,7 @@ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH RUN sh /android/android-install-sdk.sh $ANDROID_ARCH RUN mv /root/.android /tmp RUN chmod 777 -R /tmp/.android -RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/* +RUN chmod 755 /android/sdk/tools/* /android/sdk/emulator/qemu/linux-x86_64/* ENV PATH=$PATH:/rust/bin \ CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \ @@ -38,7 +38,7 @@ ENTRYPOINT [ \ "-c", \ # set SHELL so android can detect a 64bits system, see # http://stackoverflow.com/a/41789144 - "SHELL=/bin/dash emulator @i686 -no-window -no-accel & \ + "SHELL=/bin/dash /android/sdk/emulator/emulator @i686 -no-window -no-accel & \ rustc /tmp/runtest.rs -o /tmp/runtest && \ exec \"$@\"", \ "--" \ From 8617317c89cbc5d9009167eb967e2471beb97d2a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 27 Oct 2017 18:31:05 -0700 Subject: [PATCH 2/2] Disable i686-linux-android temporarily --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e3c30b08..853bd0ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,8 @@ matrix: osx_image: xcode8.3 - env: TARGET=arm-linux-androideabi - env: TARGET=aarch64-linux-android - - env: TARGET=i686-linux-android + # FIXME(#826) should reenable + #- env: TARGET=i686-linux-android - env: TARGET=x86_64-linux-android - env: TARGET=x86_64-unknown-linux-musl - env: TARGET=i686-unknown-linux-musl