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)
22 - if test -n "$LD_JOBS";
24 scripts/git-submodule.sh update meson ;
28 - if test -n "$TARGETS";
30 ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=internal} $CONFIGURE_ARGS --target-list="$TARGETS" ;
32 ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=internal} $CONFIGURE_ARGS ;
33 fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
34 - if test -n "$LD_JOBS";
36 ../meson/meson.py configure . -Dbackend_max_links="$LD_JOBS" ;
39 - if test -n "$MAKE_CHECK_ARGS";
41 make -j"$JOBS" $MAKE_CHECK_ARGS ;
44 .native_test_job_template: &native_test_job_definition
46 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
48 - scripts/git-submodule.sh update
49 $(sed -n '/GIT_SUBMODULES=/ s/.*=// p' build/config-host.mak)
51 - find . -type f -exec touch {} +
52 # Avoid recompiling by hiding ninja with NINJA=":"
53 - make NINJA=":" $MAKE_CHECK_ARGS
55 .acceptance_template: &acceptance_definition
57 key: "${CI_JOB_NAME}-cache"
59 - ${CI_PROJECT_DIR}/avocado-cache
62 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
66 - build/tests/results/latest/results.xml
67 - build/tests/results/latest/test-results
69 junit: build/tests/results/latest/results.xml
71 - mkdir -p ~/.config/avocado
72 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
73 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
74 >> ~/.config/avocado/avocado.conf
75 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
76 >> ~/.config/avocado/avocado.conf
77 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
78 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
80 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
83 - du -chs ${CI_PROJECT_DIR}/avocado-cache
86 <<: *native_build_job_definition
88 - job: amd64-alpine-container
91 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
92 moxie-softmmu microblazeel-softmmu mips64el-softmmu
93 MAKE_CHECK_ARGS: check-build
94 CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
98 - .git-submodule-status
102 <<: *native_test_job_definition
104 - job: build-system-alpine
108 MAKE_CHECK_ARGS: check
110 acceptance-system-alpine:
111 <<: *native_test_job_definition
113 - job: build-system-alpine
117 MAKE_CHECK_ARGS: check-acceptance
118 <<: *acceptance_definition
121 <<: *native_build_job_definition
123 job: amd64-ubuntu2004-container
126 CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
127 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
128 moxie-softmmu microblazeel-softmmu mips64el-softmmu
129 MAKE_CHECK_ARGS: check-build
136 <<: *native_test_job_definition
138 - job: build-system-ubuntu
142 MAKE_CHECK_ARGS: check
144 acceptance-system-ubuntu:
145 <<: *native_test_job_definition
147 - job: build-system-ubuntu
151 MAKE_CHECK_ARGS: check-acceptance
152 <<: *acceptance_definition
155 <<: *native_build_job_definition
157 job: amd64-debian-container
160 CONFIGURE_ARGS: --enable-fdt=system
161 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
162 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
163 MAKE_CHECK_ARGS: check-build
170 <<: *native_test_job_definition
172 - job: build-system-debian
176 MAKE_CHECK_ARGS: check
178 acceptance-system-debian:
179 <<: *native_test_job_definition
181 - job: build-system-debian
185 MAKE_CHECK_ARGS: check-acceptance
186 <<: *acceptance_definition
189 <<: *native_build_job_definition
191 job: amd64-fedora-container
194 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
195 --enable-fdt=system --enable-slirp=system --enable-capstone=system
196 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
197 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
198 MAKE_CHECK_ARGS: check-build
205 <<: *native_test_job_definition
207 - job: build-system-fedora
211 MAKE_CHECK_ARGS: check
213 acceptance-system-fedora:
214 <<: *native_test_job_definition
216 - job: build-system-fedora
220 MAKE_CHECK_ARGS: check-acceptance
221 <<: *acceptance_definition
224 <<: *native_build_job_definition
226 job: amd64-centos8-container
229 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
230 --enable-modules --enable-trace-backends=dtrace
231 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
232 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
233 MAKE_CHECK_ARGS: check-build
240 <<: *native_test_job_definition
242 - job: build-system-centos
246 MAKE_CHECK_ARGS: check
248 acceptance-system-centos:
249 <<: *native_test_job_definition
251 - job: build-system-centos
255 MAKE_CHECK_ARGS: check-acceptance
256 <<: *acceptance_definition
258 build-system-opensuse:
259 <<: *native_build_job_definition
261 job: amd64-opensuse-leap-container
264 CONFIGURE_ARGS: --enable-fdt=system
265 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
266 MAKE_CHECK_ARGS: check-build
272 check-system-opensuse:
273 <<: *native_test_job_definition
275 - job: build-system-opensuse
279 MAKE_CHECK_ARGS: check
281 acceptance-system-opensuse:
282 <<: *native_test_job_definition
284 - job: build-system-opensuse
288 MAKE_CHECK_ARGS: check-acceptance
289 <<: *acceptance_definition
293 <<: *native_build_job_definition
295 job: amd64-fedora-container
308 --disable-coroutine-pool
317 --disable-guest-agent
328 --disable-live-block-migration
330 --disable-malloc-trim
339 --disable-qom-cast-debug
342 --disable-replication
355 --disable-vhost-crypto
358 --disable-vhost-kernel
361 --disable-vhost-vsock
362 --disable-virglrenderer
368 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
369 s390x-softmmu i386-linux-user
370 MAKE_CHECK_ARGS: check-qtest SPEED=slow
372 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
373 # the configure script. The container doesn't contain Xen headers so
374 # Xen accelerator is not detected / selected. As result it build the
375 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
377 # Also use a different coroutine implementation (which is only really of
378 # interest to KVM users, i.e. with TCG disabled)
380 <<: *native_build_job_definition
382 job: amd64-centos8-container
388 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
389 || { cat config.log meson-logs/meson-log.txt && exit 1; }
392 - make check-qapi-schema
393 - cd tests/qemu-iotests/
394 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
395 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
396 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
397 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
398 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
399 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
400 260 261 262 263 264 270 272 273 277 279
403 <<: *native_build_job_definition
405 job: amd64-debian-user-cross-container
407 IMAGE: debian-all-test-cross
408 CONFIGURE_ARGS: --disable-tools --disable-system
409 MAKE_CHECK_ARGS: check-tcg
412 <<: *native_build_job_definition
414 job: amd64-debian-user-cross-container
416 IMAGE: debian-all-test-cross
417 CONFIGURE_ARGS: --disable-tools --disable-system --static
418 MAKE_CHECK_ARGS: check-tcg
420 # Only build the softmmu targets we have check-tcg tests for
422 <<: *native_build_job_definition
424 job: amd64-debian-user-cross-container
426 IMAGE: debian-all-test-cross
427 CONFIGURE_ARGS: --disable-tools --enable-debug
428 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
429 MAKE_CHECK_ARGS: check-tcg
431 # Run check-tcg against linux-user (with plugins)
432 # we skip sparc64-linux-user until it has been fixed somewhat
433 # we skip cris-linux-user as it doesn't use the common run loop
435 <<: *native_build_job_definition
437 job: amd64-debian-user-cross-container
439 IMAGE: debian-all-test-cross
440 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
441 MAKE_CHECK_ARGS: check-tcg
445 <<: *native_build_job_definition
447 job: amd64-centos7-container
450 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
451 MAKE_CHECK_ARGS: check-tcg
453 build-some-softmmu-plugins:
454 <<: *native_build_job_definition
456 job: amd64-debian-user-cross-container
458 IMAGE: debian-all-test-cross
459 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
460 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
461 MAKE_CHECK_ARGS: check-tcg
464 <<: *native_build_job_definition
466 job: amd64-fedora-container
469 CONFIGURE_ARGS: --cc=clang --cxx=clang++
470 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
471 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
472 ppc-softmmu s390x-softmmu
473 MAKE_CHECK_ARGS: check-qtest check-tcg
476 <<: *native_build_job_definition
478 job: amd64-debian-user-cross-container
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
516 <<: *native_test_job_definition
518 - job: build-cfi-aarch64
522 MAKE_CHECK_ARGS: check
524 acceptance-cfi-aarch64:
525 <<: *native_test_job_definition
527 - job: build-cfi-aarch64
531 MAKE_CHECK_ARGS: check-acceptance
532 <<: *acceptance_definition
534 build-cfi-ppc64-s390x:
535 <<: *native_build_job_definition
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 <<: *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
590 <<: *native_test_job_definition
592 - job: build-cfi-x86_64
596 MAKE_CHECK_ARGS: check
598 acceptance-cfi-x86_64:
599 <<: *native_test_job_definition
601 - job: build-cfi-x86_64
605 MAKE_CHECK_ARGS: check-acceptance
606 <<: *acceptance_definition
609 <<: *native_build_job_definition
611 job: amd64-ubuntu2004-container
614 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
615 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
616 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
617 MAKE_CHECK_ARGS: bench V=1
619 # These targets are on the way out
621 <<: *native_build_job_definition
623 job: amd64-debian-user-cross-container
625 IMAGE: debian-all-test-cross
626 CONFIGURE_ARGS: --disable-tools
627 MAKE_CHECK_ARGS: build-tcg
628 TARGETS: ppc64abi32-linux-user lm32-softmmu unicore32-softmmu
634 # We split the check-tcg step as test failures are expected but we still
635 # want to catch the build breaking.
637 <<: *native_test_job_definition
639 - job: build-deprecated
642 IMAGE: debian-all-test-cross
643 MAKE_CHECK_ARGS: check-tcg
646 # gprof/gcov are GCC features
648 <<: *native_build_job_definition
650 job: amd64-ubuntu2004-container
653 CONFIGURE_ARGS: --enable-gprof --enable-gcov
654 MAKE_CHECK_ARGS: check
655 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
658 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
661 <<: *native_build_job_definition
663 job: amd64-fedora-container
667 - mkdir build-oss-fuzz
668 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
669 ./scripts/oss-fuzz/build.sh
670 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
671 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
673 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
674 echo Testing ${fuzzer} ... ;
675 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
677 # Unrelated to fuzzer: run some tests with -fsanitize=address
678 - cd build-oss-fuzz && make check-qtest-i386 check-unit
681 <<: *native_build_job_definition
683 job: amd64-debian-user-cross-container
685 IMAGE: debian-all-test-cross
687 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
690 - ../configure --enable-tcg-interpreter
691 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
693 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
694 - for tg in $TARGETS ; do
695 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
696 ./tests/qtest/boot-serial-test || exit 1 ;
697 ./tests/qtest/cdrom-test || exit 1 ;
699 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
700 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
703 # Alternate coroutines implementations are only really of interest to KVM users
704 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
705 build-coroutine-sigaltstack:
706 <<: *native_build_job_definition
708 job: amd64-ubuntu2004-container
711 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
712 --enable-trace-backends=ftrace
713 MAKE_CHECK_ARGS: check-unit
715 # Most jobs test latest gcrypt or nettle builds
717 # These jobs test old gcrypt and nettle from RHEL7
718 # which had some API differences.
720 <<: *native_build_job_definition
722 job: amd64-centos7-container
725 TARGETS: x86_64-softmmu x86_64-linux-user
726 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
727 MAKE_CHECK_ARGS: check
730 <<: *native_build_job_definition
732 job: amd64-centos7-container
735 TARGETS: x86_64-softmmu x86_64-linux-user
736 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
737 MAKE_CHECK_ARGS: check
740 <<: *native_build_job_definition
742 job: amd64-centos7-container
745 TARGETS: x86_64-softmmu x86_64-linux-user
746 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
747 MAKE_CHECK_ARGS: check
750 # Check our reduced build configurations
751 build-without-default-devices:
752 <<: *native_build_job_definition
754 job: amd64-centos8-container
757 CONFIGURE_ARGS: --without-default-devices --disable-user
759 build-without-default-features:
760 <<: *native_build_job_definition
762 job: amd64-debian-container
765 CONFIGURE_ARGS: --without-default-features --disable-user
766 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
767 MAKE_CHECK_ARGS: check-unit
771 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
773 job: amd64-centos8-container
774 script: .gitlab-ci.d/check-patch.py
777 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
784 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
786 job: amd64-centos8-container
787 script: .gitlab-ci.d/check-dco.py
790 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
796 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
798 job: amd64-fedora-container
800 - dnf install -y meson ninja-build
802 - mkdir subprojects/libvhost-user/build
803 - cd subprojects/libvhost-user/build
807 # No targets are built here, just tools, docs, and unit tests. This
808 # also feeds into the eventual documentation deployment steps later
809 build-tools-and-docs-debian:
810 <<: *native_build_job_definition
812 job: amd64-debian-container
815 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
816 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
822 # Prepare for GitLab pages deployment. Anything copied into the
823 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
825 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
828 - job: build-tools-and-docs-debian
831 # HTML-ised source tree
833 - htags -anT --tree-view=filetree -m qemu_init
834 -t "Welcome to the QEMU sourcecode"
836 # Project documentation
837 - make -C build install DESTDIR=$(pwd)/temp-install
838 - mv temp-install/usr/local/share/doc/qemu/* public/