[PATCH] ci: support Travis CI's aarch64 builds

Paul Chaignon paul.chaignon at gmail.com
Tue Nov 5 18:43:07 UTC 2019


Travis CI now supports aarch64 builds, launched with the new "arch: arm64"
tag.  These builds are running inside LXD only for the moment.

The aarch64 builds tend to be a lot slower than their x86_64 counterparts,
so several timeout values need to be increased.  In addition, the
strace-DDD test fails under LXD because of unexpected content in the
/proc/[pid]/stat file (process group ID and session ID are 0).

* .travis.yml (matrix): add aarch64 builds and mark previous builds as
amd64.
* ci/install-dependencies.sh: install packages for aarch64 builds
* ci/run-build-and-tests.sh: disable mpers and strace-DDD test for aarch64.
* tests/init.sh (TIMEOUT_DURATION): Increase timeout for the slower
aarch64 builds.
* tests/umount2.c (main): allow EACCESS error code inside LXD.

Signed-off-by: Paul Chaignon <paul.chaignon at gmail.com>
---
 .travis.yml                | 45 ++++++++++++++++++++++++++++++++++++++
 ci/install-dependencies.sh | 26 +++++++++++++++++-----
 ci/run-build-and-tests.sh  |  6 +++++
 tests/init.sh              |  2 +-
 tests/umount2.c            |  3 ++-
 5 files changed, 75 insertions(+), 7 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 8c156874..5d071cb6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,57 +19,102 @@ env:
 matrix:
   include:
     - compiler: gcc
+      arch: amd64
       env:
         - TARGET=x86
         - STACKTRACE=no
     - compiler: gcc
+      arch: amd64
       env:
         - TARGET=x86_64
         - STACKTRACE=libunwind
         - CHECK=coverage
         - KHEADERS=torvalds/linux
     - compiler: gcc-8
+      arch: amd64
       env:
         - TARGET=x86_64
         - STACKTRACE=libunwind
         - KHEADERS=torvalds/linux
     - compiler: gcc
+      arch: amd64
       env:
         - TARGET=x86_64
         - STACKTRACE=libunwind
     - compiler: gcc
+      arch: amd64
       env:
         - TARGET=x32
         - STACKTRACE=no
     - compiler: clang
+      arch: amd64
       env:
         - TARGET=x86_64
         - STACKTRACE=libunwind
     - compiler: musl-gcc
+      arch: amd64
       env:
         - TARGET=x86_64
         - STACKTRACE=no
     - compiler: clang
+      arch: amd64
       env:
         - TARGET=x86
         - STACKTRACE=no
     - compiler: musl-gcc
+      arch: amd64
       env:
         - TARGET=x86
         - STACKTRACE=no
     - compiler: gcc-8
+      arch: amd64
       env:
         - TARGET=x86_64
         - STACKTRACE=libunwind
     - compiler: gcc-8
+      arch: amd64
       env:
         - TARGET=x32
         - STACKTRACE=no
     - compiler: gcc-8
+      arch: amd64
       env:
         - TARGET=x86
         - STACKTRACE=no
     - compiler: gcc
+      arch: amd64
       env:
         - TARGET=x86_64
         - STACKTRACE=no
+    - compiler: gcc
+      arch: arm64
+      env:
+        - TARGET=aarch64
+        - SLEEP_A_BIT="sleep 0.4"
+        - STACKTRACE=no
+    - compiler: gcc
+      arch: arm64
+      env:
+        - TARGET=aarch64
+        - SLEEP_A_BIT="sleep 0.4"
+        - STACKTRACE=no
+        - KHEADERS=torvalds/linux
+    - compiler: gcc-8
+      arch: arm64
+      env:
+        - TARGET=aarch64
+        - SLEEP_A_BIT="sleep 0.4"
+        - STACKTRACE=no
+        - KHEADERS=torvalds/linux
+    - compiler: clang
+      arch: arm64
+      env:
+        - TARGET=aarch64
+        - SLEEP_A_BIT="sleep 0.4"
+        - STACKTRACE=no
+    - compiler: gcc-8
+      arch: arm64
+      env:
+        - TARGET=aarch64
+        - SLEEP_A_BIT="sleep 0.4"
+        - STACKTRACE=no
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index 9558eb3e..eee3ae00 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -7,7 +7,7 @@
 
 j=-j`nproc` || j=
 type sudo >/dev/null 2>&1 && sudo=sudo || sudo=
-common_packages='autoconf automake faketime file gawk gcc-multilib git gzip libbluetooth-dev make xz-utils'
+common_packages='autoconf automake faketime file gawk git gzip libbluetooth-dev make xz-utils'
 
 retry_if_failed()
 {
@@ -55,17 +55,33 @@ clone_repo()
 		git clone --depth=1 ${branch:+--branch $branch} "$src" "$dst"
 }
 
+case "$TARGET" in
+	aarch64)
+		packages="$common_packages gcc-multilib-arm-linux-gnueabihf"
+		;;
+	*)
+		packages="$common_packages gcc-multilib"
+		;;
+esac
+
 case "$CC" in
 	gcc-*)
 		retry_if_failed \
 			$sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
-		apt_get_install $common_packages "$CC"-multilib
+		case "$TARGET" in
+			aarch64)
+				apt_get_install $packages "$CC"-multilib-arm-linux-gnueabihf "$CC"
+				;;
+			*)
+				apt_get_install $packages "$CC"-multilib
+				;;
+		esac
 		;;
 	clang*)
-		apt_get_install $common_packages "$CC"
+		apt_get_install $packages "$CC"
 		;;
 	*)
-		apt_get_install $common_packages
+		apt_get_install $packages
 		;;
 esac
 
@@ -121,7 +137,7 @@ esac
 
 case "${CHECK-}" in
 	coverage)
-		apt_get_install lcov
+		apt_get_install lcov python-pip python-setuptools
 		retry_if_failed \
 			pip install --user codecov
 		;;
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index f52bf5cd..1f1de42d 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -27,6 +27,12 @@ case "${TARGET-}" in
 		CC="$CC -m32"
 		DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu"
 		;;
+	aarch64)
+		# The new Travis CI aarch64 builds under LXD have rubbish data in
+		# the /proc/[pid]/stat file required by strace-DDD.test.
+		sed -ri 's/(XFAIL_TESTS_ =.*)$/\1 strace-DDD.test/' tests/Makefile.am
+		DISTCHECK_CONFIGURE_FLAGS="--disable-mpers"
+		;;
 esac
 
 case "${STACKTRACE-}" in
diff --git a/tests/init.sh b/tests/init.sh
index 66a8105d..df41f88c 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -384,7 +384,7 @@ fi
 : "${STRACE_EXE:=$STRACE}"
 export STRACE_EXE
 
-: "${TIMEOUT_DURATION:=600}"
+: "${TIMEOUT_DURATION:=1500}"
 : "${SLEEP_A_BIT:=sleep 1}"
 
 [ -z "${VERBOSE-}" ] ||
diff --git a/tests/umount2.c b/tests/umount2.c
index 8114d098..8dd990f9 100644
--- a/tests/umount2.c
+++ b/tests/umount2.c
@@ -6,6 +6,7 @@
  */
 
 #include "tests.h"
+#include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/stat.h>
@@ -28,7 +29,7 @@ main(void)
 		perror_msg_and_fail("mkdir: %s", sample);
 	(void) syscall(TEST_SYSCALL_NR, sample, 31);
 	printf("%s(\"%s\", MNT_FORCE|MNT_DETACH|MNT_EXPIRE|UMOUNT_NOFOLLOW|0x10)"
-	       " = -1 EINVAL (%m)\n", TEST_SYSCALL_STR, sample);
+	       " = -1 %s (%m)\n", TEST_SYSCALL_STR, sample, (errno == EACCES)? "EACCES" : "EINVAL");
 	if (rmdir(sample))
 		perror_msg_and_fail("rmdir: %s", sample);
 	puts("+++ exited with 0 +++");
-- 
2.17.1



More information about the Strace-devel mailing list