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:
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:
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 extends: .native_build_job_template
88 - job: amd64-alpine-container
91 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
92 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 extends: .native_test_job_template
104 - job: build-system-alpine
108 MAKE_CHECK_ARGS: check
110 acceptance-system-alpine:
111 extends: .native_test_job_template
113 - job: build-system-alpine
117 MAKE_CHECK_ARGS: check-acceptance
118 <<: *acceptance_definition
121 extends: .native_build_job_template
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 microblazeel-softmmu mips64el-softmmu
129 MAKE_CHECK_ARGS: check-build
136 extends: .native_test_job_template
138 - job: build-system-ubuntu
142 MAKE_CHECK_ARGS: check
144 acceptance-system-ubuntu:
145 extends: .native_test_job_template
147 - job: build-system-ubuntu
151 MAKE_CHECK_ARGS: check-acceptance
152 <<: *acceptance_definition
155 extends: .native_build_job_template
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 extends: .native_test_job_template
172 - job: build-system-debian
176 MAKE_CHECK_ARGS: check
178 acceptance-system-debian:
179 extends: .native_test_job_template
181 - job: build-system-debian
185 MAKE_CHECK_ARGS: check-acceptance
186 <<: *acceptance_definition
189 extends: .native_build_job_template
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 extends: .native_test_job_template
207 - job: build-system-fedora
211 MAKE_CHECK_ARGS: check
213 acceptance-system-fedora:
214 extends: .native_test_job_template
216 - job: build-system-fedora
220 MAKE_CHECK_ARGS: check-acceptance
221 <<: *acceptance_definition
224 extends: .native_build_job_template
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 extends: .native_test_job_template
242 - job: build-system-centos
246 MAKE_CHECK_ARGS: check
248 acceptance-system-centos:
249 extends: .native_test_job_template
251 - job: build-system-centos
255 MAKE_CHECK_ARGS: check-acceptance
256 <<: *acceptance_definition
258 build-system-opensuse:
259 extends: .native_build_job_template
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 extends: .native_test_job_template
275 - job: build-system-opensuse
279 MAKE_CHECK_ARGS: check
281 acceptance-system-opensuse:
282 extends: .native_test_job_template
284 - job: build-system-opensuse
288 MAKE_CHECK_ARGS: check-acceptance
289 <<: *acceptance_definition
293 extends: .native_build_job_template
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
354 --disable-vhost-crypto
357 --disable-vhost-kernel
360 --disable-vhost-vsock
361 --disable-virglrenderer
367 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
368 s390x-softmmu i386-linux-user
369 MAKE_CHECK_ARGS: check-qtest SPEED=slow
371 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
372 # the configure script. The container doesn't contain Xen headers so
373 # Xen accelerator is not detected / selected. As result it build the
374 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
376 # Also use a different coroutine implementation (which is only really of
377 # interest to KVM users, i.e. with TCG disabled)
379 extends: .native_build_job_template
381 job: amd64-centos8-container
387 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
388 || { cat config.log meson-logs/meson-log.txt && exit 1; }
391 - make check-qapi-schema
392 - cd tests/qemu-iotests/
393 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
394 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
395 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
396 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
397 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
398 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
399 260 261 262 263 264 270 272 273 277 279
402 extends: .native_build_job_template
404 job: amd64-debian-user-cross-container
406 IMAGE: debian-all-test-cross
407 CONFIGURE_ARGS: --disable-tools --disable-system
408 MAKE_CHECK_ARGS: check-tcg
411 extends: .native_build_job_template
413 job: amd64-debian-user-cross-container
415 IMAGE: debian-all-test-cross
416 CONFIGURE_ARGS: --disable-tools --disable-system --static
417 MAKE_CHECK_ARGS: check-tcg
419 # Because the hexagon cross-compiler takes so long to build we don't rely
420 # on the CI system to build it and hence this job has no dependency
421 # declared. The image is manually uploaded.
423 extends: .native_build_job_template
425 IMAGE: debian-hexagon-cross
426 TARGETS: hexagon-linux-user
427 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
428 MAKE_CHECK_ARGS: check-tcg
430 # Only build the softmmu targets we have check-tcg tests for
432 extends: .native_build_job_template
434 job: amd64-debian-user-cross-container
436 IMAGE: debian-all-test-cross
437 CONFIGURE_ARGS: --disable-tools --enable-debug
438 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
439 MAKE_CHECK_ARGS: check-tcg
441 # Run check-tcg against linux-user (with plugins)
442 # we skip sparc64-linux-user until it has been fixed somewhat
443 # we skip cris-linux-user as it doesn't use the common run loop
445 extends: .native_build_job_template
447 job: amd64-debian-user-cross-container
449 IMAGE: debian-all-test-cross
450 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
451 MAKE_CHECK_ARGS: check-tcg
455 extends: .native_build_job_template
457 job: amd64-centos7-container
460 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
461 MAKE_CHECK_ARGS: check-tcg
463 build-some-softmmu-plugins:
464 extends: .native_build_job_template
466 job: amd64-debian-user-cross-container
468 IMAGE: debian-all-test-cross
469 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
470 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
471 MAKE_CHECK_ARGS: check-tcg
474 extends: .native_build_job_template
476 job: amd64-fedora-container
479 CONFIGURE_ARGS: --cc=clang --cxx=clang++
480 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
481 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
482 ppc-softmmu s390x-softmmu
483 MAKE_CHECK_ARGS: check-qtest check-tcg
486 extends: .native_build_job_template
488 job: amd64-debian-user-cross-container
490 IMAGE: debian-all-test-cross
491 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
492 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
493 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
494 MAKE_CHECK_ARGS: check-unit check-tcg
496 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
497 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
498 # triggers an Out-Of-Memory error
500 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
501 # with QEMU and linked as a static library to avoid false positives in CFI checks.
502 # This can be accomplished by using -enable-slirp=git, which avoids the use of
503 # a system-wide version of the library
505 # Split in three sets of build/check/acceptance to limit the execution time of each
508 extends: .native_build_job_template
510 - job: amd64-fedora-container
515 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
516 --enable-safe-stack --enable-slirp=git
517 TARGETS: aarch64-softmmu
518 MAKE_CHECK_ARGS: check-build
526 extends: .native_test_job_template
528 - job: build-cfi-aarch64
532 MAKE_CHECK_ARGS: check
534 acceptance-cfi-aarch64:
535 extends: .native_test_job_template
537 - job: build-cfi-aarch64
541 MAKE_CHECK_ARGS: check-acceptance
542 <<: *acceptance_definition
544 build-cfi-ppc64-s390x:
545 extends: .native_build_job_template
547 - job: amd64-fedora-container
552 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
553 --enable-safe-stack --enable-slirp=git
554 TARGETS: ppc64-softmmu s390x-softmmu
555 MAKE_CHECK_ARGS: check-build
562 check-cfi-ppc64-s390x:
563 extends: .native_test_job_template
565 - job: build-cfi-ppc64-s390x
569 MAKE_CHECK_ARGS: check
571 acceptance-cfi-ppc64-s390x:
572 extends: .native_test_job_template
574 - job: build-cfi-ppc64-s390x
578 MAKE_CHECK_ARGS: check-acceptance
579 <<: *acceptance_definition
582 extends: .native_build_job_template
584 - job: amd64-fedora-container
589 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
590 --enable-safe-stack --enable-slirp=git
591 TARGETS: x86_64-softmmu
592 MAKE_CHECK_ARGS: check-build
600 extends: .native_test_job_template
602 - job: build-cfi-x86_64
606 MAKE_CHECK_ARGS: check
608 acceptance-cfi-x86_64:
609 extends: .native_test_job_template
611 - job: build-cfi-x86_64
615 MAKE_CHECK_ARGS: check-acceptance
616 <<: *acceptance_definition
619 extends: .native_build_job_template
621 job: amd64-ubuntu2004-container
624 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
625 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
626 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
627 MAKE_CHECK_ARGS: bench V=1
629 # These targets are on the way out
631 extends: .native_build_job_template
633 job: amd64-debian-user-cross-container
635 IMAGE: debian-all-test-cross
636 CONFIGURE_ARGS: --disable-tools
637 MAKE_CHECK_ARGS: build-tcg
638 TARGETS: ppc64abi32-linux-user
644 # We split the check-tcg step as test failures are expected but we still
645 # want to catch the build breaking.
647 extends: .native_test_job_template
649 - job: build-deprecated
652 IMAGE: debian-all-test-cross
653 MAKE_CHECK_ARGS: check-tcg
656 # gprof/gcov are GCC features
658 extends: .native_build_job_template
660 job: amd64-ubuntu2004-container
663 CONFIGURE_ARGS: --enable-gprof --enable-gcov
664 MAKE_CHECK_ARGS: check
665 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
668 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
671 extends: .native_build_job_template
673 job: amd64-fedora-container
677 - mkdir build-oss-fuzz
678 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
679 ./scripts/oss-fuzz/build.sh
680 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
681 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
683 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
684 echo Testing ${fuzzer} ... ;
685 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
687 # Unrelated to fuzzer: run some tests with -fsanitize=address
688 - cd build-oss-fuzz && make check-qtest-i386 check-unit
691 extends: .native_build_job_template
693 job: amd64-debian-user-cross-container
695 IMAGE: debian-all-test-cross
697 - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
700 - ../configure --enable-tcg-interpreter
701 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
703 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
704 - for tg in $TARGETS ; do
705 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
706 ./tests/qtest/boot-serial-test || exit 1 ;
707 ./tests/qtest/cdrom-test || exit 1 ;
709 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
710 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
713 # Alternate coroutines implementations are only really of interest to KVM users
714 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
715 build-coroutine-sigaltstack:
716 extends: .native_build_job_template
718 job: amd64-ubuntu2004-container
721 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
722 --enable-trace-backends=ftrace
723 MAKE_CHECK_ARGS: check-unit
725 # Most jobs test latest gcrypt or nettle builds
727 # These jobs test old gcrypt and nettle from RHEL7
728 # which had some API differences.
730 extends: .native_build_job_template
732 job: amd64-centos7-container
735 TARGETS: x86_64-softmmu x86_64-linux-user
736 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
737 MAKE_CHECK_ARGS: check
740 extends: .native_build_job_template
742 job: amd64-centos7-container
745 TARGETS: x86_64-softmmu x86_64-linux-user
746 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
747 MAKE_CHECK_ARGS: check
750 extends: .native_build_job_template
752 job: amd64-centos7-container
755 TARGETS: x86_64-softmmu x86_64-linux-user
756 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
757 MAKE_CHECK_ARGS: check
760 # Check our reduced build configurations
761 build-without-default-devices:
762 extends: .native_build_job_template
764 job: amd64-centos8-container
767 CONFIGURE_ARGS: --without-default-devices --disable-user
769 build-without-default-features:
770 extends: .native_build_job_template
772 job: amd64-debian-container
775 CONFIGURE_ARGS: --without-default-features --disable-user
776 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
777 MAKE_CHECK_ARGS: check-unit
781 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
783 job: amd64-centos8-container
784 script: .gitlab-ci.d/check-patch.py
787 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
794 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
796 job: amd64-centos8-container
797 script: .gitlab-ci.d/check-dco.py
800 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
806 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
808 job: amd64-fedora-container
810 - dnf install -y meson ninja-build
812 - mkdir subprojects/libvhost-user/build
813 - cd subprojects/libvhost-user/build
817 # No targets are built here, just tools, docs, and unit tests. This
818 # also feeds into the eventual documentation deployment steps later
819 build-tools-and-docs-debian:
820 extends: .native_build_job_template
822 job: amd64-debian-container
825 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
826 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
832 # Prepare for GitLab pages deployment. Anything copied into the
833 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
835 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
838 - job: build-tools-and-docs-debian
841 # HTML-ised source tree
843 - htags -anT --tree-view=filetree -m qemu_init
844 -t "Welcome to the QEMU sourcecode"
846 # Project documentation
847 - make -C build install DESTDIR=$(pwd)/temp-install
848 - mv temp-install/usr/local/share/doc/qemu/* public/