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
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, linux, osx, or windows)
13 # - OS distribution (for Linux, xenial, trusty, or precise)
14 # - macOS image name (e.g., xcode7.2)
15 # - Names and values of visible environment variables set in .travis.yml or Settings panel
20 - $HOME/avocado/data/cache
45 - libspice-protocol-dev
59 # The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
60 # to prevent IRC notifications from forks. This was created using:
61 # $ travis encrypt -r "qemu/qemu" "irc.oftc.net#qemu"
65 - secure: "F7GDRgjuOo5IUyRLqSkmDL7kvdU4UcH3Lm/W2db2JnDHTGCqgEdaYEYKciyCLZ57vOTsTsOgesN8iUT7hNHBd1KWKjZe9KDTZWppWRYVwAwQMzVeSOsbbU4tRoJ6Pp+3qhH1Z0eGYR9ZgKYAoTumDFgSAYRp4IscKS8jkoedOqM="
74 - BASE_CONFIG="--disable-docs --disable-tools"
76 - TEST_CMD="make check V=1"
77 # This is broadly a list of "mainline" softmmu targets which have support across the major distros
78 - MAIN_SOFTMMU_TARGETS="aarch64-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
79 - CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime"
84 # we want to do this ourselves
87 # Common first phase for all steps
89 - if command -v ccache ; then ccache --zero-stats ; fi
90 - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
91 - echo "=== Using ${JOBS} simultaneous jobs ==="
93 # Configure step - may be overridden
95 - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
96 - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
98 # Main build & test - rarely overridden - controlled by TEST_CMD
100 - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
102 if [ "$BUILD_RC" -eq 0 ] && [ -n "$TEST_BUILD_CMD" ]; then
103 ${TEST_BUILD_CMD} || BUILD_RC=$?
108 if [ "$BUILD_RC" -eq 0 ] ; then
114 - if command -v ccache ; then ccache --show-stats ; fi
119 - name: "GCC static (user)"
121 - CONFIG="--disable-system --static"
122 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
125 # we split the system builds as it takes a while to build them all
126 - name: "GCC (main-softmmu)"
128 - CONFIG="--disable-user --target-list=${MAIN_SOFTMMU_TARGETS}"
129 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
132 - name: "GCC (other-softmmu)"
134 - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
135 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
138 # Just build tools and run minimal unit and softfloat checks
139 - name: "GCC check-softfloat (user)"
141 - BASE_CONFIG="--enable-tools"
142 - CONFIG="--disable-user --disable-system"
143 - TEST_CMD="make check-unit check-softfloat -j${JOBS}"
144 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
147 # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower
148 - name: "GCC debug (main-softmmu)"
150 - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}"
151 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug"
154 # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions
155 - name: "GCC debug (user)"
157 - CONFIG="--enable-debug-tcg --disable-system"
158 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
161 - name: "GCC some libs disabled (main-softmmu)"
163 - CONFIG="--disable-linux-aio --disable-cap-ng --disable-attr --disable-brlapi --disable-libusb --disable-replication --target-list=${MAIN_SOFTMMU_TARGETS}"
166 # Module builds are mostly of interest to major distros
167 - name: "GCC modules (main-softmmu)"
169 - CONFIG="--enable-modules --target-list=${MAIN_SOFTMMU_TARGETS}"
170 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
173 # Alternate coroutines implementations are only really of interest to KVM users
174 # However we can't test against KVM on Travis so we can only run unit tests
175 - name: "check-unit coroutine=ucontext"
177 - CONFIG="--with-coroutine=ucontext --disable-tcg"
178 - TEST_CMD="make check-unit -j${JOBS} V=1"
181 - name: "check-unit coroutine=sigaltstack"
183 - CONFIG="--with-coroutine=sigaltstack --disable-tcg"
184 - TEST_CMD="make check-unit -j${JOBS} V=1"
187 # Check we can build docs and tools (out of tree)
188 - name: "tools and docs (bionic)"
191 - BUILD_DIR="out-of-tree/build/dir" SRC_DIR="../../.."
192 - BASE_CONFIG="--enable-tools --enable-docs"
193 - CONFIG="--target-list=x86_64-softmmu,aarch64-linux-user"
194 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
203 # Test with Clang for compile portability (Travis uses clang-5.0)
204 - name: "Clang (user)"
206 - CONFIG="--disable-system"
207 - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
211 - name: "Clang (main-softmmu)"
213 - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS} "
214 - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize"
217 - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
218 - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log && exit 1; }
221 - name: "Clang (other-softmmu)"
223 - CONFIG="--disable-user --target-list-exclude=${MAIN_SOFTMMU_TARGETS}"
224 - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-default"
228 # gprof/gcov are GCC features
229 - name: "GCC gprof/gcov"
231 - CONFIG="--enable-gprof --enable-gcov --disable-pie --target-list=${MAIN_SOFTMMU_TARGETS}"
233 - ${SRC_DIR}/scripts/travis/coverage-summary.sh
236 # We manually include builds which we disable "make check" for
237 - name: "GCC without-default-devices (softmmu)"
239 - CONFIG="--without-default-devices --disable-user"
240 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
244 # Check the TCG interpreter (TCI)
247 - CONFIG="--enable-debug-tcg --enable-tcg-interpreter --disable-kvm --disable-containers
248 --target-list=alpha-softmmu,arm-softmmu,hppa-softmmu,m68k-softmmu,microblaze-softmmu,moxie-softmmu,ppc-softmmu,s390x-softmmu,x86_64-softmmu"
249 - TEST_CMD="make check-qtest check-tcg V=1"
252 # We don't need to exercise every backend with every front-end
253 - name: "GCC trace log,simple,syslog (user)"
255 - CONFIG="--enable-trace-backends=log,simple,syslog --disable-system"
259 - name: "GCC trace ftrace (x86_64-softmmu)"
261 - CONFIG="--enable-trace-backends=ftrace --target-list=x86_64-softmmu"
265 - name: "GCC trace ust (x86_64-softmmu)"
267 - CONFIG="--enable-trace-backends=ust --target-list=x86_64-softmmu"
271 # MacOSX builds - cirrus.yml also tests some MacOS builds including latest Xcode
273 - name: "OSX Xcode 10.3"
275 - CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu"
289 - brew link --overwrite python
290 - export PATH="/usr/local/opt/ccache/libexec:$PATH"
291 - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
292 - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }
296 - name: "GCC Python 3.5 (x86_64-softmmu)"
298 - CONFIG="--target-list=x86_64-softmmu"
299 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
304 - name: "GCC Python 3.6 (x86_64-softmmu)"
306 - CONFIG="--target-list=x86_64-softmmu"
307 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
312 # Acceptance (Functional) tests
313 - name: "GCC check-acceptance"
315 - CONFIG="--target-list=aarch64-softmmu,alpha-softmmu,arm-softmmu,m68k-softmmu,microblaze-softmmu,mips-softmmu,mips64el-softmmu,nios2-softmmu,or1k-softmmu,ppc-softmmu,ppc64-softmmu,s390x-softmmu,sparc-softmmu,x86_64-softmmu,xtensa-softmmu"
316 - TEST_CMD="make check-acceptance"
318 - python3 -c 'import json; r = json.load(open("tests/results/latest/results.json")); [print(t["logfile"]) for t in r["tests"] if t["status"] not in ("PASS", "SKIP")]' | xargs cat
330 # Using newer GCC with sanitizers
331 - name: "GCC9 with sanitizers (softmmu)"
336 # PPAs for newer toolchains
337 - ubuntu-toolchain-r-test
360 - libspice-protocol-dev
361 - libspice-server-dev
371 - COMPILER_NAME=gcc CXX=g++-9 CC=gcc-9
372 - CONFIG="--cc=gcc-9 --cxx=g++-9 --disable-pie --disable-linux-user"
375 - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR}
376 - ${SRC_DIR}/configure ${CONFIG} --extra-cflags="-g3 -O0 -Wno-error=stringop-truncation -fsanitize=thread" --extra-ldflags="-fuse-ld=gold" || { cat config.log && exit 1; }
379 # Run check-tcg against linux-user
380 - name: "GCC check-tcg (user)"
382 - CONFIG="--disable-system --enable-debug-tcg"
383 - TEST_BUILD_CMD="make build-tcg"
384 - TEST_CMD="make check-tcg"
385 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
388 # Run check-tcg against linux-user (with plugins)
389 # we skip sparc64-linux-user until it has been fixed somewhat
390 # we skip cris-linux-user as it doesn't use the common run loop
391 - name: "GCC plugins check-tcg (user)"
393 - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user"
394 - TEST_BUILD_CMD="make build-tcg"
395 - TEST_CMD="make check-tcg"
396 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
399 # Run check-tcg against softmmu targets
400 - name: "GCC check-tcg (some-softmmu)"
402 - CONFIG="--enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu"
403 - TEST_BUILD_CMD="make build-tcg"
404 - TEST_CMD="make check-tcg"
405 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
408 # Run check-tcg against softmmu targets (with plugins)
409 - name: "GCC plugins check-tcg (some-softmmu)"
411 - CONFIG="--enable-plugins --enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu"
412 - TEST_BUILD_CMD="make build-tcg"
413 - TEST_CMD="make check-tcg"
414 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg"
416 - name: "[aarch64] GCC check-tcg"
445 - TEST_CMD="make check check-tcg V=1"
446 - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS}"
448 - name: "[ppc64] GCC check-tcg"
477 - TEST_CMD="make check check-tcg V=1"
478 - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},ppc64le-linux-user"
480 - name: "[s390x] GCC check-tcg"
509 - TEST_CMD="make check check-tcg V=1"
510 - CONFIG="--disable-containers --target-list=${MAIN_SOFTMMU_TARGETS},s390x-linux-user"
512 - ( cd ${SRC_DIR} ; git submodule update --init roms/SLOF )
513 - BUILD_RC=0 && make -j${JOBS} || BUILD_RC=$?
515 if [ "$BUILD_RC" -eq 0 ] ; then
516 mv pc-bios/s390-ccw/*.img pc-bios/ ;
523 # The make-release script expect a QEMU version, so our tag must start with a 'v'.
524 # This is the case when release candidate tags are created.
525 - name: "Release tarball"
526 if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/
528 # We want to build from the release tarball
529 - BUILD_DIR="release/build/dir" SRC_DIR="../../.."
530 - BASE_CONFIG="--prefix=$PWD/dist"
531 - CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user"
532 - TEST_CMD="make install -j${JOBS}"
533 - QEMU_VERSION="${TRAVIS_TAG:1}"
534 - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default"
536 - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2
537 - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2
538 - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION}
539 - mkdir -p release-build && cd release-build
540 - ../configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; }