2 - local: '/.gitlab-ci.d/stages.yml'
3 - local: '/.gitlab-ci.d/edk2.yml'
4 - local: '/.gitlab-ci.d/opensbi.yml'
5 - local: '/.gitlab-ci.d/containers.yml'
6 - local: '/.gitlab-ci.d/crossbuilds.yml'
7 - local: '/.gitlab-ci.d/static_checks.yml'
9 .native_build_job_template:
11 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
13 - JOBS=$(expr $(nproc) + 1)
15 - if test -n "$LD_JOBS";
17 scripts/git-submodule.sh update meson ;
21 - if test -n "$TARGETS";
23 ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=git} $CONFIGURE_ARGS --target-list="$TARGETS" ;
25 ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=git} $CONFIGURE_ARGS ;
26 fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
27 - if test -n "$LD_JOBS";
29 ../meson/meson.py configure . -Dbackend_max_links="$LD_JOBS" ;
32 - if test -n "$MAKE_CHECK_ARGS";
34 make -j"$JOBS" $MAKE_CHECK_ARGS ;
37 .native_test_job_template:
39 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
41 - scripts/git-submodule.sh update
42 $(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak)
44 - find . -type f -exec touch {} +
45 # Avoid recompiling by hiding ninja with NINJA=":"
46 - make NINJA=":" $MAKE_CHECK_ARGS
48 .acceptance_test_job_template:
49 extends: .native_test_job_template
51 key: "${CI_JOB_NAME}-cache"
53 - ${CI_PROJECT_DIR}/avocado-cache
56 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
60 - build/tests/results/latest/results.xml
61 - build/tests/results/latest/test-results
63 junit: build/tests/results/latest/results.xml
65 - mkdir -p ~/.config/avocado
66 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
67 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
68 >> ~/.config/avocado/avocado.conf
69 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
70 >> ~/.config/avocado/avocado.conf
71 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
72 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
74 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
77 - du -chs ${CI_PROJECT_DIR}/avocado-cache
80 extends: .native_build_job_template
82 - job: amd64-alpine-container
85 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
86 microblazeel-softmmu mips64el-softmmu
87 MAKE_CHECK_ARGS: check-build
88 CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
92 - .git-submodule-status
96 extends: .native_test_job_template
98 - job: build-system-alpine
102 MAKE_CHECK_ARGS: check
104 acceptance-system-alpine:
105 extends: .acceptance_test_job_template
107 - job: build-system-alpine
111 MAKE_CHECK_ARGS: check-acceptance
114 extends: .native_build_job_template
116 job: amd64-ubuntu2004-container
119 CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
120 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
121 microblazeel-softmmu mips64el-softmmu
122 MAKE_CHECK_ARGS: check-build
129 extends: .native_test_job_template
131 - job: build-system-ubuntu
135 MAKE_CHECK_ARGS: check
137 acceptance-system-ubuntu:
138 extends: .acceptance_test_job_template
140 - job: build-system-ubuntu
144 MAKE_CHECK_ARGS: check-acceptance
147 extends: .native_build_job_template
149 job: amd64-debian-container
152 CONFIGURE_ARGS: --enable-fdt=system
153 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
154 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
155 MAKE_CHECK_ARGS: check-build
162 extends: .native_test_job_template
164 - job: build-system-debian
168 MAKE_CHECK_ARGS: check
170 acceptance-system-debian:
171 extends: .acceptance_test_job_template
173 - job: build-system-debian
177 MAKE_CHECK_ARGS: check-acceptance
180 extends: .native_build_job_template
182 job: amd64-fedora-container
185 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
186 --enable-fdt=system --enable-slirp=system --enable-capstone=system
187 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
188 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
189 MAKE_CHECK_ARGS: check-build
196 extends: .native_test_job_template
198 - job: build-system-fedora
202 MAKE_CHECK_ARGS: check
204 acceptance-system-fedora:
205 extends: .acceptance_test_job_template
207 - job: build-system-fedora
211 MAKE_CHECK_ARGS: check-acceptance
214 extends: .native_build_job_template
216 job: amd64-centos8-container
219 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
220 --enable-modules --enable-trace-backends=dtrace
221 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
222 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
223 MAKE_CHECK_ARGS: check-build
230 extends: .native_test_job_template
232 - job: build-system-centos
236 MAKE_CHECK_ARGS: check
238 acceptance-system-centos:
239 extends: .acceptance_test_job_template
241 - job: build-system-centos
245 MAKE_CHECK_ARGS: check-acceptance
247 build-system-opensuse:
248 extends: .native_build_job_template
250 job: amd64-opensuse-leap-container
253 CONFIGURE_ARGS: --enable-fdt=system
254 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
255 MAKE_CHECK_ARGS: check-build
261 check-system-opensuse:
262 extends: .native_test_job_template
264 - job: build-system-opensuse
268 MAKE_CHECK_ARGS: check
270 acceptance-system-opensuse:
271 extends: .acceptance_test_job_template
273 - job: build-system-opensuse
277 MAKE_CHECK_ARGS: check-acceptance
281 extends: .native_build_job_template
283 job: amd64-fedora-container
296 --disable-coroutine-pool
305 --disable-guest-agent
316 --disable-live-block-migration
318 --disable-malloc-trim
327 --disable-qom-cast-debug
330 --disable-replication
342 --disable-vhost-crypto
345 --disable-vhost-kernel
348 --disable-vhost-vsock
349 --disable-virglrenderer
355 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
356 s390x-softmmu i386-linux-user
357 MAKE_CHECK_ARGS: check-qtest SPEED=slow
359 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
360 # the configure script. The container doesn't contain Xen headers so
361 # Xen accelerator is not detected / selected. As result it build the
362 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
364 # Also use a different coroutine implementation (which is only really of
365 # interest to KVM users, i.e. with TCG disabled)
367 extends: .native_build_job_template
369 job: amd64-centos8-container
375 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
376 || { cat config.log meson-logs/meson-log.txt && exit 1; }
379 - make check-qapi-schema
380 - cd tests/qemu-iotests/
381 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
382 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
383 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
384 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
385 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
386 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
387 260 261 262 263 264 270 272 273 277 279
390 extends: .native_build_job_template
392 job: amd64-debian-user-cross-container
394 IMAGE: debian-all-test-cross
395 CONFIGURE_ARGS: --disable-tools --disable-system
396 MAKE_CHECK_ARGS: check-tcg
399 extends: .native_build_job_template
401 job: amd64-debian-user-cross-container
403 IMAGE: debian-all-test-cross
404 CONFIGURE_ARGS: --disable-tools --disable-system --static
405 MAKE_CHECK_ARGS: check-tcg
407 # Because the hexagon cross-compiler takes so long to build we don't rely
408 # on the CI system to build it and hence this job has an optional dependency
409 # declared. The image is manually uploaded.
411 extends: .native_build_job_template
413 job: hexagon-cross-container
416 IMAGE: debian-hexagon-cross
417 TARGETS: hexagon-linux-user
418 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
419 MAKE_CHECK_ARGS: check-tcg
421 # Only build the softmmu targets we have check-tcg tests for
423 extends: .native_build_job_template
425 job: amd64-debian-user-cross-container
427 IMAGE: debian-all-test-cross
428 CONFIGURE_ARGS: --disable-tools --enable-debug
429 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
430 MAKE_CHECK_ARGS: check-tcg
432 # Run check-tcg against linux-user (with plugins)
433 # we skip sparc64-linux-user until it has been fixed somewhat
434 # we skip cris-linux-user as it doesn't use the common run loop
436 extends: .native_build_job_template
438 job: amd64-debian-user-cross-container
440 IMAGE: debian-all-test-cross
441 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
442 MAKE_CHECK_ARGS: check-tcg
446 extends: .native_build_job_template
448 job: amd64-centos7-container
451 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
452 MAKE_CHECK_ARGS: check-tcg
454 build-some-softmmu-plugins:
455 extends: .native_build_job_template
457 job: amd64-debian-user-cross-container
459 IMAGE: debian-all-test-cross
460 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
461 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
462 MAKE_CHECK_ARGS: check-tcg
465 extends: .native_build_job_template
467 job: amd64-fedora-container
470 CONFIGURE_ARGS: --cc=clang --cxx=clang++
471 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
472 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
473 ppc-softmmu s390x-softmmu
474 MAKE_CHECK_ARGS: check-qtest check-tcg
477 extends: .native_build_job_template
479 job: amd64-debian-user-cross-container
481 IMAGE: debian-all-test-cross
482 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
483 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
484 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
485 MAKE_CHECK_ARGS: check-unit check-tcg
487 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
488 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
489 # triggers an Out-Of-Memory error
491 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
492 # with QEMU and linked as a static library to avoid false positives in CFI checks.
493 # This can be accomplished by using -enable-slirp=git, which avoids the use of
494 # a system-wide version of the library
496 # Split in three sets of build/check/acceptance to limit the execution time of each
499 extends: .native_build_job_template
501 - job: amd64-fedora-container
506 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
507 --enable-safe-stack --enable-slirp=git
508 TARGETS: aarch64-softmmu
509 MAKE_CHECK_ARGS: check-build
517 extends: .native_test_job_template
519 - job: build-cfi-aarch64
523 MAKE_CHECK_ARGS: check
525 acceptance-cfi-aarch64:
526 extends: .acceptance_test_job_template
528 - job: build-cfi-aarch64
532 MAKE_CHECK_ARGS: check-acceptance
534 build-cfi-ppc64-s390x:
535 extends: .native_build_job_template
537 - job: amd64-fedora-container
542 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
543 --enable-safe-stack --enable-slirp=git
544 TARGETS: ppc64-softmmu s390x-softmmu
545 MAKE_CHECK_ARGS: check-build
552 check-cfi-ppc64-s390x:
553 extends: .native_test_job_template
555 - job: build-cfi-ppc64-s390x
559 MAKE_CHECK_ARGS: check
561 acceptance-cfi-ppc64-s390x:
562 extends: .acceptance_test_job_template
564 - job: build-cfi-ppc64-s390x
568 MAKE_CHECK_ARGS: check-acceptance
571 extends: .native_build_job_template
573 - job: amd64-fedora-container
578 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
579 --enable-safe-stack --enable-slirp=git
580 TARGETS: x86_64-softmmu
581 MAKE_CHECK_ARGS: check-build
589 extends: .native_test_job_template
591 - job: build-cfi-x86_64
595 MAKE_CHECK_ARGS: check
597 acceptance-cfi-x86_64:
598 extends: .acceptance_test_job_template
600 - job: build-cfi-x86_64
604 MAKE_CHECK_ARGS: check-acceptance
607 extends: .native_build_job_template
609 job: amd64-ubuntu2004-container
612 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
613 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
614 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
615 MAKE_CHECK_ARGS: bench V=1
617 # These targets are on the way out
619 extends: .native_build_job_template
621 job: amd64-debian-user-cross-container
623 IMAGE: debian-all-test-cross
624 CONFIGURE_ARGS: --disable-tools
625 MAKE_CHECK_ARGS: build-tcg
626 TARGETS: ppc64abi32-linux-user
632 # We split the check-tcg step as test failures are expected but we still
633 # want to catch the build breaking.
635 extends: .native_test_job_template
637 - job: build-deprecated
640 IMAGE: debian-all-test-cross
641 MAKE_CHECK_ARGS: check-tcg
644 # gprof/gcov are GCC features
646 extends: .native_build_job_template
648 job: amd64-ubuntu2004-container
651 CONFIGURE_ARGS: --enable-gprof --enable-gcov
652 MAKE_CHECK_ARGS: check
653 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
656 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
659 extends: .native_build_job_template
661 job: amd64-fedora-container
665 - mkdir build-oss-fuzz
666 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
667 ./scripts/oss-fuzz/build.sh
668 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
669 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
671 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
672 echo Testing ${fuzzer} ... ;
673 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
675 # Unrelated to fuzzer: run some tests with -fsanitize=address
676 - cd build-oss-fuzz && make check-qtest-i386 check-unit
679 extends: .native_build_job_template
681 job: amd64-debian-user-cross-container
683 IMAGE: debian-all-test-cross
685 - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
688 - ../configure --enable-tcg-interpreter
689 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
691 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
692 - for tg in $TARGETS ; do
693 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
694 ./tests/qtest/boot-serial-test || exit 1 ;
695 ./tests/qtest/cdrom-test || exit 1 ;
697 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
698 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
701 # Alternate coroutines implementations are only really of interest to KVM users
702 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
703 build-coroutine-sigaltstack:
704 extends: .native_build_job_template
706 job: amd64-ubuntu2004-container
709 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
710 --enable-trace-backends=ftrace
711 MAKE_CHECK_ARGS: check-unit
713 # Most jobs test latest gcrypt or nettle builds
715 # These jobs test old gcrypt and nettle from RHEL7
716 # which had some API differences.
718 extends: .native_build_job_template
720 job: amd64-centos7-container
723 TARGETS: x86_64-softmmu x86_64-linux-user
724 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
725 MAKE_CHECK_ARGS: check
728 extends: .native_build_job_template
730 job: amd64-centos7-container
733 TARGETS: x86_64-softmmu x86_64-linux-user
734 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
735 MAKE_CHECK_ARGS: check
738 extends: .native_build_job_template
740 job: amd64-centos7-container
743 TARGETS: x86_64-softmmu x86_64-linux-user
744 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
745 MAKE_CHECK_ARGS: check
748 # Check our reduced build configurations
749 build-without-default-devices:
750 extends: .native_build_job_template
752 job: amd64-centos8-container
755 CONFIGURE_ARGS: --without-default-devices --disable-user
757 build-without-default-features:
758 extends: .native_build_job_template
760 job: amd64-debian-container
763 CONFIGURE_ARGS: --without-default-features --disable-user
764 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
765 MAKE_CHECK_ARGS: check-unit
769 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
771 job: amd64-fedora-container
773 - dnf install -y meson ninja-build
775 - mkdir subprojects/libvhost-user/build
776 - cd subprojects/libvhost-user/build
780 # No targets are built here, just tools, docs, and unit tests. This
781 # also feeds into the eventual documentation deployment steps later
782 build-tools-and-docs-debian:
783 extends: .native_build_job_template
785 job: amd64-debian-container
788 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
789 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
795 # Prepare for GitLab pages deployment. Anything copied into the
796 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
798 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
801 - job: build-tools-and-docs-debian
804 # HTML-ised source tree
806 - htags -anT --tree-view=filetree -m qemu_init
807 -t "Welcome to the QEMU sourcecode"
809 # Project documentation
810 - make -C build install DESTDIR=$(pwd)/temp-install
811 - mv temp-install/usr/local/share/doc/qemu/* public/