Add an ARM64 build on Travis.
[platform/upstream/libexif.git] / .travis.yml
index a1f2094..ca7dd25 100644 (file)
@@ -5,9 +5,11 @@ sudo: false
 language: c
 
 git:
-  depth: 1
+  # Set to 10 instead of 1 to avoid problems when the most recent commits have [skip ci]
+  depth: 10
 
 # Install autopoint on Ubuntu (needed for gettext)
+# This is ignored on bionic for some reason (see below).
 addons:
   apt:
     packages:
@@ -33,28 +35,42 @@ os:
 
 matrix:
   include:
-  - env: CONFIG=clang6
+  - env: CONFIG=normal DIST=bionic
     os: linux
+    dist: bionic
+    compiler: gcc
+  - env: CONFIG=normal DIST=bionic
+    os: linux
+    dist: bionic
+    compiler: clang
+  - env: CONFIG=normal DIST=xenial
+    os: linux
+    dist: xenial
+    compiler: gcc
+  - env: CONFIG=normal DIST=xenial
+    os: linux
+    dist: xenial
+    compiler: clang
+  - env: CONFIG=clang6 DIST=xenial
+    os: linux
+    dist: xenial
     compiler: clang
     addons:
       apt:
-        sources:
-          - llvm-toolchain-trusty-6.0
-          - ubuntu-toolchain-r-test
         packages:
           - autopoint
           - clang-6.0
-  - env: CONFIG=clang7
+  - env: CONFIG=clang8
     os: linux
     compiler: clang
     addons:
       apt:
         sources:
-          - llvm-toolchain-trusty-7
+          - llvm-toolchain-trusty-8
           - ubuntu-toolchain-r-test
         packages:
           - autopoint
-          - clang-7
+          - clang-8
   - env: CONFIG=gcc8
     os: linux
     compiler: gcc
@@ -74,8 +90,9 @@ matrix:
           - autopoint
           - gcc-4.8-arm-linux-gnueabihf
           - libc6-dev-armhf-cross
-  - env: CONFIG=musl
+  - env: CONFIG=musl DIST=xenial
     os: linux
+    dist: xenial
     compiler: gcc
     addons:
       apt:
@@ -88,17 +105,18 @@ matrix:
     addons:
       apt:
         sources:
-          - llvm-toolchain-trusty-7
+          - llvm-toolchain-trusty-8
           - ubuntu-toolchain-r-test
         packages:
           - autopoint
-          - clang-7
+          - clang-8
           - libtool
     # Required for -fsanitize=undefined
     # see https://github.com/travis-ci/travis-ci/issues/9033
     sudo: required
-  - env: CONFIG=coverage
+  - env: CONFIG=coverage DIST=xenial
     os: linux
+    dist: xenial
     compiler: gcc
     addons:
       apt:
@@ -109,6 +127,15 @@ matrix:
     cache:
       directories:
         - $HOME/failmalloc
+  - env: CONFIG=normal DIST=bionic
+    arch: arm64
+    os: linux
+    dist: bionic
+    compiler: gcc
+
+before_install:
+  # The apt addons section is ignored on bionic for some reason
+  - if [ "$DIST" = "bionic" ] ; then sudo apt-get install -y autopoint gettext libtool; fi
 
 install:
   - |
@@ -128,7 +155,11 @@ install:
         curl -fsSORL --retry 8 https://download.savannah.nongnu.org/releases/failmalloc/failmalloc-1.0.tar.gz
         tar xaf failmalloc-1.0.tar.gz
         cd failmalloc-1.0
+        # Fix compiling with modern glibc
         sed -i -e 's/\(__malloc_initialize_hook\)/volatile \1/' failmalloc.c
+        # Disable failmalloc on program exit so system code can run unimpeded
+        sed -i -e '/failmalloc_init/,${/failmalloc_install/aatexit(failmalloc_uninstall);
+        }' failmalloc.c
         ./configure --prefix="$HOME/failmalloc" --disable-dependency-tracking
         make
         make install
@@ -144,18 +175,18 @@ script:
   - if [ "$CONFIG" = "stackprotect" ] ; then CFLAGS='-g -O0 -fstack-protector-all'; fi
   - if [ "$CONFIG" = "disable-nls" ] ; then CFLAGS='-Wall -Wextra -O3'; CONFIGURE_OPTS='--disable-nls'; fi
   - if [ "$CONFIG" = "clang6" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-6.0; fi
-  - if [ "$CONFIG" = "clang7" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=clang-7; fi
-  - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=gcc-8; fi
+  - if [ "$CONFIG" = "clang8" ] ; then CFLAGS='-Wall -Wextra -Wno-error=switch -O3'; MAKE_OPTS="CFLAGS+=-Werror CFLAGS+=${CFLAGS// / CFLAGS+=}"; export CC=clang-8; fi
+  - if [ "$CONFIG" = "gcc8" ] ; then CFLAGS='-Wall -Wextra -Wno-error=switch -Wno-error=implicit-fallthrough -O3'; MAKE_OPTS="CFLAGS+=-Werror CFLAGS+=${CFLAGS// / CFLAGS+=}"; export CC=gcc-8; fi
   - if [ "$CONFIG" = "arm-cross" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=arm-linux-gnueabihf-gcc-4.8; CONFIGURE_OPTS='--host=arm-linux-gnueabihf'; fi
   - if [ "$CONFIG" = "musl" ] ; then CFLAGS='-Wall -Wextra -O3'; export CC=musl-gcc; CONFIGURE_OPTS='--disable-shared'; fi
-  - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined -fsanitize-address-use-after-scope'; export CC=clang-7; export ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1; fi
-  - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib" ; fi
-  - ./configure --prefix="${HOME}"/install --disable-dependency-tracking CFLAGS="$CFLAGS" $CONFIGURE_OPTS || { tail -300 config.log; false; }
+  - if [ "$CONFIG" = "sanitize" ] ; then CFLAGS='-g -Wall -Wextra -fsanitize=address -fsanitize=undefined -fsanitize-address-use-after-scope'; export CC=clang-8; export ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=1; fi
+  - if [ "$CONFIG" = "coverage" ] ; then cd "$HOME"/libexif-testsuite; CFLAGS=--coverage; CONFIGURE_OPTS="LDFLAGS=--coverage --with-failmalloc=$HOME/failmalloc/lib"; fi
+  - ./configure --prefix="$HOME"/install --disable-dependency-tracking CFLAGS="$CFLAGS" $CONFIGURE_OPTS || { tail -n 300 config.log; false; }
 
-  - make V=1
+  - make V=1 $MAKE_OPTS
   # Skip tests when cross compiling.
-  - if [ "$CONFIG" != "arm-cross" ] ; then make V=1 check || { tail -300 test*/test-suite.log; false; }; fi
-  - make V=1 install
+  - if [ "$CONFIG" != "arm-cross" ] ; then make V=1 $MAKE_OPTS check || { tail -n 300 test*/test-suite.log src/libexif/test*/test-suite.log; false; }; fi
+  - make V=1 $MAKE_OPTS install
 
   - if [ "$CONFIG" = "coverage" ] ; then cd "$TRAVIS_BUILD_DIR"; fi