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-centos9-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
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
190 # Override the default flags as we need more to grab the old version
191 GIT_FETCH_EXTRA_FLAGS: --prune --quiet
193 - export QEMU_PREV_VERSION="$(sed 's/\([0-9.]*\)\.[0-9]*/v\1.0/' VERSION)"
194 - git remote add upstream https://gitlab.com/qemu-project/qemu
195 - git fetch upstream refs/tags/$QEMU_PREV_VERSION:refs/tags/$QEMU_PREV_VERSION
196 - git checkout $QEMU_PREV_VERSION
198 - mv build build-previous
200 .migration-compat-common:
201 extends: .common_test_job_template
203 - job: build-previous-qemu
204 - job: build-system-opensuse
205 # The old QEMU could have bugs unrelated to migration that are
206 # already fixed in the current development branch, so this test
211 MAKE_CHECK_ARGS: check-build
213 # Use the migration-tests from the older QEMU tree. This avoids
214 # testing an old QEMU against new features/tests that it is not
218 - QTEST_QEMU_BINARY_SRC=./qemu-system-${TARGET}
219 QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
221 - QTEST_QEMU_BINARY_DST=./qemu-system-${TARGET}
222 QTEST_QEMU_BINARY=../build/qemu-system-${TARGET} ./tests/qtest/migration-test
224 # This job needs to be disabled until we can have an aarch64 CPU model that
225 # will both (1) support both KVM and TCG, and (2) provide a stable ABI.
226 # Currently only "-cpu max" can provide (1), however it doesn't guarantee
227 # (2). Mark this test skipped until later.
228 migration-compat-aarch64:
229 extends: .migration-compat-common
234 migration-compat-x86_64:
235 extends: .migration-compat-common
240 extends: .native_test_job_template
242 - job: build-system-centos
246 MAKE_CHECK_ARGS: check
248 avocado-system-centos:
249 extends: .avocado_test_job_template
251 - job: build-system-centos
255 MAKE_CHECK_ARGS: check-avocado
256 AVOCADO_TAGS: arch:ppc64 arch:or1k arch:s390x arch:x86_64 arch:rx
259 build-system-opensuse:
261 - .native_build_job_template
262 - .native_build_artifact_template
264 job: amd64-opensuse-leap-container
267 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
268 MAKE_CHECK_ARGS: check-build
270 check-system-opensuse:
271 extends: .native_test_job_template
273 - job: build-system-opensuse
277 MAKE_CHECK_ARGS: check
279 avocado-system-opensuse:
280 extends: .avocado_test_job_template
282 - job: build-system-opensuse
286 MAKE_CHECK_ARGS: check-avocado
287 AVOCADO_TAGS: arch:s390x arch:x86_64 arch:aarch64
290 # Flaky tests. We don't run these by default and they are allow fail
291 # but often the CI system is the only way to trigger the failures.
296 - .native_build_job_template
297 - .native_build_artifact_template
299 job: amd64-debian-container
303 TARGETS: aarch64-softmmu arm-softmmu mips64el-softmmu
304 ppc64-softmmu rx-softmmu s390x-softmmu sh4-softmmu x86_64-softmmu
305 MAKE_CHECK_ARGS: check-build
307 avocado-system-flaky:
308 extends: .avocado_test_job_template
310 - job: build-system-flaky
315 MAKE_CHECK_ARGS: check-avocado
317 QEMU_TEST_FLAKY_TESTS: 1
320 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
321 # the configure script. The container doesn't contain Xen headers so
322 # Xen accelerator is not detected / selected. As result it build the
323 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
325 # Also use a different coroutine implementation (which is only really of
326 # interest to KVM users, i.e. with TCG disabled)
328 extends: .native_build_job_template
330 job: amd64-centos9-container
336 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
337 --disable-docs --disable-sdl --disable-gtk --disable-vnc
338 || { cat config.log meson-logs/meson-log.txt && exit 1; }
341 - make check-qapi-schema
342 - cd tests/qemu-iotests/
343 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
344 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
345 170 171 184 192 194 208 221 226 227 236 253 277 image-fleecing
346 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
347 124 132 139 142 144 145 151 152 155 157 165 194 196 200 202
348 208 209 216 218 227 234 246 247 248 250 254 255 257 258
349 260 261 262 263 264 270 272 273 277 279 image-fleecing
352 extends: .native_build_job_template
354 job: amd64-debian-user-cross-container
356 IMAGE: debian-all-test-cross
357 CONFIGURE_ARGS: --disable-tools --disable-system
358 --target-list-exclude=alpha-linux-user,sh4-linux-user
359 MAKE_CHECK_ARGS: check-tcg
362 extends: .native_build_job_template
364 job: amd64-debian-user-cross-container
366 IMAGE: debian-all-test-cross
367 CONFIGURE_ARGS: --disable-tools --disable-system --static
368 --target-list-exclude=alpha-linux-user,sh4-linux-user
369 MAKE_CHECK_ARGS: check-tcg
371 # targets stuck on older compilers
373 extends: .native_build_job_template
375 job: amd64-debian-legacy-cross-container
377 IMAGE: debian-legacy-test-cross
378 TARGETS: alpha-linux-user alpha-softmmu sh4-linux-user
379 CONFIGURE_ARGS: --disable-tools
380 MAKE_CHECK_ARGS: check-tcg
383 extends: .native_build_job_template
385 job: hexagon-cross-container
387 IMAGE: debian-hexagon-cross
388 TARGETS: hexagon-linux-user
389 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
390 MAKE_CHECK_ARGS: check-tcg
392 # Build the softmmu targets we have check-tcg tests and compilers in
393 # our omnibus all-test-cross container. Those targets that haven't got
394 # Debian cross compiler support need to use special containers.
396 extends: .native_build_job_template
398 job: amd64-debian-user-cross-container
400 IMAGE: debian-all-test-cross
401 CONFIGURE_ARGS: --disable-tools --enable-debug
402 TARGETS: arm-softmmu aarch64-softmmu i386-softmmu riscv64-softmmu
403 s390x-softmmu x86_64-softmmu
404 MAKE_CHECK_ARGS: check-tcg
407 extends: .native_build_job_template
409 job: loongarch-debian-cross-container
411 IMAGE: debian-loongarch-cross
412 CONFIGURE_ARGS: --disable-tools --enable-debug
413 TARGETS: loongarch64-linux-user loongarch64-softmmu
414 MAKE_CHECK_ARGS: check-tcg
416 # We build tricore in a very minimal tricore only container
417 build-tricore-softmmu:
418 extends: .native_build_job_template
420 job: tricore-debian-cross-container
422 IMAGE: debian-tricore-cross
423 CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
424 TARGETS: tricore-softmmu
425 MAKE_CHECK_ARGS: check-tcg
428 extends: .native_build_job_template
430 job: amd64-fedora-container
433 CONFIGURE_ARGS: --cc=clang --cxx=clang++
434 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
435 --extra-cflags=-fno-sanitize=function
436 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu s390x-softmmu
437 MAKE_CHECK_ARGS: check-qtest check-tcg
440 extends: .native_build_job_template
442 job: amd64-debian-user-cross-container
445 IMAGE: debian-all-test-cross
446 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
447 --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
448 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
449 MAKE_CHECK_ARGS: check-unit check-tcg
451 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
452 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
453 # triggers an Out-Of-Memory error
455 # Since slirp callbacks are used in QEMU Timers, we cannot use libslirp with
456 # CFI builds, and thus have to disable it here.
458 # Split in three sets of build/check/avocado to limit the execution time of each
462 - .native_build_job_template
463 - .native_build_artifact_template
465 - job: amd64-fedora-container
470 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
471 --enable-safe-stack --disable-slirp
472 TARGETS: aarch64-softmmu
473 MAKE_CHECK_ARGS: check-build
474 # FIXME: This job is often failing, likely due to out-of-memory problems in
475 # the constrained containers of the shared runners. Thus this is marked as
476 # skipped until the situation has been solved.
481 extends: .native_test_job_template
483 - job: build-cfi-aarch64
487 MAKE_CHECK_ARGS: check
490 extends: .avocado_test_job_template
492 - job: build-cfi-aarch64
496 MAKE_CHECK_ARGS: check-avocado
498 build-cfi-ppc64-s390x:
500 - .native_build_job_template
501 - .native_build_artifact_template
503 - job: amd64-fedora-container
508 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
509 --enable-safe-stack --disable-slirp
510 TARGETS: ppc64-softmmu s390x-softmmu
511 MAKE_CHECK_ARGS: check-build
512 # FIXME: This job is often failing, likely due to out-of-memory problems in
513 # the constrained containers of the shared runners. Thus this is marked as
514 # skipped until the situation has been solved.
518 check-cfi-ppc64-s390x:
519 extends: .native_test_job_template
521 - job: build-cfi-ppc64-s390x
525 MAKE_CHECK_ARGS: check
527 avocado-cfi-ppc64-s390x:
528 extends: .avocado_test_job_template
530 - job: build-cfi-ppc64-s390x
534 MAKE_CHECK_ARGS: check-avocado
538 - .native_build_job_template
539 - .native_build_artifact_template
541 - job: amd64-fedora-container
546 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
547 --enable-safe-stack --disable-slirp
548 TARGETS: x86_64-softmmu
549 MAKE_CHECK_ARGS: check-build
553 extends: .native_test_job_template
555 - job: build-cfi-x86_64
559 MAKE_CHECK_ARGS: check
562 extends: .avocado_test_job_template
564 - job: build-cfi-x86_64
568 MAKE_CHECK_ARGS: check-avocado
571 extends: .native_build_job_template
573 job: amd64-ubuntu2204-container
576 CONFIGURE_ARGS: --enable-tsan --cc=clang --cxx=clang++
577 --enable-trace-backends=ust --disable-slirp
578 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
579 # Remove when we switch to a distro with clang >= 18
580 # https://github.com/google/sanitizers/issues/1716
581 MAKE: setarch -R make
583 # gcov is a GCC features
585 extends: .native_build_job_template
587 job: amd64-ubuntu2204-container
591 CONFIGURE_ARGS: --enable-gcov
592 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
593 MAKE_CHECK_ARGS: check-unit check-softfloat
596 - gcovr --xml-pretty --exclude-unreachable-branches --print-summary
597 -o coverage.xml --root ${CI_PROJECT_DIR} . *.p
598 coverage: /^\s*lines:\s*\d+.\d+\%/
600 name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
604 - build/meson-logs/testlog.txt
606 junit: build/meson-logs/testlog.junit.xml
608 coverage_format: cobertura
609 path: build/coverage.xml
612 extends: .native_build_job_template
614 job: amd64-fedora-container
618 - mkdir build-oss-fuzz
619 - export LSAN_OPTIONS=suppressions=scripts/oss-fuzz/lsan_suppressions.txt
620 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
621 ./scripts/oss-fuzz/build.sh
622 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
623 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
625 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
626 echo Testing ${fuzzer} ... ;
627 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
631 extends: .native_build_job_template
633 job: amd64-debian-user-cross-container
635 IMAGE: debian-all-test-cross
637 - TARGETS="aarch64 arm hppa m68k microblaze ppc64 s390x x86_64"
640 - ../configure --enable-tcg-interpreter --disable-docs --disable-gtk --disable-vnc
641 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)"
642 || { cat config.log meson-logs/meson-log.txt && exit 1; }
644 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
645 - for tg in $TARGETS ; do
646 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
647 ./tests/qtest/boot-serial-test || exit 1 ;
648 ./tests/qtest/cdrom-test || exit 1 ;
650 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
651 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
654 # Check our reduced build configurations
655 # requires libfdt: aarch64, arm, loongarch64, microblaze, microblazeel,
656 # or1k, ppc64, riscv32, riscv64, rx
657 # fails qtest without boards: i386, x86_64
658 build-without-defaults:
659 extends: .native_build_job_template
661 job: amd64-centos9-container
665 --without-default-devices
666 --without-default-features
669 --disable-qom-cast-debug
671 TARGETS: alpha-softmmu avr-softmmu cris-softmmu hppa-softmmu m68k-softmmu
672 mips-softmmu mips64-softmmu mipsel-softmmu mips64el-softmmu
673 ppc-softmmu s390x-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu
674 sparc64-softmmu tricore-softmmu xtensa-softmmu xtensaeb-softmmu
675 hexagon-linux-user i386-linux-user s390x-linux-user
676 MAKE_CHECK_ARGS: check
679 extends: .base_job_template
681 image: $CI_REGISTRY_IMAGE/qemu/fedora:$QEMU_CI_CONTAINER_TAG
683 job: amd64-fedora-container
685 - mkdir subprojects/libvhost-user/build
686 - cd subprojects/libvhost-user/build
690 # No targets are built here, just tools, docs, and unit tests. This
691 # also feeds into the eventual documentation deployment steps later
692 build-tools-and-docs-debian:
694 - .native_build_job_template
695 - .native_build_artifact_template
697 job: amd64-debian-container
698 # when running on 'master' we use pre-existing container
702 MAKE_CHECK_ARGS: check-unit ctags TAGS cscope
703 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
706 # Prepare for GitLab pages deployment. Anything copied into the
707 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
709 # GitLab publishes from any branch that triggers a CI pipeline
711 # For the main repo we don't want to publish from 'staging'
712 # since that content may not be pushed, nor do we wish to
713 # publish from 'stable-NNN' branches as that content is outdated.
714 # Thus we restrict to just the default branch
716 # For contributor forks we want to publish from any repo so
717 # that users can see the results of their commits, regardless
718 # of what topic branch they're currently using
720 extends: .base_job_template
721 image: $CI_REGISTRY_IMAGE/qemu/debian:$QEMU_CI_CONTAINER_TAG
724 - job: build-tools-and-docs-debian
727 # HTML-ised source tree
729 # We unset variables to work around a bug in some htags versions
730 # which causes it to fail when the environment is large
731 - CI_COMMIT_MESSAGE= CI_COMMIT_TAG_MESSAGE= htags
732 -anT --tree-view=filetree -m qemu_init
733 -t "Welcome to the QEMU sourcecode"
735 # Project documentation
736 - make -C build install DESTDIR=$(pwd)/temp-install
737 - mv temp-install/usr/local/share/doc/qemu/* public/
746 image: $CI_REGISTRY_IMAGE/qemu/fedora:$QEMU_CI_CONTAINER_TAG
751 - job: amd64-fedora-container
754 - dnf install -y curl wget
756 # would be nice to cancel the job if over quota (https://gitlab.com/gitlab-org/gitlab/-/issues/256089)
758 # curl --request POST --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" "${CI_SERVER_URL}/api/v4/projects/${CI_PROJECT_ID}/jobs/${CI_JOB_ID}/cancel
759 - 'scripts/coverity-scan/run-coverity-scan --check-upload-only || { exitcode=$?; if test $exitcode = 1; then
764 scripts/coverity-scan/run-coverity-scan --update-tools-only > update-tools.log 2>&1 || { cat update-tools.log; exit 1; };
765 scripts/coverity-scan/run-coverity-scan --no-update-tools'
767 - if: '$COVERITY_TOKEN == null'
769 - if: '$COVERITY_EMAIL == null'
771 # Never included on upstream pipelines, except for schedules
772 - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM && $CI_PIPELINE_SOURCE == "schedule"'
774 - if: '$CI_PROJECT_NAMESPACE == $QEMU_CI_UPSTREAM'
776 # Forks don't get any pipeline unless QEMU_CI=1 or QEMU_CI=2 is set
777 - if: '$QEMU_CI != "1" && $QEMU_CI != "2"'
779 # Always manual on forks even if $QEMU_CI == "2"