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=git} $CONFIGURE_ARGS --target-list="$TARGETS" ;
32 ../configure --enable-werror --disable-docs ${LD_JOBS:+--meson=git} $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_test_job_template:
56 extends: .native_test_job_template
58 key: "${CI_JOB_NAME}-cache"
60 - ${CI_PROJECT_DIR}/avocado-cache
63 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
67 - build/tests/results/latest/results.xml
68 - build/tests/results/latest/test-results
70 junit: build/tests/results/latest/results.xml
72 - mkdir -p ~/.config/avocado
73 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
74 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
75 >> ~/.config/avocado/avocado.conf
76 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL", "INTERRUPT"]'
77 >> ~/.config/avocado/avocado.conf
78 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
79 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
81 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
84 - du -chs ${CI_PROJECT_DIR}/avocado-cache
87 extends: .native_build_job_template
89 - job: amd64-alpine-container
92 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
93 microblazeel-softmmu mips64el-softmmu
94 MAKE_CHECK_ARGS: check-build
95 CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
99 - .git-submodule-status
103 extends: .native_test_job_template
105 - job: build-system-alpine
109 MAKE_CHECK_ARGS: check
111 acceptance-system-alpine:
112 extends: .acceptance_test_job_template
114 - job: build-system-alpine
118 MAKE_CHECK_ARGS: check-acceptance
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: .acceptance_test_job_template
147 - job: build-system-ubuntu
151 MAKE_CHECK_ARGS: check-acceptance
154 extends: .native_build_job_template
156 job: amd64-debian-container
159 CONFIGURE_ARGS: --enable-fdt=system
160 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
161 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
162 MAKE_CHECK_ARGS: check-build
169 extends: .native_test_job_template
171 - job: build-system-debian
175 MAKE_CHECK_ARGS: check
177 acceptance-system-debian:
178 extends: .acceptance_test_job_template
180 - job: build-system-debian
184 MAKE_CHECK_ARGS: check-acceptance
187 extends: .native_build_job_template
189 job: amd64-fedora-container
192 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
193 --enable-fdt=system --enable-slirp=system --enable-capstone=system
194 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
195 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
196 MAKE_CHECK_ARGS: check-build
203 extends: .native_test_job_template
205 - job: build-system-fedora
209 MAKE_CHECK_ARGS: check
211 acceptance-system-fedora:
212 extends: .acceptance_test_job_template
214 - job: build-system-fedora
218 MAKE_CHECK_ARGS: check-acceptance
221 extends: .native_build_job_template
223 job: amd64-centos8-container
226 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
227 --enable-modules --enable-trace-backends=dtrace
228 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
229 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
230 MAKE_CHECK_ARGS: check-build
237 extends: .native_test_job_template
239 - job: build-system-centos
243 MAKE_CHECK_ARGS: check
245 acceptance-system-centos:
246 extends: .acceptance_test_job_template
248 - job: build-system-centos
252 MAKE_CHECK_ARGS: check-acceptance
254 build-system-opensuse:
255 extends: .native_build_job_template
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 extends: .native_test_job_template
271 - job: build-system-opensuse
275 MAKE_CHECK_ARGS: check
277 acceptance-system-opensuse:
278 extends: .acceptance_test_job_template
280 - job: build-system-opensuse
284 MAKE_CHECK_ARGS: check-acceptance
288 extends: .native_build_job_template
290 job: amd64-fedora-container
303 --disable-coroutine-pool
312 --disable-guest-agent
323 --disable-live-block-migration
325 --disable-malloc-trim
334 --disable-qom-cast-debug
337 --disable-replication
349 --disable-vhost-crypto
352 --disable-vhost-kernel
355 --disable-vhost-vsock
356 --disable-virglrenderer
362 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
363 s390x-softmmu i386-linux-user
364 MAKE_CHECK_ARGS: check-qtest SPEED=slow
366 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
367 # the configure script. The container doesn't contain Xen headers so
368 # Xen accelerator is not detected / selected. As result it build the
369 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
371 # Also use a different coroutine implementation (which is only really of
372 # interest to KVM users, i.e. with TCG disabled)
374 extends: .native_build_job_template
376 job: amd64-centos8-container
382 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
383 || { cat config.log meson-logs/meson-log.txt && exit 1; }
386 - make check-qapi-schema
387 - cd tests/qemu-iotests/
388 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
389 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
390 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
391 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
392 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
393 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
394 260 261 262 263 264 270 272 273 277 279
397 extends: .native_build_job_template
399 job: amd64-debian-user-cross-container
401 IMAGE: debian-all-test-cross
402 CONFIGURE_ARGS: --disable-tools --disable-system
403 MAKE_CHECK_ARGS: check-tcg
406 extends: .native_build_job_template
408 job: amd64-debian-user-cross-container
410 IMAGE: debian-all-test-cross
411 CONFIGURE_ARGS: --disable-tools --disable-system --static
412 MAKE_CHECK_ARGS: check-tcg
414 # Because the hexagon cross-compiler takes so long to build we don't rely
415 # on the CI system to build it and hence this job has an optional dependency
416 # declared. The image is manually uploaded.
418 extends: .native_build_job_template
420 job: hexagon-cross-container
423 IMAGE: debian-hexagon-cross
424 TARGETS: hexagon-linux-user
425 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
426 MAKE_CHECK_ARGS: check-tcg
428 # Only build the softmmu targets we have check-tcg tests for
430 extends: .native_build_job_template
432 job: amd64-debian-user-cross-container
434 IMAGE: debian-all-test-cross
435 CONFIGURE_ARGS: --disable-tools --enable-debug
436 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
437 MAKE_CHECK_ARGS: check-tcg
439 # Run check-tcg against linux-user (with plugins)
440 # we skip sparc64-linux-user until it has been fixed somewhat
441 # we skip cris-linux-user as it doesn't use the common run loop
443 extends: .native_build_job_template
445 job: amd64-debian-user-cross-container
447 IMAGE: debian-all-test-cross
448 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
449 MAKE_CHECK_ARGS: check-tcg
453 extends: .native_build_job_template
455 job: amd64-centos7-container
458 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
459 MAKE_CHECK_ARGS: check-tcg
461 build-some-softmmu-plugins:
462 extends: .native_build_job_template
464 job: amd64-debian-user-cross-container
466 IMAGE: debian-all-test-cross
467 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
468 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
469 MAKE_CHECK_ARGS: check-tcg
472 extends: .native_build_job_template
474 job: amd64-fedora-container
477 CONFIGURE_ARGS: --cc=clang --cxx=clang++
478 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
479 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
480 ppc-softmmu s390x-softmmu
481 MAKE_CHECK_ARGS: check-qtest check-tcg
484 extends: .native_build_job_template
486 job: amd64-debian-user-cross-container
488 IMAGE: debian-all-test-cross
489 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
490 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
491 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
492 MAKE_CHECK_ARGS: check-unit check-tcg
494 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
495 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
496 # triggers an Out-Of-Memory error
498 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
499 # with QEMU and linked as a static library to avoid false positives in CFI checks.
500 # This can be accomplished by using -enable-slirp=git, which avoids the use of
501 # a system-wide version of the library
503 # Split in three sets of build/check/acceptance to limit the execution time of each
506 extends: .native_build_job_template
508 - job: amd64-fedora-container
513 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
514 --enable-safe-stack --enable-slirp=git
515 TARGETS: aarch64-softmmu
516 MAKE_CHECK_ARGS: check-build
524 extends: .native_test_job_template
526 - job: build-cfi-aarch64
530 MAKE_CHECK_ARGS: check
532 acceptance-cfi-aarch64:
533 extends: .acceptance_test_job_template
535 - job: build-cfi-aarch64
539 MAKE_CHECK_ARGS: check-acceptance
541 build-cfi-ppc64-s390x:
542 extends: .native_build_job_template
544 - job: amd64-fedora-container
549 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
550 --enable-safe-stack --enable-slirp=git
551 TARGETS: ppc64-softmmu s390x-softmmu
552 MAKE_CHECK_ARGS: check-build
559 check-cfi-ppc64-s390x:
560 extends: .native_test_job_template
562 - job: build-cfi-ppc64-s390x
566 MAKE_CHECK_ARGS: check
568 acceptance-cfi-ppc64-s390x:
569 extends: .acceptance_test_job_template
571 - job: build-cfi-ppc64-s390x
575 MAKE_CHECK_ARGS: check-acceptance
578 extends: .native_build_job_template
580 - job: amd64-fedora-container
585 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
586 --enable-safe-stack --enable-slirp=git
587 TARGETS: x86_64-softmmu
588 MAKE_CHECK_ARGS: check-build
596 extends: .native_test_job_template
598 - job: build-cfi-x86_64
602 MAKE_CHECK_ARGS: check
604 acceptance-cfi-x86_64:
605 extends: .acceptance_test_job_template
607 - job: build-cfi-x86_64
611 MAKE_CHECK_ARGS: check-acceptance
614 extends: .native_build_job_template
616 job: amd64-ubuntu2004-container
619 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
620 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
621 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
622 MAKE_CHECK_ARGS: bench V=1
624 # These targets are on the way out
626 extends: .native_build_job_template
628 job: amd64-debian-user-cross-container
630 IMAGE: debian-all-test-cross
631 CONFIGURE_ARGS: --disable-tools
632 MAKE_CHECK_ARGS: build-tcg
633 TARGETS: ppc64abi32-linux-user
639 # We split the check-tcg step as test failures are expected but we still
640 # want to catch the build breaking.
642 extends: .native_test_job_template
644 - job: build-deprecated
647 IMAGE: debian-all-test-cross
648 MAKE_CHECK_ARGS: check-tcg
651 # gprof/gcov are GCC features
653 extends: .native_build_job_template
655 job: amd64-ubuntu2004-container
658 CONFIGURE_ARGS: --enable-gprof --enable-gcov
659 MAKE_CHECK_ARGS: check
660 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
663 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
666 extends: .native_build_job_template
668 job: amd64-fedora-container
672 - mkdir build-oss-fuzz
673 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
674 ./scripts/oss-fuzz/build.sh
675 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
676 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
678 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
679 echo Testing ${fuzzer} ... ;
680 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
682 # Unrelated to fuzzer: run some tests with -fsanitize=address
683 - cd build-oss-fuzz && make check-qtest-i386 check-unit
686 extends: .native_build_job_template
688 job: amd64-debian-user-cross-container
690 IMAGE: debian-all-test-cross
692 - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
695 - ../configure --enable-tcg-interpreter
696 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
698 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
699 - for tg in $TARGETS ; do
700 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
701 ./tests/qtest/boot-serial-test || exit 1 ;
702 ./tests/qtest/cdrom-test || exit 1 ;
704 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
705 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
708 # Alternate coroutines implementations are only really of interest to KVM users
709 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
710 build-coroutine-sigaltstack:
711 extends: .native_build_job_template
713 job: amd64-ubuntu2004-container
716 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
717 --enable-trace-backends=ftrace
718 MAKE_CHECK_ARGS: check-unit
720 # Most jobs test latest gcrypt or nettle builds
722 # These jobs test old gcrypt and nettle from RHEL7
723 # which had some API differences.
725 extends: .native_build_job_template
727 job: amd64-centos7-container
730 TARGETS: x86_64-softmmu x86_64-linux-user
731 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
732 MAKE_CHECK_ARGS: check
735 extends: .native_build_job_template
737 job: amd64-centos7-container
740 TARGETS: x86_64-softmmu x86_64-linux-user
741 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
742 MAKE_CHECK_ARGS: check
745 extends: .native_build_job_template
747 job: amd64-centos7-container
750 TARGETS: x86_64-softmmu x86_64-linux-user
751 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
752 MAKE_CHECK_ARGS: check
755 # Check our reduced build configurations
756 build-without-default-devices:
757 extends: .native_build_job_template
759 job: amd64-centos8-container
762 CONFIGURE_ARGS: --without-default-devices --disable-user
764 build-without-default-features:
765 extends: .native_build_job_template
767 job: amd64-debian-container
770 CONFIGURE_ARGS: --without-default-features --disable-user
771 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
772 MAKE_CHECK_ARGS: check-unit
776 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
778 job: amd64-centos8-container
779 script: .gitlab-ci.d/check-patch.py
782 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
789 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
791 job: amd64-centos8-container
792 script: .gitlab-ci.d/check-dco.py
795 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
801 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
803 job: amd64-fedora-container
805 - dnf install -y meson ninja-build
807 - mkdir subprojects/libvhost-user/build
808 - cd subprojects/libvhost-user/build
812 # No targets are built here, just tools, docs, and unit tests. This
813 # also feeds into the eventual documentation deployment steps later
814 build-tools-and-docs-debian:
815 extends: .native_build_job_template
817 job: amd64-debian-container
820 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
821 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
827 # Prepare for GitLab pages deployment. Anything copied into the
828 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
830 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
833 - job: build-tools-and-docs-debian
836 # HTML-ised source tree
838 - htags -anT --tree-view=filetree -m qemu_init
839 -t "Welcome to the QEMU sourcecode"
841 # Project documentation
842 - make -C build install DESTDIR=$(pwd)/temp-install
843 - mv temp-install/usr/local/share/doc/qemu/* public/