1include: 2 - local: '/.gitlab-ci.d/buildtest-template.yml' 3 4build-system-alpine: 5 extends: .native_build_job_template 6 needs: 7 - job: amd64-alpine-container 8 variables: 9 IMAGE: alpine 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 14 artifacts: 15 expire_in: 2 days 16 paths: 17 - .git-submodule-status 18 - build 19 20check-system-alpine: 21 extends: .native_test_job_template 22 needs: 23 - job: build-system-alpine 24 artifacts: true 25 variables: 26 IMAGE: alpine 27 MAKE_CHECK_ARGS: check-unit check-qtest 28 29avocado-system-alpine: 30 extends: .avocado_test_job_template 31 needs: 32 - job: build-system-alpine 33 artifacts: true 34 variables: 35 IMAGE: alpine 36 MAKE_CHECK_ARGS: check-avocado 37 38build-system-ubuntu: 39 extends: .native_build_job_template 40 needs: 41 job: amd64-ubuntu2004-container 42 variables: 43 IMAGE: ubuntu2004 44 CONFIGURE_ARGS: --enable-docs --enable-fdt=system --enable-slirp=system 45 --enable-capstone 46 TARGETS: aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu 47 microblazeel-softmmu mips64el-softmmu 48 MAKE_CHECK_ARGS: check-build 49 artifacts: 50 expire_in: 2 days 51 paths: 52 - build 53 54check-system-ubuntu: 55 extends: .native_test_job_template 56 needs: 57 - job: build-system-ubuntu 58 artifacts: true 59 variables: 60 IMAGE: ubuntu2004 61 MAKE_CHECK_ARGS: check 62 63avocado-system-ubuntu: 64 extends: .avocado_test_job_template 65 needs: 66 - job: build-system-ubuntu 67 artifacts: true 68 variables: 69 IMAGE: ubuntu2004 70 MAKE_CHECK_ARGS: check-avocado 71 72build-system-debian: 73 extends: .native_build_job_template 74 needs: 75 job: amd64-debian-container 76 variables: 77 IMAGE: debian-amd64 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 81 artifacts: 82 expire_in: 2 days 83 paths: 84 - build 85 86check-system-debian: 87 extends: .native_test_job_template 88 needs: 89 - job: build-system-debian 90 artifacts: true 91 variables: 92 IMAGE: debian-amd64 93 MAKE_CHECK_ARGS: check 94 95avocado-system-debian: 96 extends: .avocado_test_job_template 97 needs: 98 - job: build-system-debian 99 artifacts: true 100 variables: 101 IMAGE: debian-amd64 102 MAKE_CHECK_ARGS: check-avocado 103 104crash-test-debian: 105 extends: .native_test_job_template 106 needs: 107 - job: build-system-debian 108 artifacts: true 109 variables: 110 IMAGE: debian-amd64 111 script: 112 - cd build 113 - scripts/device-crash-test -q ./qemu-system-i386 114 115build-system-fedora: 116 extends: .native_build_job_template 117 needs: 118 job: amd64-fedora-container 119 variables: 120 IMAGE: fedora 121 CONFIGURE_ARGS: --disable-gcrypt --enable-nettle --enable-docs 122 --enable-fdt=system --enable-slirp=system --enable-capstone 123 TARGETS: tricore-softmmu microblaze-softmmu mips-softmmu 124 xtensa-softmmu m68k-softmmu riscv32-softmmu ppc-softmmu sparc64-softmmu 125 MAKE_CHECK_ARGS: check-build 126 artifacts: 127 expire_in: 2 days 128 paths: 129 - build 130 131check-system-fedora: 132 extends: .native_test_job_template 133 needs: 134 - job: build-system-fedora 135 artifacts: true 136 variables: 137 IMAGE: fedora 138 MAKE_CHECK_ARGS: check 139 140avocado-system-fedora: 141 extends: .avocado_test_job_template 142 needs: 143 - job: build-system-fedora 144 artifacts: true 145 variables: 146 IMAGE: fedora 147 MAKE_CHECK_ARGS: check-avocado 148 149crash-test-fedora: 150 extends: .native_test_job_template 151 needs: 152 - job: build-system-fedora 153 artifacts: true 154 variables: 155 IMAGE: fedora 156 script: 157 - cd build 158 - scripts/device-crash-test -q ./qemu-system-ppc 159 - scripts/device-crash-test -q ./qemu-system-riscv32 160 161build-system-centos: 162 extends: .native_build_job_template 163 needs: 164 job: amd64-centos8-container 165 variables: 166 IMAGE: centos8 167 CONFIGURE_ARGS: --disable-nettle --enable-gcrypt --enable-fdt=system 168 --enable-modules --enable-trace-backends=dtrace --enable-docs 169 TARGETS: ppc64-softmmu or1k-softmmu s390x-softmmu 170 x86_64-softmmu rx-softmmu sh4-softmmu nios2-softmmu 171 MAKE_CHECK_ARGS: check-build 172 artifacts: 173 expire_in: 2 days 174 paths: 175 - build 176 177check-system-centos: 178 extends: .native_test_job_template 179 needs: 180 - job: build-system-centos 181 artifacts: true 182 variables: 183 IMAGE: centos8 184 MAKE_CHECK_ARGS: check 185 186avocado-system-centos: 187 extends: .avocado_test_job_template 188 needs: 189 - job: build-system-centos 190 artifacts: true 191 variables: 192 IMAGE: centos8 193 MAKE_CHECK_ARGS: check-avocado 194 195build-system-opensuse: 196 extends: .native_build_job_template 197 needs: 198 job: amd64-opensuse-leap-container 199 variables: 200 IMAGE: opensuse-leap 201 CONFIGURE_ARGS: --enable-fdt=system 202 TARGETS: s390x-softmmu x86_64-softmmu aarch64-softmmu 203 MAKE_CHECK_ARGS: check-build 204 artifacts: 205 expire_in: 2 days 206 paths: 207 - build 208 209check-system-opensuse: 210 extends: .native_test_job_template 211 needs: 212 - job: build-system-opensuse 213 artifacts: true 214 variables: 215 IMAGE: opensuse-leap 216 MAKE_CHECK_ARGS: check 217 218avocado-system-opensuse: 219 extends: .avocado_test_job_template 220 needs: 221 - job: build-system-opensuse 222 artifacts: true 223 variables: 224 IMAGE: opensuse-leap 225 MAKE_CHECK_ARGS: check-avocado 226 227 228# This jobs explicitly disable TCG (--disable-tcg), KVM is detected by 229# the configure script. The container doesn't contain Xen headers so 230# Xen accelerator is not detected / selected. As result it build the 231# i386-softmmu and x86_64-softmmu with KVM being the single accelerator 232# available. 233# Also use a different coroutine implementation (which is only really of 234# interest to KVM users, i.e. with TCG disabled) 235build-tcg-disabled: 236 extends: .native_build_job_template 237 needs: 238 job: amd64-centos8-container 239 variables: 240 IMAGE: centos8 241 script: 242 - mkdir build 243 - cd build 244 - ../configure --disable-tcg --audio-drv-list="" --with-coroutine=ucontext 245 || { cat config.log meson-logs/meson-log.txt && exit 1; } 246 - make -j"$JOBS" 247 - make check-unit 248 - make check-qapi-schema 249 - cd tests/qemu-iotests/ 250 - ./check -raw 001 002 003 004 005 008 009 010 011 012 021 025 032 033 048 251 052 063 077 086 101 104 106 113 148 150 151 152 157 159 160 163 252 170 171 183 184 192 194 208 221 226 227 236 253 277 image-fleecing 253 - ./check -qcow2 028 051 056 057 058 065 068 082 085 091 095 096 102 122 254 124 132 139 142 144 145 151 152 155 157 165 194 196 200 202 255 208 209 216 218 227 234 246 247 248 250 254 255 257 258 256 260 261 262 263 264 270 272 273 277 279 image-fleecing 257 258build-user: 259 extends: .native_build_job_template 260 needs: 261 job: amd64-debian-user-cross-container 262 variables: 263 IMAGE: debian-all-test-cross 264 CONFIGURE_ARGS: --disable-tools --disable-system 265 MAKE_CHECK_ARGS: check-tcg 266 267build-user-static: 268 extends: .native_build_job_template 269 needs: 270 job: amd64-debian-user-cross-container 271 variables: 272 IMAGE: debian-all-test-cross 273 CONFIGURE_ARGS: --disable-tools --disable-system --static 274 MAKE_CHECK_ARGS: check-tcg 275 276# Because the hexagon cross-compiler takes so long to build we don't rely 277# on the CI system to build it and hence this job has an optional dependency 278# declared. The image is manually uploaded. 279build-user-hexagon: 280 extends: .native_build_job_template 281 needs: 282 job: hexagon-cross-container 283 optional: true 284 variables: 285 IMAGE: debian-hexagon-cross 286 TARGETS: hexagon-linux-user 287 CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg 288 MAKE_CHECK_ARGS: check-tcg 289 290# Only build the softmmu targets we have check-tcg tests for 291build-some-softmmu: 292 extends: .native_build_job_template 293 needs: 294 job: amd64-debian-user-cross-container 295 variables: 296 IMAGE: debian-all-test-cross 297 CONFIGURE_ARGS: --disable-tools --enable-debug 298 TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu 299 MAKE_CHECK_ARGS: check-tcg 300 301# We build tricore in a very minimal tricore only container 302build-tricore-softmmu: 303 extends: .native_build_job_template 304 needs: 305 job: tricore-debian-cross-container 306 variables: 307 IMAGE: debian-tricore-cross 308 CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug 309 TARGETS: tricore-softmmu 310 MAKE_CHECK_ARGS: check-tcg 311 312clang-system: 313 extends: .native_build_job_template 314 needs: 315 job: amd64-fedora-container 316 variables: 317 IMAGE: fedora 318 CONFIGURE_ARGS: --cc=clang --cxx=clang++ 319 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined 320 TARGETS: alpha-softmmu arm-softmmu m68k-softmmu mips64-softmmu 321 ppc-softmmu s390x-softmmu 322 MAKE_CHECK_ARGS: check-qtest check-tcg 323 324clang-user: 325 extends: .native_build_job_template 326 needs: 327 job: amd64-debian-user-cross-container 328 variables: 329 IMAGE: debian-all-test-cross 330 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --disable-system 331 --target-list-exclude=microblazeel-linux-user,aarch64_be-linux-user,i386-linux-user,m68k-linux-user,mipsn32el-linux-user,xtensaeb-linux-user 332 --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined 333 MAKE_CHECK_ARGS: check-unit check-tcg 334 335# Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory. 336# On gitlab runners, default value sometimes end up calling 2 lds concurrently and 337# triggers an Out-Of-Memory error 338# 339# Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together 340# with QEMU and linked as a static library to avoid false positives in CFI checks. 341# This can be accomplished by using -enable-slirp=git, which avoids the use of 342# a system-wide version of the library 343# 344# Split in three sets of build/check/avocado to limit the execution time of each 345# job 346build-cfi-aarch64: 347 extends: .native_build_job_template 348 needs: 349 - job: amd64-fedora-container 350 variables: 351 LD_JOBS: 1 352 AR: llvm-ar 353 IMAGE: fedora 354 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug 355 --enable-safe-stack --enable-slirp=git 356 TARGETS: aarch64-softmmu 357 MAKE_CHECK_ARGS: check-build 358 timeout: 70m 359 artifacts: 360 expire_in: 2 days 361 paths: 362 - build 363 variables: 364 # FIXME: This job is often failing, likely due to out-of-memory problems in 365 # the constrained containers of the shared runners. Thus this is marked as 366 # skipped until the situation has been solved. 367 QEMU_JOB_SKIPPED: 1 368 369check-cfi-aarch64: 370 extends: .native_test_job_template 371 needs: 372 - job: build-cfi-aarch64 373 artifacts: true 374 variables: 375 IMAGE: fedora 376 MAKE_CHECK_ARGS: check 377 378avocado-cfi-aarch64: 379 extends: .avocado_test_job_template 380 needs: 381 - job: build-cfi-aarch64 382 artifacts: true 383 variables: 384 IMAGE: fedora 385 MAKE_CHECK_ARGS: check-avocado 386 387build-cfi-ppc64-s390x: 388 extends: .native_build_job_template 389 needs: 390 - job: amd64-fedora-container 391 variables: 392 LD_JOBS: 1 393 AR: llvm-ar 394 IMAGE: fedora 395 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug 396 --enable-safe-stack --enable-slirp=git 397 TARGETS: ppc64-softmmu s390x-softmmu 398 MAKE_CHECK_ARGS: check-build 399 timeout: 70m 400 artifacts: 401 expire_in: 2 days 402 paths: 403 - build 404 variables: 405 # FIXME: This job is often failing, likely due to out-of-memory problems in 406 # the constrained containers of the shared runners. Thus this is marked as 407 # skipped until the situation has been solved. 408 QEMU_JOB_SKIPPED: 1 409 410check-cfi-ppc64-s390x: 411 extends: .native_test_job_template 412 needs: 413 - job: build-cfi-ppc64-s390x 414 artifacts: true 415 variables: 416 IMAGE: fedora 417 MAKE_CHECK_ARGS: check 418 419avocado-cfi-ppc64-s390x: 420 extends: .avocado_test_job_template 421 needs: 422 - job: build-cfi-ppc64-s390x 423 artifacts: true 424 variables: 425 IMAGE: fedora 426 MAKE_CHECK_ARGS: check-avocado 427 428build-cfi-x86_64: 429 extends: .native_build_job_template 430 needs: 431 - job: amd64-fedora-container 432 variables: 433 LD_JOBS: 1 434 AR: llvm-ar 435 IMAGE: fedora 436 CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug 437 --enable-safe-stack --enable-slirp=git 438 TARGETS: x86_64-softmmu 439 MAKE_CHECK_ARGS: check-build 440 timeout: 70m 441 artifacts: 442 expire_in: 2 days 443 paths: 444 - build 445 446check-cfi-x86_64: 447 extends: .native_test_job_template 448 needs: 449 - job: build-cfi-x86_64 450 artifacts: true 451 variables: 452 IMAGE: fedora 453 MAKE_CHECK_ARGS: check 454 455avocado-cfi-x86_64: 456 extends: .avocado_test_job_template 457 needs: 458 - job: build-cfi-x86_64 459 artifacts: true 460 variables: 461 IMAGE: fedora 462 MAKE_CHECK_ARGS: check-avocado 463 464tsan-build: 465 extends: .native_build_job_template 466 needs: 467 job: amd64-ubuntu2004-container 468 variables: 469 IMAGE: ubuntu2004 470 CONFIGURE_ARGS: --enable-tsan --cc=clang-10 --cxx=clang++-10 471 --enable-trace-backends=ust --enable-fdt=system --enable-slirp=system 472 TARGETS: x86_64-softmmu ppc64-softmmu riscv64-softmmu x86_64-linux-user 473 MAKE_CHECK_ARGS: bench V=1 474 475# gprof/gcov are GCC features 476build-gprof-gcov: 477 extends: .native_build_job_template 478 needs: 479 job: amd64-ubuntu2004-container 480 variables: 481 IMAGE: ubuntu2004 482 CONFIGURE_ARGS: --enable-gprof --enable-gcov 483 TARGETS: aarch64-softmmu ppc64-softmmu s390x-softmmu x86_64-softmmu 484 artifacts: 485 expire_in: 1 days 486 paths: 487 - build 488 489check-gprof-gcov: 490 extends: .native_test_job_template 491 needs: 492 - job: build-gprof-gcov 493 artifacts: true 494 variables: 495 IMAGE: ubuntu2004 496 MAKE_CHECK_ARGS: check 497 after_script: 498 - ${CI_PROJECT_DIR}/scripts/ci/coverage-summary.sh 499 500build-oss-fuzz: 501 extends: .native_build_job_template 502 needs: 503 job: amd64-fedora-container 504 variables: 505 IMAGE: fedora 506 script: 507 - mkdir build-oss-fuzz 508 - CC="clang" CXX="clang++" CFLAGS="-fsanitize=address" 509 ./scripts/oss-fuzz/build.sh 510 - export ASAN_OPTIONS="fast_unwind_on_malloc=0" 511 - for fuzzer in $(find ./build-oss-fuzz/DEST_DIR/ -executable -type f 512 | grep -v slirp); do 513 grep "LLVMFuzzerTestOneInput" ${fuzzer} > /dev/null 2>&1 || continue ; 514 echo Testing ${fuzzer} ... ; 515 "${fuzzer}" -runs=1 -seed=1 || exit 1 ; 516 done 517 518build-tci: 519 extends: .native_build_job_template 520 needs: 521 job: amd64-debian-user-cross-container 522 variables: 523 IMAGE: debian-all-test-cross 524 script: 525 - TARGETS="aarch64 alpha arm hppa m68k microblaze ppc64 s390x x86_64" 526 - mkdir build 527 - cd build 528 - ../configure --enable-tcg-interpreter 529 --target-list="$(for tg in $TARGETS; do echo -n ${tg}'-softmmu '; done)" || { cat config.log meson-logs/meson-log.txt && exit 1; } 530 - make -j"$JOBS" 531 - make tests/qtest/boot-serial-test tests/qtest/cdrom-test tests/qtest/pxe-test 532 - for tg in $TARGETS ; do 533 export QTEST_QEMU_BINARY="./qemu-system-${tg}" ; 534 ./tests/qtest/boot-serial-test || exit 1 ; 535 ./tests/qtest/cdrom-test || exit 1 ; 536 done 537 - QTEST_QEMU_BINARY="./qemu-system-x86_64" ./tests/qtest/pxe-test 538 - QTEST_QEMU_BINARY="./qemu-system-s390x" ./tests/qtest/pxe-test -m slow 539 - make check-tcg 540 541# Alternate coroutines implementations are only really of interest to KVM users 542# However we can't test against KVM on Gitlab-CI so we can only run unit tests 543build-coroutine-sigaltstack: 544 extends: .native_build_job_template 545 needs: 546 job: amd64-ubuntu2004-container 547 variables: 548 IMAGE: ubuntu2004 549 CONFIGURE_ARGS: --with-coroutine=sigaltstack --disable-tcg 550 --enable-trace-backends=ftrace 551 MAKE_CHECK_ARGS: check-unit 552 553# Check our reduced build configurations 554build-without-default-devices: 555 extends: .native_build_job_template 556 needs: 557 job: amd64-centos8-container 558 variables: 559 IMAGE: centos8 560 CONFIGURE_ARGS: --without-default-devices --disable-user 561 562build-without-default-features: 563 extends: .native_build_job_template 564 needs: 565 job: amd64-fedora-container 566 variables: 567 IMAGE: fedora 568 CONFIGURE_ARGS: 569 --without-default-features 570 --disable-capstone 571 --disable-pie 572 --disable-qom-cast-debug 573 --disable-slirp 574 --disable-strip 575 TARGETS: avr-softmmu i386-softmmu mips64-softmmu s390x-softmmu sh4-softmmu 576 sparc64-softmmu hexagon-linux-user i386-linux-user s390x-linux-user 577 MAKE_CHECK_ARGS: check-unit check-qtest SPEED=slow 578 579build-libvhost-user: 580 extends: .base_job_template 581 stage: build 582 image: $CI_REGISTRY_IMAGE/qemu/fedora:latest 583 needs: 584 job: amd64-fedora-container 585 script: 586 - mkdir subprojects/libvhost-user/build 587 - cd subprojects/libvhost-user/build 588 - meson 589 - ninja 590 591# No targets are built here, just tools, docs, and unit tests. This 592# also feeds into the eventual documentation deployment steps later 593build-tools-and-docs-debian: 594 extends: .native_build_job_template 595 needs: 596 job: amd64-debian-container 597 # when running on 'master' we use pre-existing container 598 optional: true 599 variables: 600 IMAGE: debian-amd64 601 MAKE_CHECK_ARGS: check-unit check-softfloat ctags TAGS cscope 602 CONFIGURE_ARGS: --disable-system --disable-user --enable-docs --enable-tools 603 QEMU_JOB_PUBLISH: 1 604 artifacts: 605 expire_in: 2 days 606 paths: 607 - build 608 609# Prepare for GitLab pages deployment. Anything copied into the 610# "public" directory will be deployed to $USER.gitlab.io/$PROJECT 611# 612# GitLab publishes from any branch that triggers a CI pipeline 613# 614# For the main repo we don't want to publish from 'staging' 615# since that content may not be pushed, nor do we wish to 616# publish from 'stable-NNN' branches as that content is outdated. 617# Thus we restrict to just the default branch 618# 619# For contributor forks we want to publish from any repo so 620# that users can see the results of their commits, regardless 621# of what topic branch they're currently using 622pages: 623 extends: .base_job_template 624 image: $CI_REGISTRY_IMAGE/qemu/debian-amd64:latest 625 stage: test 626 needs: 627 - job: build-tools-and-docs-debian 628 script: 629 - mkdir -p public 630 # HTML-ised source tree 631 - make gtags 632 - htags -anT --tree-view=filetree -m qemu_init 633 -t "Welcome to the QEMU sourcecode" 634 - mv HTML public/src 635 # Project documentation 636 - make -C build install DESTDIR=$(pwd)/temp-install 637 - mv temp-install/usr/local/share/doc/qemu/* public/ 638 artifacts: 639 paths: 640 - public 641 variables: 642 QEMU_JOB_PUBLISH: 1 643