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 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 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
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 <<: *native_build_job_definition
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 <<: *native_build_job_definition
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 <<: *native_build_job_definition
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 # Only build the softmmu targets we have check-tcg tests for
421 <<: *native_build_job_definition
423 job: amd64-debian-user-cross-container
425 IMAGE: debian-all-test-cross
426 CONFIGURE_ARGS: --disable-tools --enable-debug
427 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
428 MAKE_CHECK_ARGS: check-tcg
430 # Run check-tcg against linux-user (with plugins)
431 # we skip sparc64-linux-user until it has been fixed somewhat
432 # we skip cris-linux-user as it doesn't use the common run loop
434 <<: *native_build_job_definition
436 job: amd64-debian-user-cross-container
438 IMAGE: debian-all-test-cross
439 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
440 MAKE_CHECK_ARGS: check-tcg
444 <<: *native_build_job_definition
446 job: amd64-centos7-container
449 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
450 MAKE_CHECK_ARGS: check-tcg
452 build-some-softmmu-plugins:
453 <<: *native_build_job_definition
455 job: amd64-debian-user-cross-container
457 IMAGE: debian-all-test-cross
458 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
459 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
460 MAKE_CHECK_ARGS: check-tcg
463 <<: *native_build_job_definition
465 job: amd64-fedora-container
468 CONFIGURE_ARGS: --cc=clang --cxx=clang++
469 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
470 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
471 ppc-softmmu s390x-softmmu
472 MAKE_CHECK_ARGS: check-qtest check-tcg
475 <<: *native_build_job_definition
477 job: amd64-debian-user-cross-container
479 IMAGE: debian-all-test-cross
480 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
481 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
482 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
483 MAKE_CHECK_ARGS: check-unit check-tcg
485 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
486 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
487 # triggers an Out-Of-Memory error
489 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
490 # with QEMU and linked as a static library to avoid false positives in CFI checks.
491 # This can be accomplished by using -enable-slirp=git, which avoids the use of
492 # a system-wide version of the library
494 # Split in three sets of build/check/acceptance to limit the execution time of each
497 <<: *native_build_job_definition
499 - job: amd64-fedora-container
504 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
505 --enable-safe-stack --enable-slirp=git
506 TARGETS: aarch64-softmmu
507 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
551 check-cfi-ppc64-s390x:
552 <<: *native_test_job_definition
554 - job: build-cfi-ppc64-s390x
558 MAKE_CHECK_ARGS: check
560 acceptance-cfi-ppc64-s390x:
561 <<: *native_test_job_definition
563 - job: build-cfi-ppc64-s390x
567 MAKE_CHECK_ARGS: check-acceptance
568 <<: *acceptance_definition
571 <<: *native_build_job_definition
573 - job: amd64-fedora-container
578 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
579 --enable-safe-stack --enable-slirp=git
580 TARGETS: x86_64-softmmu
581 MAKE_CHECK_ARGS: check-build
589 <<: *native_test_job_definition
591 - job: build-cfi-x86_64
595 MAKE_CHECK_ARGS: check
597 acceptance-cfi-x86_64:
598 <<: *native_test_job_definition
600 - job: build-cfi-x86_64
604 MAKE_CHECK_ARGS: check-acceptance
605 <<: *acceptance_definition
608 <<: *native_build_job_definition
610 job: amd64-ubuntu2004-container
613 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
614 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
615 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
616 MAKE_CHECK_ARGS: bench V=1
618 # These targets are on the way out
620 <<: *native_build_job_definition
622 job: amd64-debian-user-cross-container
624 IMAGE: debian-all-test-cross
625 CONFIGURE_ARGS: --disable-tools
626 MAKE_CHECK_ARGS: build-tcg
627 TARGETS: ppc64abi32-linux-user
633 # We split the check-tcg step as test failures are expected but we still
634 # want to catch the build breaking.
636 <<: *native_test_job_definition
638 - job: build-deprecated
641 IMAGE: debian-all-test-cross
642 MAKE_CHECK_ARGS: check-tcg
645 # gprof/gcov are GCC features
647 <<: *native_build_job_definition
649 job: amd64-ubuntu2004-container
652 CONFIGURE_ARGS: --enable-gprof --enable-gcov
653 MAKE_CHECK_ARGS: check
654 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
657 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
660 <<: *native_build_job_definition
662 job: amd64-fedora-container
666 - mkdir build-oss-fuzz
667 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
668 ./scripts/oss-fuzz/build.sh
669 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
670 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
672 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
673 echo Testing ${fuzzer} ... ;
674 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
676 # Unrelated to fuzzer: run some tests with -fsanitize=address
677 - cd build-oss-fuzz && make check-qtest-i386 check-unit
680 <<: *native_build_job_definition
682 job: amd64-debian-user-cross-container
684 IMAGE: debian-all-test-cross
686 - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
689 - ../configure --enable-tcg-interpreter
690 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
692 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
693 - for tg in $TARGETS ; do
694 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
695 ./tests/qtest/boot-serial-test || exit 1 ;
696 ./tests/qtest/cdrom-test || exit 1 ;
698 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
699 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
702 # Alternate coroutines implementations are only really of interest to KVM users
703 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
704 build-coroutine-sigaltstack:
705 <<: *native_build_job_definition
707 job: amd64-ubuntu2004-container
710 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
711 --enable-trace-backends=ftrace
712 MAKE_CHECK_ARGS: check-unit
714 # Most jobs test latest gcrypt or nettle builds
716 # These jobs test old gcrypt and nettle from RHEL7
717 # which had some API differences.
719 <<: *native_build_job_definition
721 job: amd64-centos7-container
724 TARGETS: x86_64-softmmu x86_64-linux-user
725 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
726 MAKE_CHECK_ARGS: check
729 <<: *native_build_job_definition
731 job: amd64-centos7-container
734 TARGETS: x86_64-softmmu x86_64-linux-user
735 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
736 MAKE_CHECK_ARGS: check
739 <<: *native_build_job_definition
741 job: amd64-centos7-container
744 TARGETS: x86_64-softmmu x86_64-linux-user
745 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
746 MAKE_CHECK_ARGS: check
749 # Check our reduced build configurations
750 build-without-default-devices:
751 <<: *native_build_job_definition
753 job: amd64-centos8-container
756 CONFIGURE_ARGS: --without-default-devices --disable-user
758 build-without-default-features:
759 <<: *native_build_job_definition
761 job: amd64-debian-container
764 CONFIGURE_ARGS: --without-default-features --disable-user
765 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
766 MAKE_CHECK_ARGS: check-unit
770 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
772 job: amd64-centos8-container
773 script: .gitlab-ci.d/check-patch.py
776 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
783 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
785 job: amd64-centos8-container
786 script: .gitlab-ci.d/check-dco.py
789 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
795 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
797 job: amd64-fedora-container
799 - dnf install -y meson ninja-build
801 - mkdir subprojects/libvhost-user/build
802 - cd subprojects/libvhost-user/build
806 # No targets are built here, just tools, docs, and unit tests. This
807 # also feeds into the eventual documentation deployment steps later
808 build-tools-and-docs-debian:
809 <<: *native_build_job_definition
811 job: amd64-debian-container
814 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
815 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
821 # Prepare for GitLab pages deployment. Anything copied into the
822 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
824 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
827 - job: build-tools-and-docs-debian
830 # HTML-ised source tree
832 - htags -anT --tree-view=filetree -m qemu_init
833 -t "Welcome to the QEMU sourcecode"
835 # Project documentation
836 - make -C build install DESTDIR=$(pwd)/temp-install
837 - mv temp-install/usr/local/share/doc/qemu/* public/