2 - local: '/.gitlab-ci.d/buildtest-template.yml'
6 - .native_build_job_template
7 - .native_build_artifact_template
9 - job: amd64-alpine-container
12 TARGETS: avr-softmmu loongarch64-softmmu mips64-softmmu mipsel-softmmu
13 MAKE_CHECK_ARGS: check-build
14 CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
17 extends: .native_test_job_template
19 - job: build-system-alpine
23 MAKE_CHECK_ARGS: check-unit check-qtest
25 avocado-system-alpine:
26 extends: .avocado_test_job_template
28 - job: build-system-alpine
32 MAKE_CHECK_ARGS: check-avocado
33 AVOCADO_TAGS: arch:avr arch:loongarch64 arch:mips64 arch:mipsel
37 - .native_build_job_template
38 - .native_build_artifact_template
40 job: amd64-ubuntu2204-container
43 CONFIGURE_ARGS: --enable-docs
44 TARGETS: alpha-softmmu microblazeel-softmmu mips64el-softmmu
45 MAKE_CHECK_ARGS: check-build
48 extends: .native_test_job_template
50 - job: build-system-ubuntu
54 MAKE_CHECK_ARGS: check
56 avocado-system-ubuntu:
57 extends: .avocado_test_job_template
59 - job: build-system-ubuntu
63 MAKE_CHECK_ARGS: check-avocado
64 AVOCADO_TAGS: arch:alpha arch:microblazeel arch:mips64el
68 - .native_build_job_template
69 - .native_build_artifact_template
71 job: amd64-debian-container
74 CONFIGURE_ARGS: --with-coroutine=sigaltstack
75 TARGETS: arm-softmmu i386-softmmu riscv64-softmmu sh4eb-softmmu
76 sparc-softmmu xtensa-softmmu
77 MAKE_CHECK_ARGS: check-build
80 extends: .native_test_job_template
82 - job: build-system-debian
86 MAKE_CHECK_ARGS: check
88 avocado-system-debian:
89 extends: .avocado_test_job_template
91 - job: build-system-debian
95 MAKE_CHECK_ARGS: check-avocado
96 AVOCADO_TAGS: arch:arm arch:i386 arch:riscv64 arch:sh4 arch:sparc arch:xtensa
99 extends: .native_test_job_template
101 - job: build-system-debian
107 - make NINJA=":" check-venv
108 - pyvenv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
112 - .native_build_job_template
113 - .native_build_artifact_template
115 job: amd64-fedora-container
118 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
119 TARGETS: microblaze-softmmu mips-softmmu
120 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
121 MAKE_CHECK_ARGS: check-build
124 extends: .native_test_job_template
126 - job: build-system-fedora
130 MAKE_CHECK_ARGS: check
132 avocado-system-fedora:
133 extends: .avocado_test_job_template
135 - job: build-system-fedora
139 MAKE_CHECK_ARGS: check-avocado
140 AVOCADO_TAGS: arch:microblaze arch:mips arch:xtensa arch:m68k
141 arch:riscv32 arch:ppc arch:sparc64
144 extends: .native_test_job_template
146 - job: build-system-fedora
152 - make NINJA=":" check-venv
153 - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
154 - pyvenv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
158 - .native_build_job_template
159 - .native_build_artifact_template
161 job: amd64-centos8-container
164 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-vfio-user-server
165 --enable-modules --enable-trace-backends=dtrace --enable-docs
166 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
167 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
168 MAKE_CHECK_ARGS: check-build
170 # Previous QEMU release. Used for cross-version migration tests.
172 extends: .native_build_job_template
179 - build-previous/**/*.p
180 - build-previous/**/*.a.p
181 - build-previous/**/*.fa.p
182 - build-previous/**/*.c.o
183 - build-previous/**/*.c.o.d
184 - build-previous/**/*.fa
186 job: amd64-opensuse-leap-container
189 TARGETS: x86_64-softmmu aarch64-softmmu
191 - export QEMU_PREV_VERSION="$(sed 's/\([0-9.]*\)\.[0-9]*/v\1.0/' VERSION)"
192 - git remote add upstream https://gitlab.com/qemu-project/qemu
193 - git fetch upstream refs/tags/$QEMU_PREV_VERSION:refs/tags/$QEMU_PREV_VERSION
194 - git checkout $QEMU_PREV_VERSION
196 - mv build build-previous
198 .migration-compat-common:
199 extends: .common_test_job_template
201 - job: build-previous-qemu
202 - job: build-system-opensuse
203 # The old QEMU could have bugs unrelated to migration that are
204 # already fixed in the current development branch, so this test
209 MAKE_CHECK_ARGS: check-build
211 # Use the migration-tests from the older QEMU tree. This avoids
212 # testing an old QEMU against new features/tests that it is not
216 - QTEST_QEMU_BINARY_SRC=./qemu-system-${TARGET}
217 QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
219 - QTEST_QEMU_BINARY_DST=./qemu-system-${TARGET}
220 QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
222 # This job needs to be disabled until we can have an aarch64 CPU model that
223 # will both (1) support both KVM and TCG, and (2) provide a stable ABI.
224 # Currently only "-cpu max" can provide (1), however it doesn't guarantee
225 # (2). Mark this test skipped until later.
226 migration-compat-aarch64:
227 extends: .migration-compat-common
232 migration-compat-x86_64:
233 extends: .migration-compat-common
238 extends: .native_test_job_template
240 - job: build-system-centos
244 MAKE_CHECK_ARGS: check
246 avocado-system-centos:
247 extends: .avocado_test_job_template
249 - job: build-system-centos
253 MAKE_CHECK_ARGS: check-avocado
254 AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx
257 build-system-opensuse:
259 - .native_build_job_template
260 - .native_build_artifact_template
262 job: amd64-opensuse-leap-container
265 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
266 MAKE_CHECK_ARGS: check-build
268 check-system-opensuse:
269 extends: .native_test_job_template
271 - job: build-system-opensuse
275 MAKE_CHECK_ARGS: check
277 avocado-system-opensuse:
278 extends: .avocado_test_job_template
280 - job: build-system-opensuse
284 MAKE_CHECK_ARGS: check-avocado
285 AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64
288 # Flaky tests. We don't run these by default and they are allow fail
289 # but often the CI system is the only way to trigger the failures.
294 - .native_build_job_template
295 - .native_build_artifact_template
297 job: amd64-debian-container
301 TARGETS: aarch64-softmmu arm-softmmu mips64el-softmmu
302 ppc64-softmmu rx-softmmu s390x-softmmu sh4-softmmu x86_64-softmmu
303 MAKE_CHECK_ARGS: check-build
305 avocado-system-flaky:
306 extends: .avocado_test_job_template
308 - job: build-system-flaky
313 MAKE_CHECK_ARGS: check-avocado
315 QEMU_TEST_FLAKY_TESTS: 1
318 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
319 # the configure script. The container doesn't contain Xen headers so
320 # Xen accelerator is not detected / selected. As result it build the
321 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
323 # Also use a different coroutine implementation (which is only really of
324 # interest to KVM users, i.e. with TCG disabled)
326 extends: .native_build_job_template
328 job: amd64-centos8-container
334 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
335 --disable-docs --disable-sdl --disable-gtk --disable-vnc
336 || { cat config.log meson-logs/meson-log.txt && exit 1; }
339 - make check-qapi-schema
340 - cd tests/qemu-iotests/
341 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
342 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
343 170 171 183 184 192 194 208 221 226 227 236 253 277 image-fleecing
344 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
345 124 132 139 142 144 145 151 152 155 157 165 194 196 200 202
346 208 209 216 218 227 234 246 247 248 250 254 255 257 258
347 260 261 262 263 264 270 272 273 277 279 image-fleecing
350 extends: .native_build_job_template
352 job: amd64-debian-user-cross-container
354 IMAGE: debian-all-test-cross
355 CONFIGURE_ARGS: --disable-tools --disable-system
356 --target-list-exclude=alpha-linux-user,sh4-linux-user
357 MAKE_CHECK_ARGS: check-tcg
360 extends: .native_build_job_template
362 job: amd64-debian-user-cross-container
364 IMAGE: debian-all-test-cross
365 CONFIGURE_ARGS: --disable-tools --disable-system --static
366 --target-list-exclude=alpha-linux-user,sh4-linux-user
367 MAKE_CHECK_ARGS: check-tcg
369 # targets stuck on older compilers
371 extends: .native_build_job_template
373 job: amd64-debian-legacy-cross-container
375 IMAGE: debian-legacy-test-cross
376 TARGETS: alpha-linux-user alpha-softmmu sh4-linux-user
377 CONFIGURE_ARGS: --disable-tools
378 MAKE_CHECK_ARGS: check-tcg
381 extends: .native_build_job_template
383 job: hexagon-cross-container
385 IMAGE: debian-hexagon-cross
386 TARGETS: hexagon-linux-user
387 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
388 MAKE_CHECK_ARGS: check-tcg
390 # Build the softmmu targets we have check-tcg tests and compilers in
391 # our omnibus all-test-cross container. Those targets that haven't got
392 # Debian cross compiler support need to use special containers.
394 extends: .native_build_job_template
396 job: amd64-debian-user-cross-container
398 IMAGE: debian-all-test-cross
399 CONFIGURE_ARGS: --disable-tools --enable-debug
400 TARGETS: arm-softmmu aarch64-softmmu i386-softmmu riscv64-softmmu
401 s390x-softmmu x86_64-softmmu
402 MAKE_CHECK_ARGS: check-tcg
405 extends: .native_build_job_template
407 job: loongarch-debian-cross-container
409 IMAGE: debian-loongarch-cross
410 CONFIGURE_ARGS: --disable-tools --enable-debug
411 TARGETS: loongarch64-linux-user loongarch64-softmmu
412 MAKE_CHECK_ARGS: check-tcg
414 # We build tricore in a very minimal tricore only container
415 build-tricore-softmmu:
416 extends: .native_build_job_template
418 job: tricore-debian-cross-container
420 IMAGE: debian-tricore-cross
421 CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
422 TARGETS: tricore-softmmu
423 MAKE_CHECK_ARGS: check-tcg
426 extends: .native_build_job_template
428 job: amd64-fedora-container
431 CONFIGURE_ARGS: --cc=clang --cxx=clang++
432 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
433 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
434 MAKE_CHECK_ARGS: check-qtest check-tcg
437 extends: .native_build_job_template
439 job: amd64-debian-user-cross-container
442 IMAGE: debian-all-test-cross
443 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
444 --target-list-exclude=alpha-linux-user,microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
445 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
446 MAKE_CHECK_ARGS: check-unit check-tcg
448 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
449 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
450 # triggers an Out-Of-Memory error
452 # Since slirp callbacks are used in QEMU Timers, we cannot use libslirp with
453 # CFI builds, and thus have to disable it here.
455 # Split in three sets of build/check/avocado to limit the execution time of each
459 - .native_build_job_template
460 - .native_build_artifact_template
462 - job: amd64-fedora-container
467 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
468 --enable-safe-stack --disable-slirp
469 TARGETS: aarch64-softmmu
470 MAKE_CHECK_ARGS: check-build
471 # FIXME: This job is often failing, likely due to out-of-memory problems in
472 # the constrained containers of the shared runners. Thus this is marked as
473 # skipped until the situation has been solved.
478 extends: .native_test_job_template
480 - job: build-cfi-aarch64
484 MAKE_CHECK_ARGS: check
487 extends: .avocado_test_job_template
489 - job: build-cfi-aarch64
493 MAKE_CHECK_ARGS: check-avocado
495 build-cfi-ppc64-s390x:
497 - .native_build_job_template
498 - .native_build_artifact_template
500 - job: amd64-fedora-container
505 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
506 --enable-safe-stack --disable-slirp
507 TARGETS: ppc64-softmmu s390x-softmmu
508 MAKE_CHECK_ARGS: check-build
509 # FIXME: This job is often failing, likely due to out-of-memory problems in
510 # the constrained containers of the shared runners. Thus this is marked as
511 # skipped until the situation has been solved.
515 check-cfi-ppc64-s390x:
516 extends: .native_test_job_template
518 - job: build-cfi-ppc64-s390x
522 MAKE_CHECK_ARGS: check
524 avocado-cfi-ppc64-s390x:
525 extends: .avocado_test_job_template
527 - job: build-cfi-ppc64-s390x
531 MAKE_CHECK_ARGS: check-avocado
535 - .native_build_job_template
536 - .native_build_artifact_template
538 - job: amd64-fedora-container
543 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
544 --enable-safe-stack --disable-slirp
545 TARGETS: x86_64-softmmu
546 MAKE_CHECK_ARGS: check-build
550 extends: .native_test_job_template
552 - job: build-cfi-x86_64
556 MAKE_CHECK_ARGS: check
559 extends: .avocado_test_job_template
561 - job: build-cfi-x86_64
565 MAKE_CHECK_ARGS: check-avocado
568 extends: .native_build_job_template
570 job: amd64-ubuntu2204-container
573 CONFIGURE_ARGS: --enable-tsan --cc=clang --cxx=clang++
574 --enable-trace-backends=ust --disable-slirp
575 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
577 # gcov is a GCC features
579 extends: .native_build_job_template
581 job: amd64-ubuntu2204-container
585 CONFIGURE_ARGS: --enable-gcov
586 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
587 MAKE_CHECK_ARGS: check-unit check-softfloat
590 - gcovr --xml-pretty --exclude-unreachable-branches --print-summary
591 -o coverage.xml --root ${CI_PROJECT_DIR} . *.p
592 coverage: /^\s*lines:\s*\d+.\d+\%/
594 name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
598 - build/meson-logs/testlog.txt
600 junit: build/meson-logs/testlog.junit.xml
602 coverage_format: cobertura
603 path: build/coverage.xml
606 extends: .native_build_job_template
608 job: amd64-fedora-container
612 - mkdir build-oss-fuzz
613 - export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
614 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
615 ./scripts/oss-fuzz/build.sh
616 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
617 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
619 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
620 echo Testing ${fuzzer} ... ;
621 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
625 extends: .native_build_job_template
627 job: amd64-debian-user-cross-container
629 IMAGE: debian-all-test-cross
631 - TARGETS="aarch64 arm hppa m68k microblaze ppc64 s390x x86_64"
634 - ../configure --enable-tcg-interpreter --disable-docs --disable-gtk --disable-vnc
635 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
636 || { cat config.log meson-logs/meson-log.txt && exit 1; }
638 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
639 - for tg in $TARGETS ; do
640 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
641 ./tests/qtest/boot-serial-test || exit 1 ;
642 ./tests/qtest/cdrom-test || exit 1 ;
644 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
645 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
648 # Check our reduced build configurations
649 build-without-defaults:
650 extends: .native_build_job_template
652 job: amd64-centos8-container
656 --without-default-devices
657 --without-default-features
660 --disable-qom-cast-debug
662 TARGETS: avr-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
663 sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
664 MAKE_CHECK_ARGS: check
667 extends: .base_job_template
669 image: $CI_REGISTRY_IMAGE/qemu/fedora:$QEMU_CI_CONTAINER_TAG
671 job: amd64-fedora-container
673 - mkdir subprojects/libvhost-user/build
674 - cd subprojects/libvhost-user/build
678 # No targets are built here, just tools, docs, and unit tests. This
679 # also feeds into the eventual documentation deployment steps later
680 build-tools-and-docs-debian:
682 - .native_build_job_template
683 - .native_build_artifact_template
685 job: amd64-debian-container
686 # when running on 'master' we use pre-existing container
690 MAKE_CHECK_ARGS: check-unit ctags TAGS cscope
691 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
694 # Prepare for GitLab pages deployment. Anything copied into the
695 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
697 # GitLab publishes from any branch that triggers a CI pipeline
699 # For the main repo we don't want to publish from 'staging'
700 # since that content may not be pushed, nor do we wish to
701 # publish from 'stable-NNN' branches as that content is outdated.
702 # Thus we restrict to just the default branch
704 # For contributor forks we want to publish from any repo so
705 # that users can see the results of their commits, regardless
706 # of what topic branch they're currently using
708 extends: .base_job_template
709 image: $CI_REGISTRY_IMAGE/qemu/debian:$QEMU_CI_CONTAINER_TAG
712 - job: build-tools-and-docs-debian
715 # HTML-ised source tree
717 # We unset variables to work around a bug in some htags versions
718 # which causes it to fail when the environment is large
719 - CI_COMMIT_MESSAGE= CI_COMMIT_TAG_MESSAGE= htags
720 -anT --tree-view=filetree -m qemu_init
721 -t "Welcome to the QEMU sourcecode"
723 # Project documentation
724 - make -C build install DESTDIR=$(pwd)/temp-install
725 - mv temp-install/usr/local/share/doc/qemu/* public/