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 --disable-docs $CONFIGURE_ARGS --target-list="$TARGETS" ;
28 ../configure --enable-werror --disable-docs $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 $(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak)
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 --enable-trace-backends=log,simple,syslog
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-docs --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
226 --enable-modules --enable-trace-backends=dtrace
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
512 <<: *native_test_job_definition
514 - job: build-cfi-aarch64
518 MAKE_CHECK_ARGS: check
520 acceptance-cfi-aarch64:
521 <<: *native_test_job_definition
523 - job: build-cfi-aarch64
527 MAKE_CHECK_ARGS: check-acceptance
528 <<: *acceptance_definition
530 build-cfi-ppc64-s390x:
531 <<: *native_build_job_definition
533 - job: amd64-fedora-container
538 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
539 --enable-safe-stack --enable-slirp=git
540 TARGETS: ppc64-softmmu s390x-softmmu
541 MAKE_CHECK_ARGS: check-build
548 check-cfi-ppc64-s390x:
549 <<: *native_test_job_definition
551 - job: build-cfi-ppc64-s390x
555 MAKE_CHECK_ARGS: check
557 acceptance-cfi-ppc64-s390x:
558 <<: *native_test_job_definition
560 - job: build-cfi-ppc64-s390x
564 MAKE_CHECK_ARGS: check-acceptance
565 <<: *acceptance_definition
568 <<: *native_build_job_definition
570 - job: amd64-fedora-container
575 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
576 --enable-safe-stack --enable-slirp=git
577 TARGETS: x86_64-softmmu
578 MAKE_CHECK_ARGS: check-build
586 <<: *native_test_job_definition
588 - job: build-cfi-x86_64
592 MAKE_CHECK_ARGS: check
594 acceptance-cfi-x86_64:
595 <<: *native_test_job_definition
597 - job: build-cfi-x86_64
601 MAKE_CHECK_ARGS: check-acceptance
602 <<: *acceptance_definition
605 <<: *native_build_job_definition
607 job: amd64-ubuntu2004-container
610 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
611 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
612 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
613 MAKE_CHECK_ARGS: bench V=1
615 # These targets are on the way out
617 <<: *native_build_job_definition
619 job: amd64-debian-user-cross-container
621 IMAGE: debian-all-test-cross
622 CONFIGURE_ARGS: --disable-tools
623 MAKE_CHECK_ARGS: build-tcg
624 TARGETS: ppc64abi32-linux-user lm32-softmmu unicore32-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
646 job: amd64-ubuntu2004-container
649 CONFIGURE_ARGS: --enable-gprof --enable-gcov
650 MAKE_CHECK_ARGS: check
651 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
654 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
657 <<: *native_build_job_definition
659 job: amd64-fedora-container
663 - mkdir build-oss-fuzz
664 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
665 ./scripts/oss-fuzz/build.sh
666 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
667 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
669 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
670 echo Testing ${fuzzer} ... ;
671 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
673 # Unrelated to fuzzer: run some tests with -fsanitize=address
674 - cd build-oss-fuzz && make check-qtest-i386 check-unit
677 <<: *native_build_job_definition
679 job: amd64-debian-user-cross-container
681 IMAGE: debian-all-test-cross
683 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
686 - ../configure --enable-tcg-interpreter
687 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
689 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
690 - for tg in $TARGETS ; do
691 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
692 ./tests/qtest/boot-serial-test || exit 1 ;
693 ./tests/qtest/cdrom-test || exit 1 ;
695 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
696 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
699 # Alternate coroutines implementations are only really of interest to KVM users
700 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
701 build-coroutine-sigaltstack:
702 <<: *native_build_job_definition
704 job: amd64-ubuntu2004-container
707 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
708 --enable-trace-backends=ftrace
709 MAKE_CHECK_ARGS: check-unit
711 # Most jobs test latest gcrypt or nettle builds
713 # These jobs test old gcrypt and nettle from RHEL7
714 # which had some API differences.
716 <<: *native_build_job_definition
718 job: amd64-centos7-container
721 TARGETS: x86_64-softmmu x86_64-linux-user
722 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
723 MAKE_CHECK_ARGS: check
726 <<: *native_build_job_definition
728 job: amd64-centos7-container
731 TARGETS: x86_64-softmmu x86_64-linux-user
732 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
733 MAKE_CHECK_ARGS: check
736 <<: *native_build_job_definition
738 job: amd64-centos7-container
741 TARGETS: x86_64-softmmu x86_64-linux-user
742 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
743 MAKE_CHECK_ARGS: check
746 # Check our reduced build configurations
747 build-without-default-devices:
748 <<: *native_build_job_definition
750 job: amd64-centos8-container
753 CONFIGURE_ARGS: --without-default-devices --disable-user
755 build-without-default-features:
756 <<: *native_build_job_definition
758 job: amd64-debian-container
761 CONFIGURE_ARGS: --without-default-features --disable-user
762 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
763 MAKE_CHECK_ARGS: check-unit
767 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
769 job: amd64-centos8-container
770 script: .gitlab-ci.d/check-patch.py
773 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
780 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
782 job: amd64-centos8-container
783 script: .gitlab-ci.d/check-dco.py
786 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
792 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
794 job: amd64-fedora-container
796 - dnf install -y meson ninja-build
798 - mkdir subprojects/libvhost-user/build
799 - cd subprojects/libvhost-user/build
803 # No targets are built here, just tools, docs, and unit tests. This
804 # also feeds into the eventual documentation deployment steps later
805 build-tools-and-docs-debian:
806 <<: *native_build_job_definition
808 job: amd64-debian-container
811 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
812 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
818 # Prepare for GitLab pages deployment. Anything copied into the
819 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
821 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
824 - job: build-tools-and-docs-debian
827 # HTML-ised source tree
829 - htags -anT --tree-view=filetree -m qemu_init
830 -t "Welcome to the QEMU sourcecode"
832 # Project documentation
833 - make -C build install DESTDIR=$(pwd)/temp-install
834 - mv temp-install/usr/local/share/doc/qemu/* public/