diff --git a/.travis.yml b/.travis.yml index ea405413e78f4..88bd901e6b33d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,10 @@ matrix: fast_finish: true include: # Linux builders, all docker images - - env: IMAGE=android DEPLOY=1 + - env: IMAGE=arm-android - env: IMAGE=cross DEPLOY=1 - env: IMAGE=linux-tested-targets DEPLOY=1 + - env: IMAGE=dist-android DEPLOY=1 - env: IMAGE=dist-arm-linux DEPLOY=1 - env: IMAGE=dist-armv7-aarch64-linux DEPLOY=1 - env: IMAGE=dist-freebsd DEPLOY=1 diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 8e79c2d27d195..bc439d6f7826d 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -198,10 +198,6 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake "); } } - - if target.contains("arm-linux-android") { - need_cmd("adb".as_ref()); - } } for host in build.flags.host.iter() { diff --git a/src/ci/docker/arm-android/Dockerfile b/src/ci/docker/arm-android/Dockerfile new file mode 100644 index 0000000000000..4c89ce12531b4 --- /dev/null +++ b/src/ci/docker/arm-android/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:16.04 + +RUN dpkg --add-architecture i386 && \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + g++ \ + make \ + file \ + curl \ + ca-certificates \ + python2.7 \ + git \ + cmake \ + unzip \ + expect \ + openjdk-9-jre \ + sudo \ + libstdc++6:i386 \ + xz-utils \ + libssl-dev \ + pkg-config + +WORKDIR /android/ +ENV PATH=$PATH:/android/ndk-arm-9/bin:/android/sdk/tools:/android/sdk/platform-tools + +COPY install-ndk.sh install-sdk.sh accept-licenses.sh /android/ +RUN sh /android/install-ndk.sh +RUN sh /android/install-sdk.sh + +RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ + dpkg -i dumb-init_*.deb && \ + rm dumb-init_*.deb + +COPY start-emulator.sh /android/ + +ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"] + +RUN curl -o /usr/local/bin/sccache \ + https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/2017-02-24-sccache-x86_64-unknown-linux-gnu && \ + chmod +x /usr/local/bin/sccache + +ENV RUST_CONFIGURE_ARGS \ + --target=arm-linux-androideabi \ + --arm-linux-androideabi-ndk=/android/ndk-arm-9 + +ENV SCRIPT python2.7 ../x.py test --target arm-linux-androideabi diff --git a/src/ci/docker/android/accept-licenses.sh b/src/ci/docker/arm-android/accept-licenses.sh similarity index 100% rename from src/ci/docker/android/accept-licenses.sh rename to src/ci/docker/arm-android/accept-licenses.sh diff --git a/src/ci/docker/arm-android/install-ndk.sh b/src/ci/docker/arm-android/install-ndk.sh new file mode 100644 index 0000000000000..389ec062110e0 --- /dev/null +++ b/src/ci/docker/arm-android/install-ndk.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# Copyright 2016 The Rust Project Developers. See the COPYRIGHT +# file at the top-level directory of this distribution and at +# http://rust-lang.org/COPYRIGHT. +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +set -ex + +cpgdb() { + cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb /android/$1/bin/$2-gdb + cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb-orig /android/$1/bin/gdb-orig + cp -r android-ndk-r11c/prebuilt/linux-x86_64/share /android/$1/share +} + +# Prep the Android NDK +# +# See https://github.com/servo/servo/wiki/Building-for-Android +curl -O https://dl.google.com/android/repository/android-ndk-r11c-linux-x86_64.zip +unzip -q android-ndk-r11c-linux-x86_64.zip +bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \ + --platform=android-9 \ + --toolchain=arm-linux-androideabi-4.9 \ + --install-dir=/android/ndk-arm-9 \ + --ndk-dir=/android/android-ndk-r11c \ + --arch=arm +cpgdb ndk-arm-9 arm-linux-androideabi + +rm -rf ./android-ndk-r11c-linux-x86_64.zip ./android-ndk-r11c diff --git a/src/ci/docker/android/install-sdk.sh b/src/ci/docker/arm-android/install-sdk.sh similarity index 100% rename from src/ci/docker/android/install-sdk.sh rename to src/ci/docker/arm-android/install-sdk.sh diff --git a/src/ci/docker/android/start-emulator.sh b/src/ci/docker/arm-android/start-emulator.sh similarity index 100% rename from src/ci/docker/android/start-emulator.sh rename to src/ci/docker/arm-android/start-emulator.sh diff --git a/src/ci/docker/android/Dockerfile b/src/ci/docker/dist-android/Dockerfile similarity index 75% rename from src/ci/docker/android/Dockerfile rename to src/ci/docker/dist-android/Dockerfile index e3748af501fb8..739cd6196e0b1 100644 --- a/src/ci/docker/android/Dockerfile +++ b/src/ci/docker/dist-android/Dockerfile @@ -21,17 +21,13 @@ RUN dpkg --add-architecture i386 && \ WORKDIR /android/ ENV PATH=$PATH:/android/ndk-arm-9/bin:/android/sdk/tools:/android/sdk/platform-tools -COPY install-ndk.sh install-sdk.sh accept-licenses.sh /android/ +COPY install-ndk.sh /android/ RUN sh /android/install-ndk.sh -RUN sh /android/install-sdk.sh RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb && \ dpkg -i dumb-init_*.deb && \ rm dumb-init_*.deb - -COPY start-emulator.sh /android/ - -ENTRYPOINT ["/usr/bin/dumb-init", "--", "/android/start-emulator.sh"] +ENTRYPOINT ["/usr/bin/dumb-init", "--"] ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783 RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \ @@ -49,8 +45,4 @@ ENV RUST_CONFIGURE_ARGS \ --i686-linux-android-ndk=/android/ndk-x86-9 \ --aarch64-linux-android-ndk=/android/ndk-aarch64 -# Just a smoke test in dist to see if this works for now, we should expand this -# to all the targets above eventually. -ENV SCRIPT \ - python2.7 ../x.py test --target arm-linux-androideabi && \ - python2.7 ../x.py dist --target $TARGETS +ENV SCRIPT python2.7 ../x.py dist --target $TARGETS diff --git a/src/ci/docker/android/install-ndk.sh b/src/ci/docker/dist-android/install-ndk.sh similarity index 84% rename from src/ci/docker/android/install-ndk.sh rename to src/ci/docker/dist-android/install-ndk.sh index 418ce69c5b1e5..19c1b94e784c8 100644 --- a/src/ci/docker/android/install-ndk.sh +++ b/src/ci/docker/dist-android/install-ndk.sh @@ -11,12 +11,6 @@ set -ex -cpgdb() { - cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb /android/$1/bin/$2-gdb - cp android-ndk-r11c/prebuilt/linux-x86_64/bin/gdb-orig /android/$1/bin/gdb-orig - cp -r android-ndk-r11c/prebuilt/linux-x86_64/share /android/$1/share -} - # Prep the Android NDK # # See https://github.com/servo/servo/wiki/Building-for-Android @@ -28,7 +22,6 @@ bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \ --install-dir=/android/ndk-arm-9 \ --ndk-dir=/android/android-ndk-r11c \ --arch=arm -cpgdb ndk-arm-9 arm-linux-androideabi bash android-ndk-r11c/build/tools/make-standalone-toolchain.sh \ --platform=android-21 \ --toolchain=aarch64-linux-android-4.9 \