2 - local: '/.gitlab-ci.d/buildtest-template.yml'
5 extends: .native_build_job_template
7 - job: amd64-alpine-container
10 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
11 microblazeel-softmmu mips64el-softmmu
12 MAKE_CHECK_ARGS: check-build
13 CONFIGURE_ARGS: --enable-docs --enable-trace-backends=log,simple,syslog
17 - .git-submodule-status
21 extends: .native_test_job_template
23 - job: build-system-alpine
27 MAKE_CHECK_ARGS: check
29 acceptance-system-alpine:
30 extends: .acceptance_test_job_template
32 - job: build-system-alpine
36 MAKE_CHECK_ARGS: check-acceptance
39 extends: .native_build_job_template
41 job: amd64-ubuntu2004-container
44 CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system
45 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu
46 microblazeel-softmmu mips64el-softmmu
47 MAKE_CHECK_ARGS: check-build
54 extends: .native_test_job_template
56 - job: build-system-ubuntu
60 MAKE_CHECK_ARGS: check
62 acceptance-system-ubuntu:
63 extends: .acceptance_test_job_template
65 - job: build-system-ubuntu
69 MAKE_CHECK_ARGS: check-acceptance
72 extends: .native_build_job_template
74 job: amd64-debian-container
77 CONFIGURE_ARGS: --enable-fdt=system
78 TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
79 riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
80 MAKE_CHECK_ARGS: check-build
87 extends: .native_test_job_template
89 - job: build-system-debian
93 MAKE_CHECK_ARGS: check
95 acceptance-system-debian:
96 extends: .acceptance_test_job_template
98 - job: build-system-debian
102 MAKE_CHECK_ARGS: check-acceptance
105 extends: .native_build_job_template
107 job: amd64-fedora-container
110 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs
111 --enable-fdt=system --enable-slirp=system --enable-capstone=system
112 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu
113 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu
114 MAKE_CHECK_ARGS: check-build
121 extends: .native_test_job_template
123 - job: build-system-fedora
127 MAKE_CHECK_ARGS: check
129 acceptance-system-fedora:
130 extends: .acceptance_test_job_template
132 - job: build-system-fedora
136 MAKE_CHECK_ARGS: check-acceptance
139 extends: .native_build_job_template
141 job: amd64-centos8-container
144 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system
145 --enable-modules --enable-trace-backends=dtrace
146 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu
147 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu
148 MAKE_CHECK_ARGS: check-build
155 extends: .native_test_job_template
157 - job: build-system-centos
161 MAKE_CHECK_ARGS: check
163 acceptance-system-centos:
164 extends: .acceptance_test_job_template
166 - job: build-system-centos
170 MAKE_CHECK_ARGS: check-acceptance
172 build-system-opensuse:
173 extends: .native_build_job_template
175 job: amd64-opensuse-leap-container
178 CONFIGURE_ARGS: --enable-fdt=system
179 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu
180 MAKE_CHECK_ARGS: check-build
186 check-system-opensuse:
187 extends: .native_test_job_template
189 - job: build-system-opensuse
193 MAKE_CHECK_ARGS: check
195 acceptance-system-opensuse:
196 extends: .acceptance_test_job_template
198 - job: build-system-opensuse
202 MAKE_CHECK_ARGS: check-acceptance
205 # This jobs explicitly disable TCG (--disable-tcg), KVM is detected by
206 # the configure script. The container doesn't contain Xen headers so
207 # Xen accelerator is not detected / selected. As result it build the
208 # i386-softmmu and x86_64-softmmu with KVM being the single accelerator
210 # Also use a different coroutine implementation (which is only really of
211 # interest to KVM users, i.e. with TCG disabled)
213 extends: .native_build_job_template
215 job: amd64-centos8-container
221 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext
222 || { cat config.log meson-logs/meson-log.txt && exit 1; }
225 - make check-qapi-schema
226 - cd tests/qemu-iotests/
227 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048
228 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163
229 170 171 183 184 192 194 208 221 222 226 227 236 253 277
230 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122
231 124 132 139 142 144 145 151 152 155 157 165 194 196 200 202
232 208 209 216 218 222 227 234 246 247 248 250 254 255 257 258
233 260 261 262 263 264 270 272 273 277 279
236 extends: .native_build_job_template
238 job: amd64-debian-user-cross-container
240 IMAGE: debian-all-test-cross
241 CONFIGURE_ARGS: --disable-tools --disable-system
242 MAKE_CHECK_ARGS: check-tcg
245 extends: .native_build_job_template
247 job: amd64-debian-user-cross-container
249 IMAGE: debian-all-test-cross
250 CONFIGURE_ARGS: --disable-tools --disable-system --static
251 MAKE_CHECK_ARGS: check-tcg
253 # Because the hexagon cross-compiler takes so long to build we don't rely
254 # on the CI system to build it and hence this job has an optional dependency
255 # declared. The image is manually uploaded.
257 extends: .native_build_job_template
259 job: hexagon-cross-container
262 IMAGE: debian-hexagon-cross
263 TARGETS: hexagon-linux-user
264 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg
265 MAKE_CHECK_ARGS: check-tcg
267 # Only build the softmmu targets we have check-tcg tests for
269 extends: .native_build_job_template
271 job: amd64-debian-user-cross-container
273 IMAGE: debian-all-test-cross
274 CONFIGURE_ARGS: --disable-tools --enable-debug
275 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
276 MAKE_CHECK_ARGS: check-tcg
278 # We build tricore in a very minimal tricore only container
279 build-tricore-softmmu:
280 extends: .native_build_job_template
282 job: tricore-debian-cross-container
284 IMAGE: debian-tricore-cross
285 CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
286 TARGETS: tricore-softmmu
287 MAKE_CHECK_ARGS: check-tcg
290 extends: .native_build_job_template
292 job: amd64-fedora-container
295 CONFIGURE_ARGS: --cc=clang --cxx=clang++
296 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
297 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu
298 ppc-softmmu s390x-softmmu
299 MAKE_CHECK_ARGS: check-qtest check-tcg
302 extends: .native_build_job_template
304 job: amd64-debian-user-cross-container
306 IMAGE: debian-all-test-cross
307 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system
308 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user
309 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined
310 MAKE_CHECK_ARGS: check-unit check-tcg
312 # Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory.
313 # On gitlab runners, default value sometimes end up calling 2 lds concurrently and
314 # triggers an Out-Of-Memory error
316 # Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together
317 # with QEMU and linked as a static library to avoid false positives in CFI checks.
318 # This can be accomplished by using -enable-slirp=git, which avoids the use of
319 # a system-wide version of the library
321 # Split in three sets of build/check/acceptance to limit the execution time of each
324 extends: .native_build_job_template
326 - job: amd64-fedora-container
331 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
332 --enable-safe-stack --enable-slirp=git
333 TARGETS: aarch64-softmmu
334 MAKE_CHECK_ARGS: check-build
341 # FIXME: This job is often failing, likely due to out-of-memory problems in
342 # the constrained containers of the shared runners. Thus this is marked as
343 # manual until the situation has been solved.
348 extends: .native_test_job_template
350 - job: build-cfi-aarch64
354 MAKE_CHECK_ARGS: check
356 acceptance-cfi-aarch64:
357 extends: .acceptance_test_job_template
359 - job: build-cfi-aarch64
363 MAKE_CHECK_ARGS: check-acceptance
365 build-cfi-ppc64-s390x:
366 extends: .native_build_job_template
368 - job: amd64-fedora-container
373 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
374 --enable-safe-stack --enable-slirp=git
375 TARGETS: ppc64-softmmu s390x-softmmu
376 MAKE_CHECK_ARGS: check-build
383 # FIXME: This job is often failing, likely due to out-of-memory problems in
384 # the constrained containers of the shared runners. Thus this is marked as
385 # manual until the situation has been solved.
389 check-cfi-ppc64-s390x:
390 extends: .native_test_job_template
392 - job: build-cfi-ppc64-s390x
396 MAKE_CHECK_ARGS: check
398 acceptance-cfi-ppc64-s390x:
399 extends: .acceptance_test_job_template
401 - job: build-cfi-ppc64-s390x
405 MAKE_CHECK_ARGS: check-acceptance
408 extends: .native_build_job_template
410 - job: amd64-fedora-container
415 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug
416 --enable-safe-stack --enable-slirp=git
417 TARGETS: x86_64-softmmu
418 MAKE_CHECK_ARGS: check-build
426 extends: .native_test_job_template
428 - job: build-cfi-x86_64
432 MAKE_CHECK_ARGS: check
434 acceptance-cfi-x86_64:
435 extends: .acceptance_test_job_template
437 - job: build-cfi-x86_64
441 MAKE_CHECK_ARGS: check-acceptance
444 extends: .native_build_job_template
446 job: amd64-ubuntu2004-container
449 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10
450 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system
451 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user
452 MAKE_CHECK_ARGS: bench V=1
454 # These targets are on the way out
456 extends: .native_build_job_template
458 job: amd64-debian-user-cross-container
460 IMAGE: debian-all-test-cross
461 CONFIGURE_ARGS: --disable-tools
462 MAKE_CHECK_ARGS: build-tcg
463 TARGETS: ppc64abi32-linux-user
469 # We split the check-tcg step as test failures are expected but we still
470 # want to catch the build breaking.
472 extends: .native_test_job_template
474 - job: build-deprecated
477 IMAGE: debian-all-test-cross
478 MAKE_CHECK_ARGS: check-tcg
481 # gprof/gcov are GCC features
483 extends: .native_build_job_template
485 job: amd64-ubuntu2004-container
488 CONFIGURE_ARGS: --enable-gprof --enable-gcov
489 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu
496 extends: .native_test_job_template
498 - job: build-gprof-gcov
502 MAKE_CHECK_ARGS: check
504 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh
507 extends: .native_build_job_template
509 job: amd64-fedora-container
513 - mkdir build-oss-fuzz
514 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address"
515 ./scripts/oss-fuzz/build.sh
516 - export ASAN_OPTIONS="fast_unwind_on_malloc=0"
517 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f
519 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ;
520 echo Testing ${fuzzer} ... ;
521 "${fuzzer}" -runs=1 -seed=1 || exit 1 ;
523 # Unrelated to fuzzer: run some tests with -fsanitize=address
524 - cd build-oss-fuzz && make check-qtest-i386 check-unit
527 extends: .native_build_job_template
529 job: amd64-debian-user-cross-container
531 IMAGE: debian-all-test-cross
533 - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64"
536 - ../configure --enable-tcg-interpreter
537 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; }
539 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test
540 - for tg in $TARGETS ; do
541 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ;
542 ./tests/qtest/boot-serial-test || exit 1 ;
543 ./tests/qtest/cdrom-test || exit 1 ;
545 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test
546 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow
549 # Alternate coroutines implementations are only really of interest to KVM users
550 # However we can't test against KVM on Gitlab-CI so we can only run unit tests
551 build-coroutine-sigaltstack:
552 extends: .native_build_job_template
554 job: amd64-ubuntu2004-container
557 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg
558 --enable-trace-backends=ftrace
559 MAKE_CHECK_ARGS: check-unit
561 # Check our reduced build configurations
562 build-without-default-devices:
563 extends: .native_build_job_template
565 job: amd64-centos8-container
568 CONFIGURE_ARGS: --without-default-devices --disable-user
570 build-without-default-features:
571 extends: .native_build_job_template
573 job: amd64-fedora-container
577 --without-default-features
581 --disable-qom-cast-debug
584 TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu
585 sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user
586 MAKE_CHECK_ARGS: check-unit check-qtest SPEED=slow
590 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest
592 job: amd64-fedora-container
594 - dnf install -y meson ninja-build
596 - mkdir subprojects/libvhost-user/build
597 - cd subprojects/libvhost-user/build
601 # No targets are built here, just tools, docs, and unit tests. This
602 # also feeds into the eventual documentation deployment steps later
603 build-tools-and-docs-debian:
604 extends: .native_build_job_template
606 job: amd64-debian-container
609 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope
610 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools
616 # Prepare for GitLab pages deployment. Anything copied into the
617 # "public" directory will be deployed to $USER.gitlab.io/$PROJECT
619 # GitLab publishes from any branch that triggers a CI pipeline
621 # For the main repo we don't want to publish from 'staging'
622 # since that content may not be pushed, nor do we wish to
623 # publish from 'stable-NNN' branches as that content is outdated.
624 # Thus we restrict to just the default branch
626 # For contributor forks we want to publish from any repo so
627 # that users can see the results of their commits, regardless
628 # of what topic branch they're currently using
630 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest
633 - job: build-tools-and-docs-debian
636 # HTML-ised source tree
638 - htags -anT --tree-view=filetree -m qemu_init
639 -t "Welcome to the QEMU sourcecode"
641 # Project documentation
642 - make -C build install DESTDIR=$(pwd)/temp-install
643 - mv temp-install/usr/local/share/doc/qemu/* public/
648 - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
650 - if: '$CI_PROJECT_NAMESPACE == "qemu-project"'
652 - if: '$CI_PROJECT_NAMESPACE != "qemu-project"'