From ce52ae60ade6efa81664ecc1ab71d5abf3065a18 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 24 Feb 2026 14:33:04 +1000 Subject: [PATCH] CI: replace b2c with virtme-ng See equivalent commit 7915921a3c334d0e5a16424ab6a444c238748a35 in libinput. Part-of: --- .gitlab-ci.yml | 50 ++++++++++++------------ .gitlab-ci/ci.template | 36 ++++++++++-------- .gitlab-ci/config.yml | 9 +++-- .gitlab-ci/start-in-systemd.sh | 69 ---------------------------------- 4 files changed, 52 insertions(+), 112 deletions(-) delete mode 100755 .gitlab-ci/start-in-systemd.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a4520d..ae137f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -75,37 +75,37 @@ variables: .fedora:43: extends: .fdo.distribution-image@fedora variables: - FDO_DISTRIBUTION_TAG: '2026-01-16.1' + FDO_DISTRIBUTION_TAG: '2026-02-24.1' FDO_DISTRIBUTION_VERSION: '43' .ubuntu:25.10: extends: .fdo.distribution-image@ubuntu variables: - FDO_DISTRIBUTION_TAG: '2026-01-16.1' + FDO_DISTRIBUTION_TAG: '2026-02-24.1' FDO_DISTRIBUTION_VERSION: '25.10' .debian:stable: extends: .fdo.distribution-image@debian variables: - FDO_DISTRIBUTION_TAG: '2026-01-16.1' + FDO_DISTRIBUTION_TAG: '2026-02-24.1' FDO_DISTRIBUTION_VERSION: 'stable' .debian:sid: extends: .fdo.distribution-image@debian variables: - FDO_DISTRIBUTION_TAG: '2026-01-16.1' + FDO_DISTRIBUTION_TAG: '2026-02-24.1' FDO_DISTRIBUTION_VERSION: 'sid' .arch:rolling: extends: .fdo.distribution-image@arch variables: - FDO_DISTRIBUTION_TAG: '2026-01-16.1' + FDO_DISTRIBUTION_TAG: '2026-02-24.1' FDO_DISTRIBUTION_VERSION: 'rolling' .alpine:latest: extends: .fdo.distribution-image@alpine variables: - FDO_DISTRIBUTION_TAG: '2026-01-16.1' + FDO_DISTRIBUTION_TAG: '2026-02-24.1' FDO_DISTRIBUTION_VERSION: 'latest' @@ -170,7 +170,7 @@ check-merge-request: .fedora.packages: variables: - FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer systemd-udev qemu-img qemu-system-x86-core qemu-system-aarch64-core jq python3-click python3-rich' + FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer systemd-udev qemu-img qemu-system-x86-core qemu-system-aarch64-core jq python3-click python3-rich virtme-ng file' .ubuntu.packages: variables: @@ -566,41 +566,45 @@ soname: exit 1 ; fi -# build on the host, then run a systemd service to execute the test suite -# inside the qemu VM handled by b2c -.build-in-b2c@template: +# Run meson and meson test in the container image through qemu +.build-in-vng@template: extends: - .default_artifacts - tags: - - kvm variables: MESON_BUILDDIR: build_dir - B2C_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.5/bzImage - B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE - B2C_COMMAND: .gitlab-ci/start-in-systemd.sh + VNG_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.14/bzImage script: # first build in the host container - .gitlab-ci/meson-build.sh --skip-test - # pull b2c - - curl -L -o /app/boot2container https://gitlab.freedesktop.org/gfx-ci/boot2container/-/raw/2ff65156ba67fa8a0c309a4fc16c5df1a88a3844/vm2c.py - - chmod +x /app/boot2container + - mkdir -p $MESON_BUILDDIR + - curl -LO $VNG_KERNEL + + - export -p > .vngenv # runs the test suite only - - /app/boot2container + - | + vng --run ./bzImage \ + --user root \ + --overlay-rwdir=$HOME \ + --append HOME=$HOME \ + --overlay-rwdir=$(pwd) \ + --rwdir=$MESON_BUILDDIR \ + --exec "source $PWD/.vngenv; rm $PWD/.vngenv; .gitlab-ci/meson-build.sh --skip-setup --skip-build --run-test" -b2c:meson: + +vng:meson: stage: VM extends: - .fdo.distribution-image@fedora - .fedora:43 - - .build-in-b2c@template + - .build-in-vng@template needs: - "fedora:43@container-prep" -b2c:meson:valgrind: +vng:meson:valgrind: extends: - - b2c:meson + - vng:meson variables: MESON_TEST_ARGS: '--setup=valgrind' diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 9aa126b..f3e7214 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -393,43 +393,47 @@ soname: exit 1 ; fi -# build on the host, then run a systemd service to execute the test suite -# inside the qemu VM handled by b2c -.build-in-b2c@template: +# Run meson and meson test in the container image through qemu +.build-in-vng@template: extends: - .default_artifacts - tags: - - kvm variables: MESON_BUILDDIR: build_dir - B2C_KERNEL: {{ b2c.kernel }} - B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE - B2C_COMMAND: .gitlab-ci/start-in-systemd.sh + VNG_KERNEL: {{ vng.kernel }} script: # first build in the host container - .gitlab-ci/meson-build.sh --skip-test - # pull b2c - - curl -L -o /app/boot2container https://gitlab.freedesktop.org/gfx-ci/boot2container/-/raw/{{b2c.version}}/vm2c.py - - chmod +x /app/boot2container + - mkdir -p $MESON_BUILDDIR + - curl -LO $VNG_KERNEL + + - export -p > .vngenv # runs the test suite only - - /app/boot2container + - | + vng --run ./bzImage \ + --user root \ + --overlay-rwdir=$HOME \ + --append HOME=$HOME \ + --overlay-rwdir=$(pwd) \ + --rwdir=$MESON_BUILDDIR \ + --exec "source $PWD/.vngenv; rm $PWD/.vngenv; .gitlab-ci/meson-build.sh --skip-setup --skip-build --run-test" {% for distro in distributions if distro.use_for_qemu_tests %} {% set version = "{}".format(distro.versions|last()) %} -b2c:meson: + +vng:meson: stage: VM extends: - .fdo.distribution-image@{{distro.name}} - .{{distro.name}}:{{version}} - - .build-in-b2c@template + - .build-in-vng@template needs: - "{{distro.name}}:{{version}}@container-prep" -b2c:meson:valgrind: +vng:meson:valgrind: extends: - - b2c:meson + - vng:meson variables: MESON_TEST_ARGS: '--setup=valgrind' diff --git a/.gitlab-ci/config.yml b/.gitlab-ci/config.yml index 0747db3..148124e 100644 --- a/.gitlab-ci/config.yml +++ b/.gitlab-ci/config.yml @@ -3,7 +3,7 @@ # # We're happy to rebuild all containers when one changes. -.default_tag: &default_tag '2026-01-16.1' +.default_tag: &default_tag '2026-02-24.1' distributions: - name: fedora @@ -38,6 +38,8 @@ distributions: - jq - python3-click - python3-rich + - virtme-ng + - file - name: ubuntu tag: *default_tag versions: @@ -120,6 +122,5 @@ distributions: - linux-headers - tar -b2c: - version: 2ff65156ba67fa8a0c309a4fc16c5df1a88a3844 - kernel: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.5/bzImage +vng: + kernel: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v6.14/bzImage diff --git a/.gitlab-ci/start-in-systemd.sh b/.gitlab-ci/start-in-systemd.sh deleted file mode 100755 index 5435edc..0000000 --- a/.gitlab-ci/start-in-systemd.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash - -set -x - -systemd_target=basic.target -post_command="/usr/bin/systemctl exit \$EXIT_STATUS" - -while [[ $# -gt 0 ]]; do - case $1 in - --debug-mode) - shift - systemd_target=multi-user.target - post_command="echo you can now log in as root (no password) and then turn off by running \'/usr/bin/systemctl exit \$EXIT_STATUS\'" - ;; - *) - echo "Unknow commandline argument $1" - exit 1 - ;; - esac -done - -WORKDIR=${FDO_DISTRIBUTION_WORKINGDIR:-$PWD} -B2C_WORKDIR=${FDO_B2C_WORKDIR:-/app} - -# remove root password for debugging -sed -i 's/root:!locked::/root:::/' /etc/shadow - -# create a libevdev test suite service -cat < /etc/systemd/system/libevdev-testsuite.service - -[Unit] -Description=libevdev test suite -After=$systemd_target - -[Service] -Type=simple -StandardOutput=journal+console -EnvironmentFile=$B2C_WORKDIR/.b2c_env -WorkingDirectory=$WORKDIR -ExecStart=$WORKDIR/.gitlab-ci/meson-build.sh --skip-setup --skip-build --run-test - -# exit the container on termination -ExecStopPost=$post_command - -[Install] -WantedBy=default.target -EOF - -cat /etc/systemd/system/libevdev-testsuite.service - -# enable the service -systemctl enable libevdev-testsuite.service - -# disable some services we don't need in the CI -systemctl mask network-online.target -systemctl mask network-pre.target -systemctl mask timers.target -systemctl mask dnf-makecache.timer -systemctl mask systemd-logind.service -systemctl mask rpmdb-migrate.service -systemctl mask systemd-network-generator.service -systemctl mask cryptsetup-pre.target -systemctl mask cryptsetup.target - -#change default target -systemctl set-default $systemd_target - -# start the system -exec /usr/sbin/init