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 $CONFIGURE_ARGS --target-list="$TARGETS" ;
28 ../configure --enable-werror $CONFIGURE_ARGS ;
29 fi || { cat config.log meson-logs/meson-log.txt && exit 1; }
31 - if test -n "$MAKE_CHECK_ARGS";
33 make -j"$JOBS" $MAKE_CHECK_ARGS ;
36 .native_test_job_template: &native_test_job_definition
38 image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
40 - scripts/git-submodule.sh update
41 $(grep GIT_SUBMODULES build/config-host.mak | sed 's/GIT_SUBMODULES=//')
43 - find . -type f -exec touch {} +
44 # Avoid recompiling by hiding ninja with NINJA=":"
45 - make NINJA=":" $MAKE_CHECK_ARGS
47 .acceptance_template: &acceptance_definition
49 key: "${CI_JOB_NAME}-cache"
51 - ${CI_PROJECT_DIR}/avocado-cache
54 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
58 - build/tests/results/latest/results.xml
59 - build/tests/results/latest/test-results
61 junit: build/tests/results/latest/results.xml
63 - mkdir -p ~/.config/avocado
64 - echo "[datadir.paths]" > ~/.config/avocado/avocado.conf
65 - echo "cache_dirs = ['${CI_PROJECT_DIR}/avocado-cache']"
66 >> ~/.config/avocado/avocado.conf
67 - echo -e '[job.output.testlogs]\nstatuses = ["FAIL"]'
68 >> ~/.config/avocado/avocado.conf
69 - if [ -d ${CI_PROJECT_DIR}/avocado-cache ]; then
70 du -chs ${CI_PROJECT_DIR}/avocado-cache ;
72 - export AVOCADO_ALLOW_UNTRUSTED_CODE=1
75 - du -chs ${CI_PROJECT_DIR}/avocado-cache
78 <<: *native_build_job_definition
81 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
82 moxie-softmmu microblazeel-softmmu mips64el-softmmu
83 MAKE_CHECK_ARGS: check-build
84 CONFIGURE_ARGS: --enable-docs
88 - .git-submodule-status
92 <<: *native_test_job_definition
94 - job: build-system-alpine
98 MAKE_CHECK_ARGS: check
100 acceptance-system-alpine:
101 <<: *native_test_job_definition
103 - job: build-system-alpine
107 MAKE_CHECK_ARGS: check-acceptance
108 <<: *acceptance_definition
111 <<: *native_build_job_definition
114 CONFIGURE_ARGS: --enable-fdt=system --enable-slirp=system
115 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
116 moxie-softmmu microblazeel-softmmu mips64el-softmmu
117 MAKE_CHECK_ARGS: check-build
124 <<: *native_test_job_definition
126 - job: build-system-ubuntu
130 MAKE_CHECK_ARGS: check
132 acceptance-system-ubuntu:
133 <<: *native_test_job_definition
135 - job: build-system-ubuntu
139 MAKE_CHECK_ARGS: check-acceptance
140 <<: *acceptance_definition
143 <<: *native_build_job_definition
146 CONFIGURE_ARGS: --enable-fdt=system
147 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
148 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
149 MAKE_CHECK_ARGS: check-build
156 <<: *native_test_job_definition
158 - job: build-system-debian
162 MAKE_CHECK_ARGS: check
164 # No targets are built here, just tools, docs, and unit tests. This
165 # also feeds into the eventual documentation deployment steps later
166 build-tools-and-docs-debian:
167 <<: *native_build_job_definition
170 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
171 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
177 acceptance-system-debian:
178 <<: *native_test_job_definition
180 - job: build-system-debian
184 MAKE_CHECK_ARGS: check-acceptance
185 <<: *acceptance_definition
188 <<: *native_build_job_definition
191 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
192 --enable-fdt=system --enable-slirp=system --enable-capstone=system
193 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
194 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
195 MAKE_CHECK_ARGS: check-build
202 <<: *native_test_job_definition
204 - job: build-system-fedora
208 MAKE_CHECK_ARGS: check
210 acceptance-system-fedora:
211 <<: *native_test_job_definition
213 - job: build-system-fedora
217 MAKE_CHECK_ARGS: check-acceptance
218 <<: *acceptance_definition
221 <<: *native_build_job_definition
224 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
225 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
226 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
227 MAKE_CHECK_ARGS: check-build
234 <<: *native_test_job_definition
236 - job: build-system-centos
240 MAKE_CHECK_ARGS: check
242 acceptance-system-centos:
243 <<: *native_test_job_definition
245 - job: build-system-centos
249 MAKE_CHECK_ARGS: check-acceptance
250 <<: *acceptance_definition
252 build-system-opensuse:
253 <<: *native_build_job_definition
256 CONFIGURE_ARGS: --enable-fdt=system
257 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
258 MAKE_CHECK_ARGS: check-build
264 check-system-opensuse:
265 <<: *native_test_job_definition
267 - job: build-system-opensuse
271 MAKE_CHECK_ARGS: check
273 acceptance-system-opensuse:
274 <<: *native_test_job_definition
276 - job: build-system-opensuse
280 MAKE_CHECK_ARGS: check-acceptance
281 <<: *acceptance_definition
285 <<: *native_build_job_definition
298 --disable-coroutine-pool
307 --disable-guest-agent
318 --disable-live-block-migration
320 --disable-malloc-trim
329 --disable-qom-cast-debug
332 --disable-replication
345 --disable-vhost-crypto
350 --disable-vhost-vsock
351 --disable-virglrenderer
357 TARGETS: arm-softmmu i386-softmmu ppc64-softmmu mips64-softmmu
358 s390x-softmmu i386-linux-user
359 MAKE_CHECK_ARGS: check-qtest SPEED=slow
361 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
362 # the configure script. The container doesn't contain Xen headers so
363 # Xen accelerator is not detected / selected. As result it build the
364 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
367 <<: *native_build_job_definition
373 - ../configure --disable-tcg --audio-drv-list="" || { cat config.log meson-logs/meson-log.txt && exit 1; }
376 - make check-qapi-schema
377 - cd tests/qemu-iotests/
378 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
379 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
380 170 171 183 184 192 194 197 208 215 221 222 226 227 236 253 277
381 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
382 124 132 139 142 144 145 151 152 155 157 165 194 196 197 200 202
383 208 209 215 216 218 222 227 234 246 247 248 250 254 255 257 258
384 260 261 262 263 264 270 272 273 277 279
387 <<: *native_build_job_definition
389 IMAGE: debian-all-test-cross
390 CONFIGURE_ARGS: --disable-tools --disable-system
391 MAKE_CHECK_ARGS: check-tcg
394 <<: *native_build_job_definition
396 IMAGE: debian-all-test-cross
397 CONFIGURE_ARGS: --disable-tools --disable-system --static
398 MAKE_CHECK_ARGS: check-tcg
400 # Only build the softmmu targets we have check-tcg tests for
402 <<: *native_build_job_definition
404 IMAGE: debian-all-test-cross
405 CONFIGURE_ARGS: --disable-tools --enable-debug-tcg
406 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
407 MAKE_CHECK_ARGS: check-tcg
409 # Run check-tcg against linux-user (with plugins)
410 # we skip sparc64-linux-user until it has been fixed somewhat
411 # we skip cris-linux-user as it doesn't use the common run loop
413 <<: *native_build_job_definition
415 IMAGE: debian-all-test-cross
416 CONFIGURE_ARGS: --disable-tools --disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user,cris-linux-user
417 MAKE_CHECK_ARGS: check-tcg
421 <<: *native_build_job_definition
424 CONFIGURE_ARGS: --disable-system --disable-tools --disable-docs
425 MAKE_CHECK_ARGS: check-tcg
427 build-some-softmmu-plugins:
428 <<: *native_build_job_definition
430 IMAGE: debian-all-test-cross
431 CONFIGURE_ARGS: --disable-tools --disable-user --enable-plugins --enable-debug-tcg
432 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
433 MAKE_CHECK_ARGS: check-tcg
436 <<: *native_build_job_definition
439 CONFIGURE_ARGS: --cc=clang --cxx=clang++
440 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
441 ppc-softmmu s390x-softmmu arm-linux-user
442 MAKE_CHECK_ARGS: check
444 # These targets are on the way out
446 <<: *native_build_job_definition
448 IMAGE: debian-all-test-cross
449 CONFIGURE_ARGS: --disable-docs --disable-tools
450 MAKE_CHECK_ARGS: build-tcg
451 TARGETS: ppc64abi32-linux-user tilegx-linux-user lm32-softmmu
458 # We split the check-tcg step as test failures are expected but we still
459 # want to catch the build breaking.
461 <<: *native_test_job_definition
463 - job: build-deprecated
466 IMAGE: debian-all-test-cross
467 MAKE_CHECK_ARGS: check-tcg
471 <<: *native_build_job_definition
475 - mkdir build-oss-fuzz
476 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
477 ./scripts/oss-fuzz/build.sh
478 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
479 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
481 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
482 echo Testing ${fuzzer} ... ;
483 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
485 # Unrelated to fuzzer: run some tests with -fsanitize=address
486 - cd build-oss-fuzz && make check-qtest-i386 check-unit
489 <<: *native_build_job_definition
493 - TARGETS="aarch64 alpha arm hppa m68k microblaze moxie ppc64 s390x x86_64"
496 - ../configure --enable-tcg-interpreter
497 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
499 - make run-tcg-tests-x86_64-softmmu
500 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
501 - for tg in $TARGETS ; do
502 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
503 ./tests/qtest/boot-serial-test || exit 1 ;
504 ./tests/qtest/cdrom-test || exit 1 ;
506 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
507 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
509 # Alternate coroutines implementations are only really of interest to KVM users
510 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
511 build-coroutine-ucontext:
512 <<: *native_build_job_definition
515 CONFIGURE_ARGS: --with-coroutine=ucontext --disable-tcg
516 MAKE_CHECK_ARGS: check-unit
518 build-coroutine-sigaltstack:
519 <<: *native_build_job_definition
522 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
523 MAKE_CHECK_ARGS: check-unit
525 # Most jobs test latest gcrypt or nettle builds
527 # These jobs test old gcrypt and nettle from RHEL7
528 # which had some API differences.
529 build-crypto-old-nettle:
530 <<: *native_build_job_definition
533 TARGETS: x86_64-softmmu x86_64-linux-user
534 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle
535 MAKE_CHECK_ARGS: check-build
540 check-crypto-old-nettle:
541 <<: *native_test_job_definition
543 - job: build-crypto-old-nettle
547 MAKE_CHECK_ARGS: check
550 build-crypto-old-gcrypt:
551 <<: *native_build_job_definition
554 TARGETS: x86_64-softmmu x86_64-linux-user
555 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt
556 MAKE_CHECK_ARGS: check-build
561 check-crypto-old-gcrypt:
562 <<: *native_test_job_definition
564 - job: build-crypto-old-gcrypt
568 MAKE_CHECK_ARGS: check
571 build-crypto-only-gnutls:
572 <<: *native_build_job_definition
575 TARGETS: x86_64-softmmu x86_64-linux-user
576 CONFIGURE_ARGS: --disable-nettle --disable-gcrypt --enable-gnutls
577 MAKE_CHECK_ARGS: check-build
582 check-crypto-only-gnutls:
583 <<: *native_test_job_definition
585 - job: build-crypto-only-gnutls
589 MAKE_CHECK_ARGS: check
591 # We don't need to exercise every backend with every front-end
592 build-trace-multi-user:
593 <<: *native_build_job_definition
596 CONFIGURE_ARGS: --enable-trace-backends=log,simple,syslog --disable-system
598 build-trace-ftrace-system:
599 <<: *native_build_job_definition
602 CONFIGURE_ARGS: --enable-trace-backends=ftrace --target-list=x86_64-softmmu
604 build-trace-ust-system:
605 <<: *native_build_job_definition
608 CONFIGURE_ARGS: --enable-trace-backends=ust --target-list=x86_64-softmmu
610 # Check our reduced build configurations
611 build-without-default-devices:
612 <<: *native_build_job_definition
615 CONFIGURE_ARGS: --without-default-devices --disable-user
617 build-without-default-features:
618 <<: *native_build_job_definition
621 CONFIGURE_ARGS: --without-default-features --disable-user
622 --target-list-exclude=arm-softmmu,i386-softmmu,mipsel-softmmu,mips64-softmmu,ppc-softmmu
623 MAKE_CHECK_ARGS: check-unit
627 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
628 script: .gitlab-ci.d/check-patch.py
631 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
638 image: $CI_REGISTRY_IMAGE/qemu/centos8:latest
639 script: .gitlab-ci.d/check-dco.py
642 - $CI_PROJECT_NAMESPACE == 'qemu-project' && $CI_COMMIT_BRANCH == 'master'
648 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
650 - dnf install -y meson ninja-build
652 - mkdir subprojects/libvhost-user/build
653 - cd subprojects/libvhost-user/build
657 # Prepare for GitLab pages deployment. Anything copied into the
658 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
660 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
663 - job: build-tools-and-docs-debian
666 # HTML-ised source tree
668 - htags -anT --tree-view=filetree -m qemu_init
669 -t "Welcome to the QEMU sourcecode"
671 # Project documentation
672 - make -C build install DESTDIR=$(pwd)/temp-install
673 - mv temp-install/usr/local/share/doc/qemu/* public/