Merge remote-tracking branch 'remotes/cohuck-gitlab/tags/s390x-20210121' into staging
[qemu.git] / .travis.yml
1 # The current Travis default is a VM based 16.04 Xenial on GCE
2 # Additional builds with specific requirements for a full VM need to
3 # be added as additional matrix: entries later on
4 os: linux
5 dist: focal
6 language: c
7 compiler:
8   - gcc
9 cache:
10   # There is one cache per branch and compiler version.
11   # characteristics of each job are used to identify the cache:
12   # - OS name (currently only linux)
13   # - OS distribution (for Linux, bionic or focal)
14   # - Names and values of visible environment variables set in .travis.yml or Settings panel
15   timeout: 1200
16   ccache: true
17   pip: true
18   directories:
19   - $HOME/avocado/data/cache
20
21
22 addons:
23   apt:
24     packages:
25       # Build dependencies
26       - libaio-dev
27       - libattr1-dev
28       - libbrlapi-dev
29       - libcap-ng-dev
30       - libgcc-7-dev
31       - libgnutls28-dev
32       - libgtk-3-dev
33       - libiscsi-dev
34       - liblttng-ust-dev
35       - libncurses5-dev
36       - libnfs-dev
37       - libnss3-dev
38       - libpixman-1-dev
39       - libpng-dev
40       - librados-dev
41       - libsdl2-dev
42       - libsdl2-image-dev
43       - libseccomp-dev
44       - libspice-protocol-dev
45       - libspice-server-dev
46       - libssh-dev
47       - liburcu-dev
48       - libusb-1.0-0-dev
49       - libvdeplug-dev
50       - libvte-2.91-dev
51       - libzstd-dev
52       - ninja-build
53       - sparse
54       - uuid-dev
55       - gcovr
56       # Tests dependencies
57       - genisoimage
58
59
60 # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
61 # to prevent IRC notifications from forks. This was created using:
62 # $ travis encrypt -r "qemu/qemu" "irc.oftc.net#qemu"
63 notifications:
64   irc:
65     channels:
66       - secure: "F7GDRgjuOo5IUyRLqSkmDL7kvdU4UcH3Lm/W2db2JnDHTGCqgEdaYEYKciyCLZ57vOTsTsOgesN8iUT7hNHBd1KWKjZe9KDTZWppWRYVwAwQMzVeSOsbbU4tRoJ6Pp+3qhH1Z0eGYR9ZgKYAoTumDFgSAYRp4IscKS8jkoedOqM="
67     on_success: change
68     on_failure: always
69
70
71 env:
72   global:
73     - SRC_DIR=".."
74     - BUILD_DIR="build"
75     - BASE_CONFIG="--disable-docs --disable-tools"
76     - TEST_BUILD_CMD=""
77     - TEST_CMD="make check V=1"
78     # This is broadly a list of "mainline" softmmu targets which have support across the major distros
79     - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
80     - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
81     - CCACHE_MAXSIZE=1G
82     - G_MESSAGES_DEBUG=error
83
84
85 git:
86   # we want to do this ourselves
87   submodules: false
88
89 # Common first phase for all steps
90 before_install:
91   - if command -v ccache ; then ccache --zero-stats ; fi
92   - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
93   - echo "=== Using ${JOBS} simultaneous jobs ==="
94
95 # Configure step - may be overridden
96 before_script:
97   - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
98   - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
99
100 # Main build & test - rarely overridden - controlled by TEST_CMD
101 script:
102   - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
103   - |
104     if [ "$BUILD_RC" -eq 0 ] && [ -n "$TEST_BUILD_CMD" ]; then
105         ${TEST_BUILD_CMD} || BUILD_RC=$?
106     else
107         $(exit $BUILD_RC);
108     fi
109   - |
110     if [ "$BUILD_RC" -eq 0 ] ; then
111         ${TEST_CMD} ;
112     else
113         $(exit $BUILD_RC);
114     fi
115 after_script:
116   - df -h
117   - if command -v ccache ; then ccache --show-stats ; fi
118
119
120 jobs:
121   include:
122     # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
123     - name: "GCC debug (main-softmmu)"
124       env:
125         - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
126         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug"
127
128
129     # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions
130     - name: "GCC debug (user)"
131       env:
132         - CONFIG="--enable-debug-tcg --disable-system"
133         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
134
135     # Module builds are mostly of interest to major distros
136     - name: "GCC modules (main-softmmu)"
137       env:
138         - CONFIG="--enable-modules --target-list=${MAIN_SOFTMMU_TARGETS}"
139         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
140
141
142     # Test with Clang for compile portability (Travis uses clang-5.0)
143     - name: "Clang (user)"
144       env:
145         - CONFIG="--disable-system --host-cc=clang --cxx=clang++"
146         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
147       compiler: clang
148
149
150     - name: "Clang (main-softmmu)"
151       env:
152         - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS}
153                   --host-cc=clang --cxx=clang++"
154         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
155       compiler: clang
156       before_script:
157         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
158         - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log meson-logs/meson-log.txt && exit 1; }
159
160
161     - name: "Clang (other-softmmu)"
162       env:
163         - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}
164                   --host-cc=clang --cxx=clang++"
165         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
166       compiler: clang
167
168
169     # gprof/gcov are GCC features
170     - name: "GCC gprof/gcov"
171       dist: bionic
172       addons:
173         apt:
174           packages:
175             - ninja-build
176       env:
177         - CONFIG="--enable-gprof --enable-gcov --disable-libssh
178                   --target-list=${MAIN_SOFTMMU_TARGETS}"
179       after_success:
180         - ${SRC_DIR}/scripts/travis/coverage-summary.sh
181
182
183     # Using newer GCC with sanitizers
184     - name: "GCC9 with sanitizers (softmmu)"
185       dist: bionic
186       addons:
187         apt:
188           update: true
189           sources:
190             # PPAs for newer toolchains
191             - ubuntu-toolchain-r-test
192           packages:
193             # Extra toolchains
194             - gcc-9
195             - g++-9
196             # Build dependencies
197             - libaio-dev
198             - libattr1-dev
199             - libbrlapi-dev
200             - libcap-ng-dev
201             - libgnutls28-dev
202             - libgtk-3-dev
203             - libiscsi-dev
204             - liblttng-ust-dev
205             - libnfs-dev
206             - libncurses5-dev
207             - libnss3-dev
208             - libpixman-1-dev
209             - libpng-dev
210             - librados-dev
211             - libsdl2-dev
212             - libsdl2-image-dev
213             - libseccomp-dev
214             - libspice-protocol-dev
215             - libspice-server-dev
216             - liburcu-dev
217             - libusb-1.0-0-dev
218             - libvte-2.91-dev
219             - ninja-build
220             - sparse
221             - uuid-dev
222       language: generic
223       compiler: none
224       env:
225         - COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
226         - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-linux-user"
227         - TEST_CMD=""
228       before_script:
229         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
230         - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread" || { cat config.log meson-logs/meson-log.txt && exit 1; }
231
232
233     - name: "[aarch64] GCC check-tcg"
234       arch: arm64
235       dist: focal
236       addons:
237         apt_packages:
238           - libaio-dev
239           - libattr1-dev
240           - libbrlapi-dev
241           - libcap-ng-dev
242           - libgcrypt20-dev
243           - libgnutls28-dev
244           - libgtk-3-dev
245           - libiscsi-dev
246           - liblttng-ust-dev
247           - libncurses5-dev
248           - libnfs-dev
249           - libnss3-dev
250           - libpixman-1-dev
251           - libpng-dev
252           - librados-dev
253           - libsdl2-dev
254           - libseccomp-dev
255           - liburcu-dev
256           - libusb-1.0-0-dev
257           - libvdeplug-dev
258           - libvte-2.91-dev
259           - ninja-build
260           # Tests dependencies
261           - genisoimage
262       env:
263         - TEST_CMD="make check check-tcg V=1"
264         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
265         - UNRELIABLE=true
266
267     - name: "[ppc64] GCC check-tcg"
268       arch: ppc64le
269       dist: focal
270       addons:
271         apt_packages:
272           - libaio-dev
273           - libattr1-dev
274           - libbrlapi-dev
275           - libcap-ng-dev
276           - libgcrypt20-dev
277           - libgnutls28-dev
278           - libgtk-3-dev
279           - libiscsi-dev
280           - liblttng-ust-dev
281           - libncurses5-dev
282           - libnfs-dev
283           - libnss3-dev
284           - libpixman-1-dev
285           - libpng-dev
286           - librados-dev
287           - libsdl2-dev
288           - libseccomp-dev
289           - liburcu-dev
290           - libusb-1.0-0-dev
291           - libvdeplug-dev
292           - libvte-2.91-dev
293           - ninja-build
294           # Tests dependencies
295           - genisoimage
296       env:
297         - TEST_CMD="make check check-tcg V=1"
298         - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
299
300     - name: "[s390x] GCC check-tcg"
301       arch: s390x
302       dist: bionic
303       addons:
304         apt_packages:
305           - libaio-dev
306           - libattr1-dev
307           - libbrlapi-dev
308           - libcap-ng-dev
309           - libgcrypt20-dev
310           - libgnutls28-dev
311           - libgtk-3-dev
312           - libiscsi-dev
313           - liblttng-ust-dev
314           - libncurses5-dev
315           - libnfs-dev
316           - libnss3-dev
317           - libpixman-1-dev
318           - libpng-dev
319           - librados-dev
320           - libsdl2-dev
321           - libseccomp-dev
322           - liburcu-dev
323           - libusb-1.0-0-dev
324           - libvdeplug-dev
325           - libvte-2.91-dev
326           - ninja-build
327           # Tests dependencies
328           - genisoimage
329       env:
330         - TEST_CMD="make check check-tcg V=1"
331         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
332         - UNRELIABLE=true
333       script:
334         - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
335         - |
336           if [ "$BUILD_RC" -eq 0 ] ; then
337               mv pc-bios/s390-ccw/*.img pc-bios/ ;
338               ${TEST_CMD} ;
339           else
340               $(exit $BUILD_RC);
341           fi
342
343     - name: "[s390x] GCC (other-softmmu)"
344       arch: s390x
345       dist: bionic
346       addons:
347         apt_packages:
348           - libaio-dev
349           - libattr1-dev
350           - libcap-ng-dev
351           - libgnutls28-dev
352           - libiscsi-dev
353           - liblttng-ust-dev
354           - liblzo2-dev
355           - libncurses-dev
356           - libnfs-dev
357           - libnss3-dev
358           - libpixman-1-dev
359           - libsdl2-dev
360           - libsdl2-image-dev
361           - libseccomp-dev
362           - libsnappy-dev
363           - libzstd-dev
364           - nettle-dev
365           - xfslibs-dev
366           - ninja-build
367           # Tests dependencies
368           - genisoimage
369       env:
370         - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
371                   --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
372
373     - name: "[s390x] GCC (user)"
374       arch: s390x
375       dist: bionic
376       addons:
377         apt_packages:
378           - libgcrypt20-dev
379           - libgnutls28-dev
380           - ninja-build
381       env:
382         - CONFIG="--disable-containers --disable-system"
383
384     - name: "[s390x] Clang (disable-tcg)"
385       arch: s390x
386       dist: bionic
387       compiler: clang
388       addons:
389         apt_packages:
390           - libaio-dev
391           - libattr1-dev
392           - libbrlapi-dev
393           - libcap-ng-dev
394           - libgcrypt20-dev
395           - libgnutls28-dev
396           - libgtk-3-dev
397           - libiscsi-dev
398           - liblttng-ust-dev
399           - libncurses5-dev
400           - libnfs-dev
401           - libnss3-dev
402           - libpixman-1-dev
403           - libpng-dev
404           - librados-dev
405           - libsdl2-dev
406           - libseccomp-dev
407           - liburcu-dev
408           - libusb-1.0-0-dev
409           - libvdeplug-dev
410           - libvte-2.91-dev
411           - ninja-build
412       env:
413         - TEST_CMD="make check-unit"
414         - CONFIG="--disable-containers --disable-tcg --enable-kvm
415                   --disable-tools --host-cc=clang --cxx=clang++"
416         - UNRELIABLE=true
417
418     # Release builds
419     # The make-release script expect a QEMU version, so our tag must start with a 'v'.
420     # This is the case when release candidate tags are created.
421     - name: "Release tarball"
422       if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/
423       env:
424         # We want to build from the release tarball
425         - BUILD_DIR="release/build/dir" SRC_DIR="../../.."
426         - BASE_CONFIG="--prefix=$PWD/dist"
427         - CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user"
428         - TEST_CMD="make install -j${JOBS}"
429         - QEMU_VERSION="${TRAVIS_TAG:1}"
430         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
431       script:
432         - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
433         - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
434         - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
435         - mkdir -p release-build && cd release-build
436         - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
437         - make install
438   allow_failures:
439     - env: UNRELIABLE=true