From nobody Fri May 17 11:05:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) client-ip=209.85.221.49; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f49.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1621956578; cv=none; d=zohomail.com; s=zohoarc; b=OOYd+vbyShOXi5IbMEMjS4/S6YMspXvfdMZ6prVVBFJpNOHl1fy/SkhFjWjQIgye9oTd8UwLhWAQsma5r9OSmZZvFGJrd0ItyJjq+OfV1p2Oavnq3mDV18hCNx3MifzMPYcwPiBgzlpoQukKn3Kk5UZtIiHrzpP4ZpSohyt22Fo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621956578; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Sender:Subject:To; bh=B4yZ3Scg1qTEkImpfESz/S8s0r+eLz6mR36tZkVG/Vo=; b=bM51b69RXfNwUpdpYkFG75Nv/Zr9iSVNODxarE7oDtpsMgwhn0K/bkvxlV1qis0QMBa1Zxyjgha8uhIOQCQVIUxnHmS2i1KUWwFumW4wHu+IO4eyHpB2kK7W5LpAXGQiIT+xl8H/QLIAXBYXxUbjY6QS0jN0BAhiLWY5gNt5gHM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.49 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by mx.zohomail.com with SMTPS id 1621956578586837.299967317005; Tue, 25 May 2021 08:29:38 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id v12so32718967wrq.6 for ; Tue, 25 May 2021 08:29:38 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (31.red-83-51-215.dynamicip.rima-tde.net. [83.51.215.31]) by smtp.gmail.com with ESMTPSA id c194sm3192653wme.46.2021.05.25.08.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=B4yZ3Scg1qTEkImpfESz/S8s0r+eLz6mR36tZkVG/Vo=; b=DL3hMu77YqVzC2J5ysm2dBBLaicMpSO/rCQlHopUQWuz4SElFaQHHiuAk34MNuBHgp I8UCJjAkKpUkXMr/UZ4Ah/k8C05IvX2z63mSwctYExaES8yy/7HzL7uhSN5LEeyW4Zrl Jsg3+IRQP0zXHVpWxrJReeSsACmK4jTvIdrISyuwLWsADUqnvGD9FAQVgUXW0Z3+oqUm 8wkUaMgcjtchgP/UqvySREp1CZelb+R2drkqdW8mag+T1ti3BldVrfFqxHqMlpYbmWBw 4kQdeuEEV6cGw6VnZy2QNO5/ORsjZ/Ywxlkmwb6s4HK/sGlyB8cHAxRf8PhvGNftPHYT exkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=B4yZ3Scg1qTEkImpfESz/S8s0r+eLz6mR36tZkVG/Vo=; b=I58+UScShqkjA1P5R/tlvBH8nLt4mERTV6xBksfRLSrH3ZeVIkGVSXMP+7xvEl/Mvx R4JBHTiBTvYJRIpBxEYjKjPA9gfIkce71be2cdkwqxUxlq8sw3j8THqgZ/MT7CtuLsN5 f5oN2td5QHJl8glw7qH3WgXMLRCrltwdt+G2SnegEXbtiYWzg9V1aEm/EYPBnQhB9zbs NURrkpLrVx+MySY0Xyc/A5U5L8doKJWS16Rndz2HerdtLILwZwq+31lhO+Rjghr1QH9Q k7RVbwHzJEp+UpK+pbGcpY12lUemx3LNCmYxil+RCcSkUzaTGASIQk44POa5A/keFPld cTDg== X-Gm-Message-State: AOAM532NYHgw+t8kAx7jHiS7ydjO1dVmYUAGe9yl4lZMbJB4pVeM1tBK l4ZRm1e2pp1K/GvCPFRLkH0= X-Google-Smtp-Source: ABdhPJzANshGLul/ldr7AM8iJkqY6/G3xF0PDL+nJyqVj5XRyC0DptYIm3Xs6it/DmH42PHoJoszAg== X-Received: by 2002:adf:fbce:: with SMTP id d14mr8553954wrs.201.1621956576813; Tue, 25 May 2021 08:29:36 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Willian Rampazzo , Wainer dos Santos Moschetta , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Paolo Bonzini , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] gitlab-ci: Add jobs to build standalone machines Date: Tue, 25 May 2021 17:29:24 +0200 Message-Id: <20210525152924.4171401-1-f4bug@amsat.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The --without-default-devices configure option removes the 'default=3Dy' from Kconfig files. It is useful to test missing Kconfig dependencies for users wanting to have QEMU (system) binaries with a particular subset of machines builtin. If a machine can be built standalone, it can certainly be built as part of a set. So the best way to test for regressions is to test each machine individually. As this is painful to test manually, add CI jobs to do it [*]. Since all jobs follow the same template, to ease maintenance we generate the jobs using the jsonnet tool, which emit a YAML file filled with all our jobs. Since there is no "--enable-my-config" option, we have to write the standalone config manually, overwritting each target .mak file in default-configs/devices/. The job is set to manual (there is no change in the current set of jobs), but can be started automatically by setting the QEMU_CI_STANDALONE_MACHINE_TESTING variable. [*] https://docs.gitlab.com/ee/ci/yaml/#trigger-child-pipeline-with-generat= ed-configuration-file Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Example: https://gitlab.com/philmd/qemu/-/pipelines/309272883 Based-on: <20210525082556.4011380-1-f4bug@amsat.org> --- .gitlab-ci.d/qemu-project.yml | 1 + .gitlab-ci.d/standalone-jobs-template.yml | 32 ++++++++++ .gitlab-ci.d/standalone-jobs.jsonnet | 74 +++++++++++++++++++++++ .gitlab-ci.d/standalone-jobs.yml | 27 +++++++++ .gitlab-ci.yml | 3 + 5 files changed, 137 insertions(+) create mode 100644 .gitlab-ci.d/standalone-jobs-template.yml create mode 100644 .gitlab-ci.d/standalone-jobs.jsonnet create mode 100644 .gitlab-ci.d/standalone-jobs.yml diff --git a/.gitlab-ci.d/qemu-project.yml b/.gitlab-ci.d/qemu-project.yml index 64cb2ba1da5..4018c48761c 100644 --- a/.gitlab-ci.d/qemu-project.yml +++ b/.gitlab-ci.d/qemu-project.yml @@ -9,3 +9,4 @@ include: - local: '/.gitlab-ci.d/crossbuilds.yml' - local: '/.gitlab-ci.d/buildtest.yml' - local: '/.gitlab-ci.d/static_checks.yml' + - local: '/.gitlab-ci.d/standalone-jobs.yml' diff --git a/.gitlab-ci.d/standalone-jobs-template.yml b/.gitlab-ci.d/stand= alone-jobs-template.yml new file mode 100644 index 00000000000..23e60cb4069 --- /dev/null +++ b/.gitlab-ci.d/standalone-jobs-template.yml @@ -0,0 +1,32 @@ +.native_build_standalone_job_template: + stage: build + image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest + variables: + IMAGE: fedora + CONFIGURE_ARGS: + --without-default-devices + --disable-user + --disable-tools + --disable-docs + before_script: + - JOBS=3D$(expr $(nproc) + 1) + script: + - for target in $TARGETS ; do + echo > default-configs/devices/${target}-softmmu.mak ; + for line in $DEVICE_CONFIGS ; do + echo "$line" + echo "$line" > default-configs/devices/${target}-softmmu.mak ; + done ; + done + - mkdir build + - cd build + - ../configure --enable-werror $CONFIGURE_ARGS --target-list=3D"$TARGE= TS" + || { cat config.log meson-logs/meson-log.txt && exit 1; } + - QEMU_BINS=3D$(echo $(for target in $TARGETS; do echo qemu-system-${t= arget//-softmmu/}; done)) + - make -j"$JOBS" $QEMU_BINS + - for binary in $QEMU_BINS ; do + for machine in $(./$binary -M help | egrep -v "^(Supported|none)" = | awk '{print $1}') ; do + echo "=3D=3D=3D testing $machine with $binary =3D=3D=3D" ; + echo q | ./$binary -M $machine -nodefaults -display none $TEST= ING_ARGS -monitor stdio -S || exit 1 ; + done ; + done diff --git a/.gitlab-ci.d/standalone-jobs.jsonnet b/.gitlab-ci.d/standalone= -jobs.jsonnet new file mode 100644 index 00000000000..6f403a51091 --- /dev/null +++ b/.gitlab-ci.d/standalone-jobs.jsonnet @@ -0,0 +1,74 @@ +local param_job(targets, configs, cmdline=3D"") =3D + { + extends: ".native_build_standalone_job_template", + + variables: { + TARGETS: targets, + DEVICE_CONFIGS: configs, + TESTING_ARGS: cmdline, + } + }; + +{ + include: { "local": "/.gitlab-ci.d/standalone-jobs-template.yml" }, + + // alpha + "alpha dp264": param_job("alpha-softmmu", "CONFIG_DP264=3Dy"), + + // arm + + // avr + "avr arduino": param_job("avr-softmmu", "CONFIG_ARDUINO=3Dy"), + + // cris + + // hexagon + + // hppa + "hppa dino": param_job("hppa-softmmu", "CONFIG_DINO=3Dy"), + + // i386 + "x86 isapc": param_job("i386-softmmu", "CONFIG_ISAPC=3Dy"), + "x86 microvm": param_job("x86_64-softmmu", "CONFIG_MICROVM=3Dy"), + + // m68k + + // microblaze + "mb zynqmp-pmu": param_job("microblaze-softmmu", "CONFIG_XLNX_ZYNQMP_P= MU=3Dy"), + "mb ml605": param_job("microblaze-softmmu", "CONFIG_PETALOGIX_ML605=3D= y"), + "mb s3adsp1800": param_job("microblaze-softmmu", "CONFIG_PETALOGIX_S3A= DSP1800=3Dy"), + + // mips + "mips jazz": param_job("mips64-softmmu", "CONFIG_FULOONG=3Dy"), + "mips loongson3v": param_job("mips64-softmmu", "CONFIG_LOONGSON3V=3Dy"= ), + "mips malta": param_job("mips-softmmu mipsel-softmmu", "CONFIG_MALTA= =3Dy", "-bios /dev/null"), + + // nios2 + "nios2 10m50": param_job("nios2-softmmu", "CONFIG_NIOS2_10M50=3Dy"), + "nios2 nommu": param_job("nios2-softmmu", "CONFIG_NIOS2_GENERIC_NOMMU= =3Dy"), + + // openrisc + "or1k sim": param_job("or1k-softmmu", "CONFIG_OR1K_SIM=3Dy"), + + // ppc + + // riscv + "riscv opentitan": param_job("riscv32-softmmu", "CONFIG_OPENTITAN=3Dy"= ), + + // rx + "rx gdbsim": param_job("rx-softmmu", "CONFIG_RX_GDBSIM=3Dy", "-bios /d= ev/null"), + + // s390x + "s390 ccw": param_job("s390x-softmmu", "CONFIG_S390_CCW_VIRTIO=3Dy"), + + // sh4 + + // sparc + + // tricore + "triboard": param_job("tricore-softmmu", "CONFIG_TRIBOARD=3Dy"), + + // xtensa + "xtensa sim": param_job("xtensaeb-softmmu", "CONFIG_XTENSA_SIM=3Dy CON= FIG_SEMIHOSTING=3Dy"), + "xtensa virt": param_job("xtensa-softmmu", "CONFIG_XTENSA_VIRT=3Dy CON= FIG_SEMIHOSTING=3Dy"), +} diff --git a/.gitlab-ci.d/standalone-jobs.yml b/.gitlab-ci.d/standalone-job= s.yml new file mode 100644 index 00000000000..b094173ff12 --- /dev/null +++ b/.gitlab-ci.d/standalone-jobs.yml @@ -0,0 +1,27 @@ +build-standalone-machines: + stage: containers + image: alpine:latest + script: + - apk add -U jsonnet + - jsonnet .gitlab-ci.d/standalone-jobs.jsonnet > standalone-jobs-gener= ated.yml + artifacts: + paths: + - standalone-jobs-generated.yml + rules: + # Automatically add the jobs if QEMU_CI_STANDALONE_MACHINE_TESTING is = set + - if: '$QEMU_CI_STANDALONE_MACHINE_TESTING' + when: on_success + # Otherwise, set to manual (the jobs are created but not run). + - when: manual + allow_failure: true + +trigger-standalone-machines: + stage: containers-layer2 + needs: + - job: build-standalone-machines + - job: amd64-fedora-container + trigger: + include: + - artifact: standalone-jobs-generated.yml + job: build-standalone-machines + strategy: depend diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 830c5b7af97..8122b0fab3a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,9 @@ # # - QEMU_CI_AVOCADO_TESTING # If set, tests using the Avocado framework will be run +# +# - QEMU_CI_STANDALONE_MACHINE_TESTING +# If set, jobs that build QEMU with a single machine will be added =20 include: - local: '/.gitlab-ci.d/qemu-project.yml' --=20 2.26.3