2 - local: '/.gitlab-ci.d/buildtest-template.yml'
5 extends: .native_build_job_template
7 - job: amd64-alpine-container
10 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
11 microblazeel-softmmu mips64el-softmmu
12 MAKE_CHECK_ARGS: check-build
13 CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
17 - .git-submodule-status
21 extends: .native_test_job_template
23 - job: build-system-alpine
27 MAKE_CHECK_ARGS: check
29 acceptance-system-alpine:
30 extends: .acceptance_test_job_template
32 - job: build-system-alpine
36 MAKE_CHECK_ARGS: check-acceptance
39 extends: .native_build_job_template
41 job: amd64-ubuntu2004-container
44 CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
45 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
46 microblazeel-softmmu mips64el-softmmu
47 MAKE_CHECK_ARGS: check-build
54 extends: .native_test_job_template
56 - job: build-system-ubuntu
60 MAKE_CHECK_ARGS: check
62 acceptance-system-ubuntu:
63 extends: .acceptance_test_job_template
65 - job: build-system-ubuntu
69 MAKE_CHECK_ARGS: check-acceptance
72 extends: .native_build_job_template
74 job: amd64-debian-container
77 CONFIGURE_ARGS: --enable-fdt=system
78 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
79 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
80 MAKE_CHECK_ARGS: check-build
87 extends: .native_test_job_template
89 - job: build-system-debian
93 MAKE_CHECK_ARGS: check
95 acceptance-system-debian:
96 extends: .acceptance_test_job_template
98 - job: build-system-debian
102 MAKE_CHECK_ARGS: check-acceptance
105 extends: .native_build_job_template
107 job: amd64-fedora-container
110 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
111 --enable-fdt=system --enable-slirp=system --enable-capstone=system
112 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
113 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
114 MAKE_CHECK_ARGS: check-build
121 extends: .native_test_job_template
123 - job: build-system-fedora
127 MAKE_CHECK_ARGS: check
129 acceptance-system-fedora:
130 extends: .acceptance_test_job_template
132 - job: build-system-fedora
136 MAKE_CHECK_ARGS: check-acceptance
139 extends: .native_build_job_template
141 job: amd64-centos8-container
144 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
145 --enable-modules --enable-trace-backends=dtrace
146 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
147 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
148 MAKE_CHECK_ARGS: check-build
155 extends: .native_test_job_template
157 - job: build-system-centos
161 MAKE_CHECK_ARGS: check
163 acceptance-system-centos:
164 extends: .acceptance_test_job_template
166 - job: build-system-centos
170 MAKE_CHECK_ARGS: check-acceptance
172 build-system-opensuse:
173 extends: .native_build_job_template
175 job: amd64-opensuse-leap-container
178 CONFIGURE_ARGS: --enable-fdt=system
179 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
180 MAKE_CHECK_ARGS: check-build
186 check-system-opensuse:
187 extends: .native_test_job_template
189 - job: build-system-opensuse
193 MAKE_CHECK_ARGS: check
195 acceptance-system-opensuse:
196 extends: .acceptance_test_job_template
198 - job: build-system-opensuse
202 MAKE_CHECK_ARGS: check-acceptance
206 extends: .native_build_job_template
208 job: amd64-fedora-container
221 --disable-coroutine-pool
230 --disable-guest-agent
241 --disable-live-block-migration
243 --disable-malloc-trim
252 --disable-qom-cast-debug
255 --disable-replication
267 --disable-vhost-crypto
270 --disable-vhost-kernel
273 --disable-vhost-vsock
274 --disable-virglrenderer
280 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
281 s390x-softmmu i386-linux-user
282 MAKE_CHECK_ARGS: check-qtest SPEED=slow
284 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
285 # the configure script. The container doesn't contain Xen headers so
286 # Xen accelerator is not detected / selected. As result it build the
287 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
289 # Also use a different coroutine implementation (which is only really of
290 # interest to KVM users, i.e. with TCG disabled)
292 extends: .native_build_job_template
294 job: amd64-centos8-container
300 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
301 || { cat config.log meson-logs/meson-log.txt && exit 1; }
304 - make check-qapi-schema
305 - cd tests/qemu-iotests/
306 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
307 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
308 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
309 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
310 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
311 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
312 260 261 262 263 264 270 272 273 277 279
315 extends: .native_build_job_template
317 job: amd64-debian-user-cross-container
319 IMAGE: debian-all-test-cross
320 CONFIGURE_ARGS: --disable-tools --disable-system
321 MAKE_CHECK_ARGS: check-tcg
324 extends: .native_build_job_template
326 job: amd64-debian-user-cross-container
328 IMAGE: debian-all-test-cross
329 CONFIGURE_ARGS: --disable-tools --disable-system --static
330 MAKE_CHECK_ARGS: check-tcg
332 # Because the hexagon cross-compiler takes so long to build we don't rely
333 # on the CI system to build it and hence this job has an optional dependency
334 # declared. The image is manually uploaded.
336 extends: .native_build_job_template
338 job: hexagon-cross-container
341 IMAGE: debian-hexagon-cross
342 TARGETS: hexagon-linux-user
343 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
344 MAKE_CHECK_ARGS: check-tcg
346 # Only build the softmmu targets we have check-tcg tests for
348 extends: .native_build_job_template
350 job: amd64-debian-user-cross-container
352 IMAGE: debian-all-test-cross
353 CONFIGURE_ARGS: --disable-tools --enable-debug
354 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
355 MAKE_CHECK_ARGS: check-tcg
357 # We build tricore in a very minimal tricore only container
358 build-tricore-softmmu:
359 extends: .native_build_job_template
361 job: tricore-debian-cross-container
363 IMAGE: debian-tricore-cross
364 CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
365 TARGETS: tricore-softmmu
366 MAKE_CHECK_ARGS: check-tcg
369 extends: .native_build_job_template
371 job: amd64-fedora-container
374 CONFIGURE_ARGS: --cc=clang --cxx=clang++
375 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
376 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
377 ppc-softmmu s390x-softmmu
378 MAKE_CHECK_ARGS: check-qtest check-tcg
381 extends: .native_build_job_template
383 job: amd64-debian-user-cross-container
385 IMAGE: debian-all-test-cross
386 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
387 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
388 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
389 MAKE_CHECK_ARGS: check-unit check-tcg
391 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
392 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
393 # triggers an Out-Of-Memory error
395 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
396 # with QEMU and linked as a static library to avoid false positives in CFI checks.
397 # This can be accomplished by using -enable-slirp=git, which avoids the use of
398 # a system-wide version of the library
400 # Split in three sets of build/check/acceptance to limit the execution time of each
403 extends: .native_build_job_template
405 - job: amd64-fedora-container
410 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
411 --enable-safe-stack --enable-slirp=git
412 TARGETS: aarch64-softmmu
413 MAKE_CHECK_ARGS: check-build
421 extends: .native_test_job_template
423 - job: build-cfi-aarch64
427 MAKE_CHECK_ARGS: check
429 acceptance-cfi-aarch64:
430 extends: .acceptance_test_job_template
432 - job: build-cfi-aarch64
436 MAKE_CHECK_ARGS: check-acceptance
438 build-cfi-ppc64-s390x:
439 extends: .native_build_job_template
441 - job: amd64-fedora-container
446 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
447 --enable-safe-stack --enable-slirp=git
448 TARGETS: ppc64-softmmu s390x-softmmu
449 MAKE_CHECK_ARGS: check-build
456 check-cfi-ppc64-s390x:
457 extends: .native_test_job_template
459 - job: build-cfi-ppc64-s390x
463 MAKE_CHECK_ARGS: check
465 acceptance-cfi-ppc64-s390x:
466 extends: .acceptance_test_job_template
468 - job: build-cfi-ppc64-s390x
472 MAKE_CHECK_ARGS: check-acceptance
475 extends: .native_build_job_template
477 - job: amd64-fedora-container
482 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
483 --enable-safe-stack --enable-slirp=git
484 TARGETS: x86_64-softmmu
485 MAKE_CHECK_ARGS: check-build
493 extends: .native_test_job_template
495 - job: build-cfi-x86_64
499 MAKE_CHECK_ARGS: check
501 acceptance-cfi-x86_64:
502 extends: .acceptance_test_job_template
504 - job: build-cfi-x86_64
508 MAKE_CHECK_ARGS: check-acceptance
511 extends: .native_build_job_template
513 job: amd64-ubuntu2004-container
516 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
517 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
518 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
519 MAKE_CHECK_ARGS: bench V=1
521 # These targets are on the way out
523 extends: .native_build_job_template
525 job: amd64-debian-user-cross-container
527 IMAGE: debian-all-test-cross
528 CONFIGURE_ARGS: --disable-tools
529 MAKE_CHECK_ARGS: build-tcg
530 TARGETS: ppc64abi32-linux-user
536 # We split the check-tcg step as test failures are expected but we still
537 # want to catch the build breaking.
539 extends: .native_test_job_template
541 - job: build-deprecated
544 IMAGE: debian-all-test-cross
545 MAKE_CHECK_ARGS: check-tcg
548 # gprof/gcov are GCC features
550 extends: .native_build_job_template
552 job: amd64-ubuntu2004-container
555 CONFIGURE_ARGS: --enable-gprof --enable-gcov
556 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
563 extends: .native_test_job_template
565 - job: build-gprof-gcov
569 MAKE_CHECK_ARGS: check
571 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
574 extends: .native_build_job_template
576 job: amd64-fedora-container
580 - mkdir build-oss-fuzz
581 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
582 ./scripts/oss-fuzz/build.sh
583 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
584 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
586 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
587 echo Testing ${fuzzer} ... ;
588 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
590 # Unrelated to fuzzer: run some tests with -fsanitize=address
591 - cd build-oss-fuzz && make check-qtest-i386 check-unit
594 extends: .native_build_job_template
596 job: amd64-debian-user-cross-container
598 IMAGE: debian-all-test-cross
600 - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
603 - ../configure --enable-tcg-interpreter
604 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
606 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
607 - for tg in $TARGETS ; do
608 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
609 ./tests/qtest/boot-serial-test || exit 1 ;
610 ./tests/qtest/cdrom-test || exit 1 ;
612 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
613 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
616 # Alternate coroutines implementations are only really of interest to KVM users
617 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
618 build-coroutine-sigaltstack:
619 extends: .native_build_job_template
621 job: amd64-ubuntu2004-container
624 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
625 --enable-trace-backends=ftrace
626 MAKE_CHECK_ARGS: check-unit
628 # Check our reduced build configurations
629 build-without-default-devices:
630 extends: .native_build_job_template
632 job: amd64-centos8-container
635 CONFIGURE_ARGS: --without-default-devices --disable-user
637 build-without-default-features:
638 extends: .native_build_job_template
640 job: amd64-debian-container
643 CONFIGURE_ARGS: --without-default-features --disable-user
644 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
645 MAKE_CHECK_ARGS: check-unit
649 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
651 job: amd64-fedora-container
653 - dnf install -y meson ninja-build
655 - mkdir subprojects/libvhost-user/build
656 - cd subprojects/libvhost-user/build
660 # No targets are built here, just tools, docs, and unit tests. This
661 # also feeds into the eventual documentation deployment steps later
662 build-tools-and-docs-debian:
663 extends: .native_build_job_template
665 job: amd64-debian-container
668 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
669 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
675 # Prepare for GitLab pages deployment. Anything copied into the
676 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
678 # GitLab publishes from any branch that triggers a CI pipeline
680 # For the main repo we don't want to publish from 'staging'
681 # since that content may not be pushed, nor do we wish to
682 # publish from 'stable-NNN' branches as that content is outdated.
683 # Thus we restrict to just the default branch
685 # For contributor forks we want to publish from any repo so
686 # that users can see the results of their commits, regardless
687 # of what topic branch they're currently using
689 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
692 - job: build-tools-and-docs-debian
695 # HTML-ised source tree
697 - htags -anT --tree-view=filetree -m qemu_init
698 -t "Welcome to the QEMU sourcecode"
700 # Project documentation
701 - make -C build install DESTDIR=$(pwd)/temp-install
702 - mv temp-install/usr/local/share/doc/qemu/* public/
707 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
709 - if: '$CI_PROJECT_NAMESPACE == "qemu-project"'
711 - if: '$CI_PROJECT_NAMESPACE != "qemu-project"'