fw_cfg: Refactor extra pci roots addition
[qemu/ar7.git] / .travis.yml
blob1f80bdb6249b73fc4c3d4d6f23ce6e4f0bcf3d14
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
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
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
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
85 git:
86   # we want to do this ourselves
87   submodules: false
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 ==="
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; }
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
120 jobs:
121   include:
122     - name: "GCC static (user)"
123       env:
124         - CONFIG="--disable-system --static"
125         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
127     # Just build tools and run minimal unit and softfloat checks
128     - name: "GCC check-unit and check-softfloat"
129       env:
130         - BASE_CONFIG="--enable-tools"
131         - CONFIG="--disable-user --disable-system"
132         - TEST_CMD="make check-unit check-softfloat -j${JOBS}"
133         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
136     # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
137     - name: "GCC debug (main-softmmu)"
138       env:
139         - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
140         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug"
143     # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions
144     - name: "GCC debug (user)"
145       env:
146         - CONFIG="--enable-debug-tcg --disable-system"
147         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
149     # Module builds are mostly of interest to major distros
150     - name: "GCC modules (main-softmmu)"
151       env:
152         - CONFIG="--enable-modules --target-list=${MAIN_SOFTMMU_TARGETS}"
153         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
156     # Alternate coroutines implementations are only really of interest to KVM users
157     # However we can't test against KVM on Travis so we can only run unit tests
158     - name: "check-unit coroutine=ucontext"
159       env:
160         - CONFIG="--with-coroutine=ucontext --disable-tcg"
161         - TEST_CMD="make check-unit -j${JOBS} V=1"
164     - name: "check-unit coroutine=sigaltstack"
165       env:
166         - CONFIG="--with-coroutine=sigaltstack --disable-tcg"
167         - TEST_CMD="make check-unit -j${JOBS} V=1"
170     # Check we can build docs and tools (out of tree)
171     - name: "tools and docs (bionic)"
172       dist: bionic
173       env:
174         - BUILD_DIR="out-of-tree/build/dir" SRC_DIR="../../.."
175         - BASE_CONFIG="--enable-tools --enable-docs"
176         - CONFIG="--target-list=x86_64-softmmu,aarch64-linux-user"
177         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
178       addons:
179         apt:
180           packages:
181             - ninja-build
182             - python3-sphinx
183             - perl
186     # Test with Clang for compile portability (Travis uses clang-5.0)
187     - name: "Clang (user)"
188       env:
189         - CONFIG="--disable-system --host-cc=clang --cxx=clang++"
190         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
191       compiler: clang
194     - name: "Clang (main-softmmu)"
195       env:
196         - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS}
197                   --host-cc=clang --cxx=clang++"
198         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
199       compiler: clang
200       before_script:
201         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
202         - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log meson-logs/meson-log.txt && exit 1; }
205     - name: "Clang (other-softmmu)"
206       env:
207         - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}
208                   --host-cc=clang --cxx=clang++"
209         - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
210       compiler: clang
213     # gprof/gcov are GCC features
214     - name: "GCC gprof/gcov"
215       dist: bionic
216       addons:
217         apt:
218           packages:
219             - ninja-build
220       env:
221         - CONFIG="--enable-gprof --enable-gcov --disable-libssh
222                   --target-list=${MAIN_SOFTMMU_TARGETS}"
223       after_success:
224         - ${SRC_DIR}/scripts/travis/coverage-summary.sh
227     # We manually include builds which we disable "make check" for
228     - name: "GCC without-default-devices (softmmu)"
229       env:
230         - CONFIG="--without-default-devices --disable-user"
231         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
232         - TEST_CMD=""
235     # Using newer GCC with sanitizers
236     - name: "GCC9 with sanitizers (softmmu)"
237       dist: bionic
238       addons:
239         apt:
240           update: true
241           sources:
242             # PPAs for newer toolchains
243             - ubuntu-toolchain-r-test
244           packages:
245             # Extra toolchains
246             - gcc-9
247             - g++-9
248             # Build dependencies
249             - libaio-dev
250             - libattr1-dev
251             - libbrlapi-dev
252             - libcap-ng-dev
253             - libgnutls28-dev
254             - libgtk-3-dev
255             - libiscsi-dev
256             - liblttng-ust-dev
257             - libnfs-dev
258             - libncurses5-dev
259             - libnss3-dev
260             - libpixman-1-dev
261             - libpng-dev
262             - librados-dev
263             - libsdl2-dev
264             - libsdl2-image-dev
265             - libseccomp-dev
266             - libspice-protocol-dev
267             - libspice-server-dev
268             - liburcu-dev
269             - libusb-1.0-0-dev
270             - libvte-2.91-dev
271             - ninja-build
272             - sparse
273             - uuid-dev
274       language: generic
275       compiler: none
276       env:
277         - COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
278         - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-linux-user"
279         - TEST_CMD=""
280       before_script:
281         - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
282         - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -fsanitize=thread" || { cat config.log meson-logs/meson-log.txt && exit 1; }
285     - name: "[aarch64] GCC check-tcg"
286       arch: arm64
287       dist: focal
288       addons:
289         apt_packages:
290           - libaio-dev
291           - libattr1-dev
292           - libbrlapi-dev
293           - libcap-ng-dev
294           - libgcrypt20-dev
295           - libgnutls28-dev
296           - libgtk-3-dev
297           - libiscsi-dev
298           - liblttng-ust-dev
299           - libncurses5-dev
300           - libnfs-dev
301           - libnss3-dev
302           - libpixman-1-dev
303           - libpng-dev
304           - librados-dev
305           - libsdl2-dev
306           - libseccomp-dev
307           - liburcu-dev
308           - libusb-1.0-0-dev
309           - libvdeplug-dev
310           - libvte-2.91-dev
311           - ninja-build
312           # Tests dependencies
313           - genisoimage
314       env:
315         - TEST_CMD="make check check-tcg V=1"
316         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
317         - UNRELIABLE=true
319     - name: "[ppc64] GCC check-tcg"
320       arch: ppc64le
321       dist: focal
322       addons:
323         apt_packages:
324           - libaio-dev
325           - libattr1-dev
326           - libbrlapi-dev
327           - libcap-ng-dev
328           - libgcrypt20-dev
329           - libgnutls28-dev
330           - libgtk-3-dev
331           - libiscsi-dev
332           - liblttng-ust-dev
333           - libncurses5-dev
334           - libnfs-dev
335           - libnss3-dev
336           - libpixman-1-dev
337           - libpng-dev
338           - librados-dev
339           - libsdl2-dev
340           - libseccomp-dev
341           - liburcu-dev
342           - libusb-1.0-0-dev
343           - libvdeplug-dev
344           - libvte-2.91-dev
345           - ninja-build
346           # Tests dependencies
347           - genisoimage
348       env:
349         - TEST_CMD="make check check-tcg V=1"
350         - CONFIG="--disable-containers --target-list=ppc64-softmmu,ppc64le-linux-user"
352     - name: "[s390x] GCC check-tcg"
353       arch: s390x
354       dist: bionic
355       addons:
356         apt_packages:
357           - libaio-dev
358           - libattr1-dev
359           - libbrlapi-dev
360           - libcap-ng-dev
361           - libgcrypt20-dev
362           - libgnutls28-dev
363           - libgtk-3-dev
364           - libiscsi-dev
365           - liblttng-ust-dev
366           - libncurses5-dev
367           - libnfs-dev
368           - libnss3-dev
369           - libpixman-1-dev
370           - libpng-dev
371           - librados-dev
372           - libsdl2-dev
373           - libseccomp-dev
374           - liburcu-dev
375           - libusb-1.0-0-dev
376           - libvdeplug-dev
377           - libvte-2.91-dev
378           - ninja-build
379           # Tests dependencies
380           - genisoimage
381       env:
382         - TEST_CMD="make check check-tcg V=1"
383         - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
384         - UNRELIABLE=true
385       script:
386         - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
387         - |
388           if [ "$BUILD_RC" -eq 0 ] ; then
389               mv pc-bios/s390-ccw/*.img pc-bios/ ;
390               ${TEST_CMD} ;
391           else
392               $(exit $BUILD_RC);
393           fi
395     - name: "[s390x] GCC (other-softmmu)"
396       arch: s390x
397       dist: bionic
398       addons:
399         apt_packages:
400           - libaio-dev
401           - libattr1-dev
402           - libcap-ng-dev
403           - libgnutls28-dev
404           - libiscsi-dev
405           - liblttng-ust-dev
406           - liblzo2-dev
407           - libncurses-dev
408           - libnfs-dev
409           - libnss3-dev
410           - libpixman-1-dev
411           - libsdl2-dev
412           - libsdl2-image-dev
413           - libseccomp-dev
414           - libsnappy-dev
415           - libzstd-dev
416           - nettle-dev
417           - xfslibs-dev
418           - ninja-build
419           # Tests dependencies
420           - genisoimage
421       env:
422         - CONFIG="--disable-containers --audio-drv-list=sdl --disable-user
423                   --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
425     - name: "[s390x] GCC (user)"
426       arch: s390x
427       dist: bionic
428       addons:
429         apt_packages:
430           - libgcrypt20-dev
431           - libgnutls28-dev
432           - ninja-build
433       env:
434         - CONFIG="--disable-containers --disable-system"
436     - name: "[s390x] Clang (disable-tcg)"
437       arch: s390x
438       dist: bionic
439       compiler: clang
440       addons:
441         apt_packages:
442           - libaio-dev
443           - libattr1-dev
444           - libbrlapi-dev
445           - libcap-ng-dev
446           - libgcrypt20-dev
447           - libgnutls28-dev
448           - libgtk-3-dev
449           - libiscsi-dev
450           - liblttng-ust-dev
451           - libncurses5-dev
452           - libnfs-dev
453           - libnss3-dev
454           - libpixman-1-dev
455           - libpng-dev
456           - librados-dev
457           - libsdl2-dev
458           - libseccomp-dev
459           - liburcu-dev
460           - libusb-1.0-0-dev
461           - libvdeplug-dev
462           - libvte-2.91-dev
463           - ninja-build
464       env:
465         - TEST_CMD="make check-unit"
466         - CONFIG="--disable-containers --disable-tcg --enable-kvm
467                   --disable-tools --host-cc=clang --cxx=clang++"
468         - UNRELIABLE=true
470     # Release builds
471     # The make-release script expect a QEMU version, so our tag must start with a 'v'.
472     # This is the case when release candidate tags are created.
473     - name: "Release tarball"
474       if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/
475       env:
476         # We want to build from the release tarball
477         - BUILD_DIR="release/build/dir" SRC_DIR="../../.."
478         - BASE_CONFIG="--prefix=$PWD/dist"
479         - CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user"
480         - TEST_CMD="make install -j${JOBS}"
481         - QEMU_VERSION="${TRAVIS_TAG:1}"
482         - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
483       script:
484         - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
485         - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
486         - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
487         - mkdir -p release-build && cd release-build
488         - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log meson-logs/meson-log.txt && exit 1; }
489         - make install
490   allow_failures:
491     - env: UNRELIABLE=true