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
85 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
86 moxie-softmmu microblazeel-softmmu mips64el-softmmu
87 MAKE_CHECK_ARGS: check-build
88 CONFIGURE_ARGS: --enable-docs
92 - .git-submodule-status
96 <<: *native_test_job_definition
98 - job: build-system-alpine
102 MAKE_CHECK_ARGS: check
104 acceptance-system-alpine:
105 <<: *native_test_job_definition
107 - job: build-system-alpine
111 MAKE_CHECK_ARGS: check-acceptance
112 <<: *acceptance_definition
115 <<: *native_build_job_definition
117 job: amd64-ubuntu2004-container
120 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
121 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
122 moxie-softmmu microblazeel-softmmu mips64el-softmmu
123 MAKE_CHECK_ARGS: check-build
130 <<: *native_test_job_definition
132 - job: build-system-ubuntu
136 MAKE_CHECK_ARGS: check
138 acceptance-system-ubuntu:
139 <<: *native_test_job_definition
141 - job: build-system-ubuntu
145 MAKE_CHECK_ARGS: check-acceptance
146 <<: *acceptance_definition
149 <<: *native_build_job_definition
151 job: amd64-debian-container
154 CONFIGURE_ARGS: --enable-fdt=system
155 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
156 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
157 MAKE_CHECK_ARGS: check-build
164 <<: *native_test_job_definition
166 - job: build-system-debian
170 MAKE_CHECK_ARGS: check
172 # No targets are built here, just tools, docs, and unit tests. This
173 # also feeds into the eventual documentation deployment steps later
174 build-tools-and-docs-debian:
175 <<: *native_build_job_definition
178 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
179 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
185 acceptance-system-debian:
186 <<: *native_test_job_definition
188 - job: build-system-debian
192 MAKE_CHECK_ARGS: check-acceptance
193 <<: *acceptance_definition
196 <<: *native_build_job_definition
198 job: amd64-fedora-container
201 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
202 --enable-fdt=system --enable-slirp=system --enable-capstone=system
203 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
204 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
205 MAKE_CHECK_ARGS: check-build
212 <<: *native_test_job_definition
214 - job: build-system-fedora
218 MAKE_CHECK_ARGS: check
220 acceptance-system-fedora:
221 <<: *native_test_job_definition
223 - job: build-system-fedora
227 MAKE_CHECK_ARGS: check-acceptance
228 <<: *acceptance_definition
231 <<: *native_build_job_definition
233 job: amd64-centos8-container
236 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
238 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
239 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
240 MAKE_CHECK_ARGS: check-build
247 <<: *native_test_job_definition
249 - job: build-system-centos
253 MAKE_CHECK_ARGS: check
255 acceptance-system-centos:
256 <<: *native_test_job_definition
258 - job: build-system-centos
262 MAKE_CHECK_ARGS: check-acceptance
263 <<: *acceptance_definition
265 build-system-opensuse:
266 <<: *native_build_job_definition
268 job: amd64-opensuse-leap-container
271 CONFIGURE_ARGS: --enable-fdt=system
272 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
273 MAKE_CHECK_ARGS: check-build
279 check-system-opensuse:
280 <<: *native_test_job_definition
282 - job: build-system-opensuse
286 MAKE_CHECK_ARGS: check
288 acceptance-system-opensuse:
289 <<: *native_test_job_definition
291 - job: build-system-opensuse
295 MAKE_CHECK_ARGS: check-acceptance
296 <<: *acceptance_definition
300 <<: *native_build_job_definition
302 job: amd64-fedora-container
315 --disable-coroutine-pool
324 --disable-guest-agent
335 --disable-live-block-migration
337 --disable-malloc-trim
346 --disable-qom-cast-debug
349 --disable-replication
362 --disable-vhost-crypto
365 --disable-vhost-kernel
368 --disable-vhost-vsock
369 --disable-virglrenderer
375 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
376 s390x-softmmu i386-linux-user
377 MAKE_CHECK_ARGS: check-qtest SPEED=slow
379 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
380 # the configure script. The container doesn't contain Xen headers so
381 # Xen accelerator is not detected / selected. As result it build the
382 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
385 <<: *native_build_job_definition
387 job: amd64-centos8-container
393 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
396 - make check-qapi-schema
397 - cd tests/qemu-iotests/
398 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
399 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
400 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
401 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
402 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
403 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
404 260 261 262 263 264 270 272 273 277 279
407 <<: *native_build_job_definition
409 job: amd64-debian-user-cross-container
411 IMAGE: debian-all-test-cross
412 CONFIGURE_ARGS: --disable-tools --disable-system
413 MAKE_CHECK_ARGS: check-tcg
416 <<: *native_build_job_definition
418 job: amd64-debian-user-cross-container
420 IMAGE: debian-all-test-cross
421 CONFIGURE_ARGS: --disable-tools --disable-system --static
422 MAKE_CHECK_ARGS: check-tcg
424 # Only build the softmmu targets we have check-tcg tests for
426 <<: *native_build_job_definition
428 job: amd64-debian-user-cross-container
430 IMAGE: debian-all-test-cross
431 CONFIGURE_ARGS: --disable-tools --enable-debug
432 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
433 MAKE_CHECK_ARGS: check-tcg
435 # Run check-tcg against linux-user (with plugins)
436 # we skip sparc64-linux-user until it has been fixed somewhat
437 # we skip cris-linux-user as it doesn't use the common run loop
439 <<: *native_build_job_definition
441 job: amd64-debian-user-cross-container
443 IMAGE: debian-all-test-cross
444 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
445 MAKE_CHECK_ARGS: check-tcg
449 <<: *native_build_job_definition
452 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
453 MAKE_CHECK_ARGS: check-tcg
455 build-some-softmmu-plugins:
456 <<: *native_build_job_definition
458 job: amd64-debian-user-cross-container
460 IMAGE: debian-all-test-cross
461 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
462 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
463 MAKE_CHECK_ARGS: check-tcg
466 <<: *native_build_job_definition
468 job: amd64-fedora-container
471 CONFIGURE_ARGS: --cc=clang --cxx=clang++
472 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
473 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
474 ppc-softmmu s390x-softmmu
475 MAKE_CHECK_ARGS: check-qtest check-tcg
478 <<: *native_build_job_definition
480 IMAGE: debian-all-test-cross
481 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
482 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
483 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
484 MAKE_CHECK_ARGS: check-unit check-tcg
486 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
487 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
488 # triggers an Out-Of-Memory error
490 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
491 # with QEMU and linked as a static library to avoid false positives in CFI checks.
492 # This can be accomplished by using -enable-slirp=git, which avoids the use of
493 # a system-wide version of the library
495 # Split in three sets of build/check/acceptance to limit the execution time of each
498 <<: *native_build_job_definition
500 - job: amd64-fedora-container
505 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
506 --enable-safe-stack --enable-slirp=git
507 TARGETS: aarch64-softmmu
508 MAKE_CHECK_ARGS: check-build
515 <<: *native_test_job_definition
517 - job: build-cfi-aarch64
521 MAKE_CHECK_ARGS: check
523 acceptance-cfi-aarch64:
524 <<: *native_test_job_definition
526 - job: build-cfi-aarch64
530 MAKE_CHECK_ARGS: check-acceptance
531 <<: *acceptance_definition
533 build-cfi-ppc64-s390x:
534 <<: *native_build_job_definition
536 - job: amd64-fedora-container
541 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
542 --enable-safe-stack --enable-slirp=git
543 TARGETS: ppc64-softmmu s390x-softmmu
544 MAKE_CHECK_ARGS: check-build
550 check-cfi-ppc64-s390x:
551 <<: *native_test_job_definition
553 - job: build-cfi-ppc64-s390x
557 MAKE_CHECK_ARGS: check
559 acceptance-cfi-ppc64-s390x:
560 <<: *native_test_job_definition
562 - job: build-cfi-ppc64-s390x
566 MAKE_CHECK_ARGS: check-acceptance
567 <<: *acceptance_definition
570 <<: *native_build_job_definition
572 - job: amd64-fedora-container
577 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
578 --enable-safe-stack --enable-slirp=git
579 TARGETS: x86_64-softmmu
580 MAKE_CHECK_ARGS: check-build
587 <<: *native_test_job_definition
589 - job: build-cfi-x86_64
593 MAKE_CHECK_ARGS: check
595 acceptance-cfi-x86_64:
596 <<: *native_test_job_definition
598 - job: build-cfi-x86_64
602 MAKE_CHECK_ARGS: check-acceptance
603 <<: *acceptance_definition
606 <<: *native_build_job_definition
609 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs
610 --enable-fdt=system --enable-slirp=system
611 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
612 MAKE_CHECK_ARGS: bench V=1
614 # These targets are on the way out
616 <<: *native_build_job_definition
618 job: amd64-debian-user-cross-container
620 IMAGE: debian-all-test-cross
621 CONFIGURE_ARGS: --disable-docs --disable-tools
622 MAKE_CHECK_ARGS: build-tcg
623 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
630 # We split the check-tcg step as test failures are expected but we still
631 # want to catch the build breaking.
633 <<: *native_test_job_definition
635 - job: build-deprecated
638 IMAGE: debian-all-test-cross
639 MAKE_CHECK_ARGS: check-tcg
642 # gprof/gcov are GCC features
644 <<: *native_build_job_definition
647 CONFIGURE_ARGS: --enable-gprof --enable-gcov
648 MAKE_CHECK_ARGS: check
649 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
652 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
655 <<: *native_build_job_definition
657 job: amd64-fedora-container
661 - mkdir build-oss-fuzz
662 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
663 ./scripts/oss-fuzz/build.sh
664 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
665 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
667 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
668 echo Testing ${fuzzer} ... ;
669 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
671 # Unrelated to fuzzer: run some tests with -fsanitize=address
672 - cd build-oss-fuzz && make check-qtest-i386 check-unit
675 <<: *native_build_job_definition
677 job: amd64-debian-user-cross-container
679 IMAGE: debian-all-test-cross
681 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
684 - ../configure --enable-tcg-interpreter
685 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
687 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
688 - for tg in $TARGETS ; do
689 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
690 ./tests/qtest/boot-serial-test || exit 1 ;
691 ./tests/qtest/cdrom-test || exit 1 ;
693 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
694 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
697 # Alternate coroutines implementations are only really of interest to KVM users
698 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
699 build-coroutine-ucontext:
700 <<: *native_build_job_definition
702 job: amd64-ubuntu2004-container
705 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
706 MAKE_CHECK_ARGS: check-unit
708 build-coroutine-sigaltstack:
709 <<: *native_build_job_definition
711 job: amd64-ubuntu2004-container
714 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
715 MAKE_CHECK_ARGS: check-unit
717 # Most jobs test latest gcrypt or nettle builds
719 # These jobs test old gcrypt and nettle from RHEL7
720 # which had some API differences.
721 build-crypto-old-nettle:
722 <<: *native_build_job_definition
724 job: amd64-centos7-container
727 TARGETS: x86_64-softmmu x86_64-linux-user
728 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
729 MAKE_CHECK_ARGS: check-build
734 check-crypto-old-nettle:
735 <<: *native_test_job_definition
737 - job: build-crypto-old-nettle
741 MAKE_CHECK_ARGS: check
744 build-crypto-old-gcrypt:
745 <<: *native_build_job_definition
747 job: amd64-centos7-container
750 TARGETS: x86_64-softmmu x86_64-linux-user
751 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
752 MAKE_CHECK_ARGS: check-build
757 check-crypto-old-gcrypt:
758 <<: *native_test_job_definition
760 - job: build-crypto-old-gcrypt
764 MAKE_CHECK_ARGS: check
767 build-crypto-only-gnutls:
768 <<: *native_build_job_definition
770 job: amd64-centos7-container
773 TARGETS: x86_64-softmmu x86_64-linux-user
774 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
775 MAKE_CHECK_ARGS: check-build
780 check-crypto-only-gnutls:
781 <<: *native_test_job_definition
783 - job: build-crypto-only-gnutls
787 MAKE_CHECK_ARGS: check
789 # We don't need to exercise every backend with every front-end
790 build-trace-multi-user:
791 <<: *native_build_job_definition
793 job: amd64-ubuntu2004-container
796 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
798 build-trace-ftrace-system:
799 <<: *native_build_job_definition
801 job: amd64-ubuntu2004-container
804 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
806 build-trace-ust-system:
807 <<: *native_build_job_definition
809 job: amd64-ubuntu2004-container
812 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
814 # Check our reduced build configurations
815 build-without-default-devices:
816 <<: *native_build_job_definition
818 job: amd64-centos8-container
821 CONFIGURE_ARGS: --without-default-devices --disable-user
823 build-without-default-features:
824 <<: *native_build_job_definition
826 job: amd64-debian-container
829 CONFIGURE_ARGS: --without-default-features --disable-user
830 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
831 MAKE_CHECK_ARGS: check-unit
835 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
837 job: amd64-centos8-container
838 script: .gitlab-ci.d/check-patch.py
841 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
848 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
850 job: amd64-centos8-container
851 script: .gitlab-ci.d/check-dco.py
854 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
860 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
862 job: amd64-fedora-container
864 - dnf install -y meson ninja-build
866 - mkdir subprojects/libvhost-user/build
867 - cd subprojects/libvhost-user/build
871 # Prepare for GitLab pages deployment. Anything copied into the
872 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
874 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
877 - job: build-tools-and-docs-debian
880 # HTML-ised source tree
882 - htags -anT --tree-view=filetree -m qemu_init
883 -t "Welcome to the QEMU sourcecode"
885 # Project documentation
886 - make -C build install DESTDIR=$(pwd)/temp-install
887 - mv temp-install/usr/local/share/doc/qemu/* public/