1 # Currently we have two build stages after our containers are built:
2 # - build (for traditional build and test or first stage build)
3 # - test (for test stages, using build artefacts from a build stage)
11 - local: '/.gitlab-ci.d/edk2.yml'
12 - local: '/.gitlab-ci.d/opensbi.yml'
13 - local: '/.gitlab-ci.d/containers.yml'
14 - local: '/.gitlab-ci.d/crossbuilds.yml'
16 .native_build_job_template: &native_build_job_definition
18 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
20 - JOBS=$(expr $(nproc) + 1)
24 - if test -n "$TARGETS";
26 ../configure --enable-werror $CONFIGURE_ARGS --target-list="$TARGETS" ;
28 ../configure --enable-werror $CONFIGURE_ARGS ;
29 fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
30 - if test -n "$LD_JOBS";
32 meson configure . -Dbackend_max_links="$LD_JOBS" ;
35 - if test -n "$MAKE_CHECK_ARGS";
37 make -j"$JOBS" $MAKE_CHECK_ARGS ;
40 .native_test_job_template: &native_test_job_definition
42 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
44 - scripts/git-submodule.sh update
45 $(grep GIT_SUBMODULES build/config-host.mak | sed 's/GIT_SUBMODULES=//')
47 - find . -type f -exec touch {} +
48 # Avoid recompiling by hiding ninja with NINJA=":"
49 - make NINJA=":" $MAKE_CHECK_ARGS
51 .acceptance_template: &acceptance_definition
53 key: "${CI_JOB_NAME}-cache"
55 - ${CI_PROJECT_DIR}/avocado-cache
58 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
62 - build/tests/results/latest/results.xml
63 - build/tests/results/latest/test-results
65 junit: build/tests/results/latest/results.xml
67 - mkdir -p ~/.config/avocado
68 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
69 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
70 >> ~/.config/avocado/avocado.conf
71 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
72 >> ~/.config/avocado/avocado.conf
73 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
74 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
76 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
79 - du -chs ${CI_PROJECT_DIR}/avocado-cache
82 <<: *native_build_job_definition
84 - job: amd64-alpine-container
87 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
88 moxie-softmmu microblazeel-softmmu mips64el-softmmu
89 MAKE_CHECK_ARGS: check-build
90 CONFIGURE_ARGS: --enable-docs
94 - .git-submodule-status
98 <<: *native_test_job_definition
100 - job: build-system-alpine
104 MAKE_CHECK_ARGS: check
106 acceptance-system-alpine:
107 <<: *native_test_job_definition
109 - job: build-system-alpine
113 MAKE_CHECK_ARGS: check-acceptance
114 <<: *acceptance_definition
117 <<: *native_build_job_definition
119 job: amd64-ubuntu2004-container
122 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
123 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
124 moxie-softmmu microblazeel-softmmu mips64el-softmmu
125 MAKE_CHECK_ARGS: check-build
132 <<: *native_test_job_definition
134 - job: build-system-ubuntu
138 MAKE_CHECK_ARGS: check
140 acceptance-system-ubuntu:
141 <<: *native_test_job_definition
143 - job: build-system-ubuntu
147 MAKE_CHECK_ARGS: check-acceptance
148 <<: *acceptance_definition
151 <<: *native_build_job_definition
153 job: amd64-debian-container
156 CONFIGURE_ARGS: --enable-fdt=system
157 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
158 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
159 MAKE_CHECK_ARGS: check-build
166 <<: *native_test_job_definition
168 - job: build-system-debian
172 MAKE_CHECK_ARGS: check
174 # No targets are built here, just tools, docs, and unit tests. This
175 # also feeds into the eventual documentation deployment steps later
176 build-tools-and-docs-debian:
177 <<: *native_build_job_definition
180 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
181 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
187 acceptance-system-debian:
188 <<: *native_test_job_definition
190 - job: build-system-debian
194 MAKE_CHECK_ARGS: check-acceptance
195 <<: *acceptance_definition
198 <<: *native_build_job_definition
200 job: amd64-fedora-container
203 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
204 --enable-fdt=system --enable-slirp=system --enable-capstone=system
205 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
206 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
207 MAKE_CHECK_ARGS: check-build
214 <<: *native_test_job_definition
216 - job: build-system-fedora
220 MAKE_CHECK_ARGS: check
222 acceptance-system-fedora:
223 <<: *native_test_job_definition
225 - job: build-system-fedora
229 MAKE_CHECK_ARGS: check-acceptance
230 <<: *acceptance_definition
233 <<: *native_build_job_definition
235 job: amd64-centos8-container
238 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
240 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
241 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
242 MAKE_CHECK_ARGS: check-build
249 <<: *native_test_job_definition
251 - job: build-system-centos
255 MAKE_CHECK_ARGS: check
257 acceptance-system-centos:
258 <<: *native_test_job_definition
260 - job: build-system-centos
264 MAKE_CHECK_ARGS: check-acceptance
265 <<: *acceptance_definition
267 build-system-opensuse:
268 <<: *native_build_job_definition
270 job: amd64-opensuse-leap-container
273 CONFIGURE_ARGS: --enable-fdt=system
274 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
275 MAKE_CHECK_ARGS: check-build
281 check-system-opensuse:
282 <<: *native_test_job_definition
284 - job: build-system-opensuse
288 MAKE_CHECK_ARGS: check
290 acceptance-system-opensuse:
291 <<: *native_test_job_definition
293 - job: build-system-opensuse
297 MAKE_CHECK_ARGS: check-acceptance
298 <<: *acceptance_definition
302 <<: *native_build_job_definition
304 job: amd64-fedora-container
317 --disable-coroutine-pool
326 --disable-guest-agent
337 --disable-live-block-migration
339 --disable-malloc-trim
348 --disable-qom-cast-debug
351 --disable-replication
364 --disable-vhost-crypto
367 --disable-vhost-kernel
370 --disable-vhost-vsock
371 --disable-virglrenderer
377 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
378 s390x-softmmu i386-linux-user
379 MAKE_CHECK_ARGS: check-qtest SPEED=slow
381 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
382 # the configure script. The container doesn't contain Xen headers so
383 # Xen accelerator is not detected / selected. As result it build the
384 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
387 <<: *native_build_job_definition
389 job: amd64-centos8-container
395 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
398 - make check-qapi-schema
399 - cd tests/qemu-iotests/
400 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
401 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
402 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
403 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
404 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
405 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
406 260 261 262 263 264 270 272 273 277 279
409 <<: *native_build_job_definition
411 job: amd64-debian-user-cross-container
413 IMAGE: debian-all-test-cross
414 CONFIGURE_ARGS: --disable-tools --disable-system
415 MAKE_CHECK_ARGS: check-tcg
418 <<: *native_build_job_definition
420 job: amd64-debian-user-cross-container
422 IMAGE: debian-all-test-cross
423 CONFIGURE_ARGS: --disable-tools --disable-system --static
424 MAKE_CHECK_ARGS: check-tcg
426 # Only build the softmmu targets we have check-tcg tests for
428 <<: *native_build_job_definition
430 job: amd64-debian-user-cross-container
432 IMAGE: debian-all-test-cross
433 CONFIGURE_ARGS: --disable-tools --enable-debug
434 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
435 MAKE_CHECK_ARGS: check-tcg
437 # Run check-tcg against linux-user (with plugins)
438 # we skip sparc64-linux-user until it has been fixed somewhat
439 # we skip cris-linux-user as it doesn't use the common run loop
441 <<: *native_build_job_definition
443 job: amd64-debian-user-cross-container
445 IMAGE: debian-all-test-cross
446 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
447 MAKE_CHECK_ARGS: check-tcg
451 <<: *native_build_job_definition
454 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
455 MAKE_CHECK_ARGS: check-tcg
457 build-some-softmmu-plugins:
458 <<: *native_build_job_definition
460 job: amd64-debian-user-cross-container
462 IMAGE: debian-all-test-cross
463 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
464 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
465 MAKE_CHECK_ARGS: check-tcg
468 <<: *native_build_job_definition
470 job: amd64-fedora-container
473 CONFIGURE_ARGS: --cc=clang --cxx=clang++
474 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
475 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
476 ppc-softmmu s390x-softmmu
477 MAKE_CHECK_ARGS: check-qtest check-tcg
480 <<: *native_build_job_definition
482 IMAGE: debian-all-test-cross
483 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
484 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
485 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
486 MAKE_CHECK_ARGS: check-unit check-tcg
488 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
489 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
490 # triggers an Out-Of-Memory error
492 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
493 # with QEMU and linked as a static library to avoid false positives in CFI checks.
494 # This can be accomplished by using -enable-slirp=git, which avoids the use of
495 # a system-wide version of the library
497 # Split in three sets of build/check/acceptance to limit the execution time of each
500 <<: *native_build_job_definition
502 - job: amd64-fedora-container
507 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
508 --enable-safe-stack --enable-slirp=git
509 TARGETS: aarch64-softmmu
510 MAKE_CHECK_ARGS: check-build
517 <<: *native_test_job_definition
519 - job: build-cfi-aarch64
523 MAKE_CHECK_ARGS: check
525 acceptance-cfi-aarch64:
526 <<: *native_test_job_definition
528 - job: build-cfi-aarch64
532 MAKE_CHECK_ARGS: check-acceptance
533 <<: *acceptance_definition
535 build-cfi-ppc64-s390x:
536 <<: *native_build_job_definition
538 - job: amd64-fedora-container
543 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
544 --enable-safe-stack --enable-slirp=git
545 TARGETS: ppc64-softmmu s390x-softmmu
546 MAKE_CHECK_ARGS: check-build
552 check-cfi-ppc64-s390x:
553 <<: *native_test_job_definition
555 - job: build-cfi-ppc64-s390x
559 MAKE_CHECK_ARGS: check
561 acceptance-cfi-ppc64-s390x:
562 <<: *native_test_job_definition
564 - job: build-cfi-ppc64-s390x
568 MAKE_CHECK_ARGS: check-acceptance
569 <<: *acceptance_definition
572 <<: *native_build_job_definition
574 - job: amd64-fedora-container
579 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
580 --enable-safe-stack --enable-slirp=git
581 TARGETS: x86_64-softmmu
582 MAKE_CHECK_ARGS: check-build
589 <<: *native_test_job_definition
591 - job: build-cfi-x86_64
595 MAKE_CHECK_ARGS: check
597 acceptance-cfi-x86_64:
598 <<: *native_test_job_definition
600 - job: build-cfi-x86_64
604 MAKE_CHECK_ARGS: check-acceptance
605 <<: *acceptance_definition
608 <<: *native_build_job_definition
611 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs
612 --enable-fdt=system --enable-slirp=system
613 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
614 MAKE_CHECK_ARGS: bench V=1
616 # These targets are on the way out
618 <<: *native_build_job_definition
620 job: amd64-debian-user-cross-container
622 IMAGE: debian-all-test-cross
623 CONFIGURE_ARGS: --disable-docs --disable-tools
624 MAKE_CHECK_ARGS: build-tcg
625 TARGETS: ppc64abi32-linux-user lm32-softmmu unicore32-softmmu
631 # We split the check-tcg step as test failures are expected but we still
632 # want to catch the build breaking.
634 <<: *native_test_job_definition
636 - job: build-deprecated
639 IMAGE: debian-all-test-cross
640 MAKE_CHECK_ARGS: check-tcg
643 # gprof/gcov are GCC features
645 <<: *native_build_job_definition
648 CONFIGURE_ARGS: --enable-gprof --enable-gcov
649 MAKE_CHECK_ARGS: check
650 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
653 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
656 <<: *native_build_job_definition
658 job: amd64-fedora-container
662 - mkdir build-oss-fuzz
663 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
664 ./scripts/oss-fuzz/build.sh
665 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
666 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
668 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
669 echo Testing ${fuzzer} ... ;
670 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
672 # Unrelated to fuzzer: run some tests with -fsanitize=address
673 - cd build-oss-fuzz && make check-qtest-i386 check-unit
676 <<: *native_build_job_definition
678 job: amd64-debian-user-cross-container
680 IMAGE: debian-all-test-cross
682 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
685 - ../configure --enable-tcg-interpreter
686 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
688 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
689 - for tg in $TARGETS ; do
690 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
691 ./tests/qtest/boot-serial-test || exit 1 ;
692 ./tests/qtest/cdrom-test || exit 1 ;
694 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
695 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
698 # Alternate coroutines implementations are only really of interest to KVM users
699 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
700 build-coroutine-ucontext:
701 <<: *native_build_job_definition
703 job: amd64-ubuntu2004-container
706 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
707 MAKE_CHECK_ARGS: check-unit
709 build-coroutine-sigaltstack:
710 <<: *native_build_job_definition
712 job: amd64-ubuntu2004-container
715 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
716 MAKE_CHECK_ARGS: check-unit
718 # Most jobs test latest gcrypt or nettle builds
720 # These jobs test old gcrypt and nettle from RHEL7
721 # which had some API differences.
722 build-crypto-old-nettle:
723 <<: *native_build_job_definition
725 job: amd64-centos7-container
728 TARGETS: x86_64-softmmu x86_64-linux-user
729 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
730 MAKE_CHECK_ARGS: check-build
735 check-crypto-old-nettle:
736 <<: *native_test_job_definition
738 - job: build-crypto-old-nettle
742 MAKE_CHECK_ARGS: check
745 build-crypto-old-gcrypt:
746 <<: *native_build_job_definition
748 job: amd64-centos7-container
751 TARGETS: x86_64-softmmu x86_64-linux-user
752 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
753 MAKE_CHECK_ARGS: check-build
758 check-crypto-old-gcrypt:
759 <<: *native_test_job_definition
761 - job: build-crypto-old-gcrypt
765 MAKE_CHECK_ARGS: check
768 build-crypto-only-gnutls:
769 <<: *native_build_job_definition
771 job: amd64-centos7-container
774 TARGETS: x86_64-softmmu x86_64-linux-user
775 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
776 MAKE_CHECK_ARGS: check-build
781 check-crypto-only-gnutls:
782 <<: *native_test_job_definition
784 - job: build-crypto-only-gnutls
788 MAKE_CHECK_ARGS: check
790 # We don't need to exercise every backend with every front-end
791 build-trace-multi-user:
792 <<: *native_build_job_definition
794 job: amd64-ubuntu2004-container
797 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
799 build-trace-ftrace-system:
800 <<: *native_build_job_definition
802 job: amd64-ubuntu2004-container
805 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
807 build-trace-ust-system:
808 <<: *native_build_job_definition
810 job: amd64-ubuntu2004-container
813 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
815 # Check our reduced build configurations
816 build-without-default-devices:
817 <<: *native_build_job_definition
819 job: amd64-centos8-container
822 CONFIGURE_ARGS: --without-default-devices --disable-user
824 build-without-default-features:
825 <<: *native_build_job_definition
827 job: amd64-debian-container
830 CONFIGURE_ARGS: --without-default-features --disable-user
831 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
832 MAKE_CHECK_ARGS: check-unit
836 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
838 job: amd64-centos8-container
839 script: .gitlab-ci.d/check-patch.py
842 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
849 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
851 job: amd64-centos8-container
852 script: .gitlab-ci.d/check-dco.py
855 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
861 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
863 job: amd64-fedora-container
865 - dnf install -y meson ninja-build
867 - mkdir subprojects/libvhost-user/build
868 - cd subprojects/libvhost-user/build
872 # Prepare for GitLab pages deployment. Anything copied into the
873 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
875 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
878 - job: build-tools-and-docs-debian
881 # HTML-ised source tree
883 - htags -anT --tree-view=filetree -m qemu_init
884 -t "Welcome to the QEMU sourcecode"
886 # Project documentation
887 - make -C build install DESTDIR=$(pwd)/temp-install
888 - mv temp-install/usr/local/share/doc/qemu/* public/