Skip to content

Commit

Permalink
Add AArch64 to Travis CI builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
pietro committed May 27, 2017
1 parent 1b7a7d3 commit 968370d
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 12 deletions.
72 changes: 72 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
37 changes: 26 additions & 11 deletions mk/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion mk/update-travis-yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -82,6 +83,7 @@
"x86_64-apple-darwin",
],
"linux" : [
"aarch64-linux-android",
"armv7-linux-androideabi",
"x86_64-unknown-linux-gnu",
"aarch64-unknown-linux-gnu",
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 968370d

Please sign in to comment.