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 acceptance-system-debian:
175 <<: *native_test_job_definition
177 - job: build-system-debian
181 MAKE_CHECK_ARGS: check-acceptance
182 <<: *acceptance_definition
185 <<: *native_build_job_definition
187 job: amd64-fedora-container
190 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
191 --enable-fdt=system --enable-slirp=system --enable-capstone=system
192 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
193 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
194 MAKE_CHECK_ARGS: check-build
201 <<: *native_test_job_definition
203 - job: build-system-fedora
207 MAKE_CHECK_ARGS: check
209 acceptance-system-fedora:
210 <<: *native_test_job_definition
212 - job: build-system-fedora
216 MAKE_CHECK_ARGS: check-acceptance
217 <<: *acceptance_definition
220 <<: *native_build_job_definition
222 job: amd64-centos8-container
225 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
227 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
228 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
229 MAKE_CHECK_ARGS: check-build
236 <<: *native_test_job_definition
238 - job: build-system-centos
242 MAKE_CHECK_ARGS: check
244 acceptance-system-centos:
245 <<: *native_test_job_definition
247 - job: build-system-centos
251 MAKE_CHECK_ARGS: check-acceptance
252 <<: *acceptance_definition
254 build-system-opensuse:
255 <<: *native_build_job_definition
257 job: amd64-opensuse-leap-container
260 CONFIGURE_ARGS: --enable-fdt=system
261 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
262 MAKE_CHECK_ARGS: check-build
268 check-system-opensuse:
269 <<: *native_test_job_definition
271 - job: build-system-opensuse
275 MAKE_CHECK_ARGS: check
277 acceptance-system-opensuse:
278 <<: *native_test_job_definition
280 - job: build-system-opensuse
284 MAKE_CHECK_ARGS: check-acceptance
285 <<: *acceptance_definition
289 <<: *native_build_job_definition
291 job: amd64-fedora-container
304 --disable-coroutine-pool
313 --disable-guest-agent
324 --disable-live-block-migration
326 --disable-malloc-trim
335 --disable-qom-cast-debug
338 --disable-replication
351 --disable-vhost-crypto
354 --disable-vhost-kernel
357 --disable-vhost-vsock
358 --disable-virglrenderer
364 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
365 s390x-softmmu i386-linux-user
366 MAKE_CHECK_ARGS: check-qtest SPEED=slow
368 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
369 # the configure script. The container doesn't contain Xen headers so
370 # Xen accelerator is not detected / selected. As result it build the
371 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
373 # Also use a different coroutine implementation (which is only really of
374 # interest to KVM users, i.e. with TCG disabled)
376 <<: *native_build_job_definition
378 job: amd64-centos8-container
384 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
385 || { cat config.log meson-logs/meson-log.txt && exit 1; }
388 - make check-qapi-schema
389 - cd tests/qemu-iotests/
390 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
391 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
392 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
393 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
394 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
395 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
396 260 261 262 263 264 270 272 273 277 279
399 <<: *native_build_job_definition
401 job: amd64-debian-user-cross-container
403 IMAGE: debian-all-test-cross
404 CONFIGURE_ARGS: --disable-tools --disable-system
405 MAKE_CHECK_ARGS: check-tcg
408 <<: *native_build_job_definition
410 job: amd64-debian-user-cross-container
412 IMAGE: debian-all-test-cross
413 CONFIGURE_ARGS: --disable-tools --disable-system --static
414 MAKE_CHECK_ARGS: check-tcg
416 # Only build the softmmu targets we have check-tcg tests for
418 <<: *native_build_job_definition
420 job: amd64-debian-user-cross-container
422 IMAGE: debian-all-test-cross
423 CONFIGURE_ARGS: --disable-tools --enable-debug
424 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
425 MAKE_CHECK_ARGS: check-tcg
427 # Run check-tcg against linux-user (with plugins)
428 # we skip sparc64-linux-user until it has been fixed somewhat
429 # we skip cris-linux-user as it doesn't use the common run loop
431 <<: *native_build_job_definition
433 job: amd64-debian-user-cross-container
435 IMAGE: debian-all-test-cross
436 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
437 MAKE_CHECK_ARGS: check-tcg
441 <<: *native_build_job_definition
443 job: amd64-centos7-container
446 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
447 MAKE_CHECK_ARGS: check-tcg
449 build-some-softmmu-plugins:
450 <<: *native_build_job_definition
452 job: amd64-debian-user-cross-container
454 IMAGE: debian-all-test-cross
455 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
456 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
457 MAKE_CHECK_ARGS: check-tcg
460 <<: *native_build_job_definition
462 job: amd64-fedora-container
465 CONFIGURE_ARGS: --cc=clang --cxx=clang++
466 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
467 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
468 ppc-softmmu s390x-softmmu
469 MAKE_CHECK_ARGS: check-qtest check-tcg
472 <<: *native_build_job_definition
474 job: amd64-debian-user-cross-container
476 IMAGE: debian-all-test-cross
477 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
478 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
479 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
480 MAKE_CHECK_ARGS: check-unit check-tcg
482 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
483 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
484 # triggers an Out-Of-Memory error
486 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
487 # with QEMU and linked as a static library to avoid false positives in CFI checks.
488 # This can be accomplished by using -enable-slirp=git, which avoids the use of
489 # a system-wide version of the library
491 # Split in three sets of build/check/acceptance to limit the execution time of each
494 <<: *native_build_job_definition
496 - job: amd64-fedora-container
501 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
502 --enable-safe-stack --enable-slirp=git
503 TARGETS: aarch64-softmmu
504 MAKE_CHECK_ARGS: check-build
511 <<: *native_test_job_definition
513 - job: build-cfi-aarch64
517 MAKE_CHECK_ARGS: check
519 acceptance-cfi-aarch64:
520 <<: *native_test_job_definition
522 - job: build-cfi-aarch64
526 MAKE_CHECK_ARGS: check-acceptance
527 <<: *acceptance_definition
529 build-cfi-ppc64-s390x:
530 <<: *native_build_job_definition
532 - job: amd64-fedora-container
537 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
538 --enable-safe-stack --enable-slirp=git
539 TARGETS: ppc64-softmmu s390x-softmmu
540 MAKE_CHECK_ARGS: check-build
546 check-cfi-ppc64-s390x:
547 <<: *native_test_job_definition
549 - job: build-cfi-ppc64-s390x
553 MAKE_CHECK_ARGS: check
555 acceptance-cfi-ppc64-s390x:
556 <<: *native_test_job_definition
558 - job: build-cfi-ppc64-s390x
562 MAKE_CHECK_ARGS: check-acceptance
563 <<: *acceptance_definition
566 <<: *native_build_job_definition
568 - job: amd64-fedora-container
573 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
574 --enable-safe-stack --enable-slirp=git
575 TARGETS: x86_64-softmmu
576 MAKE_CHECK_ARGS: check-build
583 <<: *native_test_job_definition
585 - job: build-cfi-x86_64
589 MAKE_CHECK_ARGS: check
591 acceptance-cfi-x86_64:
592 <<: *native_test_job_definition
594 - job: build-cfi-x86_64
598 MAKE_CHECK_ARGS: check-acceptance
599 <<: *acceptance_definition
602 <<: *native_build_job_definition
604 job: amd64-ubuntu2004-container
607 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 --disable-docs
608 --enable-fdt=system --enable-slirp=system
609 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
610 MAKE_CHECK_ARGS: bench V=1
612 # These targets are on the way out
614 <<: *native_build_job_definition
616 job: amd64-debian-user-cross-container
618 IMAGE: debian-all-test-cross
619 CONFIGURE_ARGS: --disable-docs --disable-tools
620 MAKE_CHECK_ARGS: build-tcg
621 TARGETS: ppc64abi32-linux-user lm32-softmmu unicore32-softmmu
627 # We split the check-tcg step as test failures are expected but we still
628 # want to catch the build breaking.
630 <<: *native_test_job_definition
632 - job: build-deprecated
635 IMAGE: debian-all-test-cross
636 MAKE_CHECK_ARGS: check-tcg
639 # gprof/gcov are GCC features
641 <<: *native_build_job_definition
643 job: amd64-ubuntu2004-container
646 CONFIGURE_ARGS: --enable-gprof --enable-gcov
647 MAKE_CHECK_ARGS: check
648 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
651 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
654 <<: *native_build_job_definition
656 job: amd64-fedora-container
660 - mkdir build-oss-fuzz
661 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
662 ./scripts/oss-fuzz/build.sh
663 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
664 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
666 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
667 echo Testing ${fuzzer} ... ;
668 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
670 # Unrelated to fuzzer: run some tests with -fsanitize=address
671 - cd build-oss-fuzz && make check-qtest-i386 check-unit
674 <<: *native_build_job_definition
676 job: amd64-debian-user-cross-container
678 IMAGE: debian-all-test-cross
680 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
683 - ../configure --enable-tcg-interpreter
684 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
686 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
687 - for tg in $TARGETS ; do
688 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
689 ./tests/qtest/boot-serial-test || exit 1 ;
690 ./tests/qtest/cdrom-test || exit 1 ;
692 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
693 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
696 # Alternate coroutines implementations are only really of interest to KVM users
697 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
698 build-coroutine-sigaltstack:
699 <<: *native_build_job_definition
701 job: amd64-ubuntu2004-container
704 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
705 MAKE_CHECK_ARGS: check-unit
707 # Most jobs test latest gcrypt or nettle builds
709 # These jobs test old gcrypt and nettle from RHEL7
710 # which had some API differences.
712 <<: *native_build_job_definition
714 job: amd64-centos7-container
717 TARGETS: x86_64-softmmu x86_64-linux-user
718 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
719 MAKE_CHECK_ARGS: check
722 <<: *native_build_job_definition
724 job: amd64-centos7-container
727 TARGETS: x86_64-softmmu x86_64-linux-user
728 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
729 MAKE_CHECK_ARGS: check
732 <<: *native_build_job_definition
734 job: amd64-centos7-container
737 TARGETS: x86_64-softmmu x86_64-linux-user
738 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
739 MAKE_CHECK_ARGS: check
742 # We don't need to exercise every backend with every front-end
743 build-trace-multi-user:
744 <<: *native_build_job_definition
746 job: amd64-ubuntu2004-container
749 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
751 build-trace-ftrace-system:
752 <<: *native_build_job_definition
754 job: amd64-ubuntu2004-container
757 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
759 build-trace-ust-system:
760 <<: *native_build_job_definition
762 job: amd64-ubuntu2004-container
765 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
767 # Check our reduced build configurations
768 build-without-default-devices:
769 <<: *native_build_job_definition
771 job: amd64-centos8-container
774 CONFIGURE_ARGS: --without-default-devices --disable-user
776 build-without-default-features:
777 <<: *native_build_job_definition
779 job: amd64-debian-container
782 CONFIGURE_ARGS: --without-default-features --disable-user
783 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
784 MAKE_CHECK_ARGS: check-unit
788 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
790 job: amd64-centos8-container
791 script: .gitlab-ci.d/check-patch.py
794 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
801 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
803 job: amd64-centos8-container
804 script: .gitlab-ci.d/check-dco.py
807 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
813 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
815 job: amd64-fedora-container
817 - dnf install -y meson ninja-build
819 - mkdir subprojects/libvhost-user/build
820 - cd subprojects/libvhost-user/build
824 # No targets are built here, just tools, docs, and unit tests. This
825 # also feeds into the eventual documentation deployment steps later
826 build-tools-and-docs-debian:
827 <<: *native_build_job_definition
829 job: amd64-debian-container
832 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
833 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
839 # Prepare for GitLab pages deployment. Anything copied into the
840 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
842 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
845 - job: build-tools-and-docs-debian
848 # HTML-ised source tree
850 - htags -anT --tree-view=filetree -m qemu_init
851 -t "Welcome to the QEMU sourcecode"
853 # Project documentation
854 - make -C build install DESTDIR=$(pwd)/temp-install
855 - mv temp-install/usr/local/share/doc/qemu/* public/