From 968370d311319abf11369098deef3cb9349481ed Mon Sep 17 00:00:00 2001 From: Pietro Monteiro Date: Fri, 26 May 2017 11:56:15 -0700 Subject: [PATCH] Add AArch64 to Travis CI builds. --- .travis.yml | 72 +++++++++++++++++++++++++++++++++++++++++ mk/travis.sh | 37 ++++++++++++++------- mk/update-travis-yml.py | 4 ++- 3 files changed, 101 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0a3e7e7610..510937fb85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,6 +38,30 @@ matrix: os: osx osx_image: xcode8.2 + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X=--features=rsa_signing MODE_X=DEBUG KCOV=0 + rust: stable + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X= MODE_X=DEBUG KCOV=0 + rust: stable + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X=--features=rsa_signing MODE_X=RELWITHDEBINFO KCOV=0 + rust: stable + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X= MODE_X=RELWITHDEBINFO KCOV=0 + rust: stable + os: linux + dist: trusty + sudo: required + - env: TARGET_X=armv7-linux-androideabi CC_X=arm-linux-androideabi-gcc CXX_X=arm-linux-androideabi-g++ FEATURES_X=--features=rsa_signing MODE_X=DEBUG KCOV=0 rust: stable os: linux @@ -558,6 +582,30 @@ matrix: os: osx osx_image: xcode8.2 + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X=--features=rsa_signing MODE_X=DEBUG KCOV=0 + rust: nightly + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X= MODE_X=DEBUG KCOV=0 + rust: nightly + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X=--features=rsa_signing MODE_X=RELWITHDEBINFO KCOV=0 + rust: nightly + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X= MODE_X=RELWITHDEBINFO KCOV=0 + rust: nightly + os: linux + dist: trusty + sudo: required + - env: TARGET_X=armv7-linux-androideabi CC_X=arm-linux-androideabi-gcc CXX_X=arm-linux-androideabi-g++ FEATURES_X=--features=rsa_signing MODE_X=DEBUG KCOV=0 rust: nightly os: linux @@ -1098,6 +1146,30 @@ matrix: os: osx osx_image: xcode8.2 + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X=--features=rsa_signing MODE_X=DEBUG KCOV=0 + rust: beta + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X= MODE_X=DEBUG KCOV=0 + rust: beta + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X=--features=rsa_signing MODE_X=RELWITHDEBINFO KCOV=0 + rust: beta + os: linux + dist: trusty + sudo: required + + - env: TARGET_X=aarch64-linux-android CC_X=aarch64-linux-android-gcc CXX_X=aarch64-linux-android-g++ FEATURES_X= MODE_X=RELWITHDEBINFO KCOV=0 + rust: beta + os: linux + dist: trusty + sudo: required + - env: TARGET_X=armv7-linux-androideabi CC_X=arm-linux-androideabi-gcc CXX_X=arm-linux-androideabi-g++ FEATURES_X=--features=rsa_signing MODE_X=DEBUG KCOV=0 rust: beta os: linux diff --git a/mk/travis.sh b/mk/travis.sh index 70321fc182..7038777021 100755 --- a/mk/travis.sh +++ b/mk/travis.sh @@ -26,21 +26,34 @@ aarch64-unknown-linux-gnu) arm-unknown-linux-gnueabihf) export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf ;; +aarch64-linux-android) + ANDROID_ARCH=arm64 + ANDROID_ABI=arm64-v8a + ANDROID_API=21 + ANDROID_SYS_IMG_API=24 + ;; armv7-linux-androideabi) + ANDROID_ARCH=arm + ANDROID_ABI=armeabi-v7a + ANDROID_API=18 + ANDROID_SYS_IMG_API=18 + ;; +*) + ;; +esac + +if [[ "$TARGET_X" =~ android ]]; then # install the android sdk/ndk - mk/travis-install-android.sh --arch arm \ - --api-level 18 \ - --abi-name armeabi-v7a \ - --sys-img-api-level 18 \ + mk/travis-install-android.sh --arch ${ANDROID_ARCH} \ + --api-level ${ANDROID_API} \ + --abi-name ${ANDROID_ABI} \ + --sys-img-api-level ${ANDROID_SYS_IMG_API} \ --rust-target ${TARGET_X} export PATH=$HOME/android/android-ndk/bin:$PATH export PATH=$HOME/android/android-sdk-linux/platform-tools:$PATH export PATH=$HOME/android/android-sdk-linux/tools:$PATH - ;; -*) - ;; -esac +fi if [[ "$TARGET_X" =~ ^(arm|aarch64) && ! "$TARGET_X" =~ android ]]; then # We need a newer QEMU than Travis has. @@ -90,15 +103,17 @@ else fi case $TARGET_X in -armv7-linux-androideabi) +*-linux-android*) cargo test -vv -j2 --no-run ${mode-} ${FEATURES_X-} --target=$TARGET_X # Building the AVD is slow. Do it here, after we build the code so that any # build breakage is reported sooner, instead of being delayed by this. - echo no | android create avd --name arm-18 --target android-18 --abi armeabi-v7a + echo no | android create avd --name test --target "android-${ANDROID_SYS_IMG_API}" android list avd - emulator @arm-18 -memory 2048 -no-skin -no-boot-anim -no-window & + emulator @test -memory 2048 -no-skin -no-boot-anim -no-window & + adb wait-for-device + adb root adb wait-for-device # Run the unit tests first. diff --git a/mk/update-travis-yml.py b/mk/update-travis-yml.py index 65d8f9ccd2..6bb4d9309d 100644 --- a/mk/update-travis-yml.py +++ b/mk/update-travis-yml.py @@ -53,6 +53,7 @@ compilers = { "aarch64-unknown-linux-gnu" : [ "aarch64-linux-gnu-gcc" ], + "aarch64-linux-android" : [ "aarch64-linux-android-gcc" ], "armv7-linux-androideabi" : [ "arm-linux-androideabi-gcc" ], "arm-unknown-linux-gnueabihf" : [ "arm-linux-gnueabihf-gcc" ], "i686-unknown-linux-gnu" : linux_compilers, @@ -82,6 +83,7 @@ "x86_64-apple-darwin", ], "linux" : [ + "aarch64-linux-android", "armv7-linux-androideabi", "x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", @@ -145,7 +147,7 @@ def format_entry(os, target, compiler, rust, mode, features): if sys == "darwin": abi = sys sys = "macos" - elif sys == "androideabi": + elif re.match(r'^android.*', sys): abi = sys sys = "linux" else: