From 9a7515943f5a9b70567512cdc48cb2f688b3284b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 16 Sep 2020 12:55:35 +0200 Subject: [PATCH 1/8] ci: Use $FDO_CI_CONCURRENT if set To take advantage of more than 4 CPU cores available to the container. Acked-by: Olivier Fourdan --- .gitlab-ci.yml | 10 +++++----- .gitlab-ci/debian-install.sh | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d18f15995..8c4094974 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ variables: UPSTREAM_REPO: xorg/xserver DEBIAN_VERSION: testing-slim - DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh' + DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh' DEBIAN_TAG: "2020-04-21" IMAGE_LOCAL: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG" @@ -70,8 +70,8 @@ autotools: - mkdir build/ - cd build/ - ../autogen.sh --prefix=/usr CFLAGS="-fno-common" - - make -j4 distcheck - - PIGLIT_DIR=/root/piglit XTEST_DIR=/root/xts make -j4 check + - make -j${FDO_CI_CONCURRENT:-4} distcheck + - PIGLIT_DIR=/root/piglit XTEST_DIR=/root/xts make -j${FDO_CI_CONCURRENT:-4} check - cd .. - .gitlab-ci/manpages-check @@ -82,8 +82,8 @@ meson: XTEST_DIR: /root/xts script: - meson -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=true $MESON_EXTRA_OPTIONS build/ - - ninja -j4 -C build/ install - - ninja -j4 -C build/ test + - ninja -j${FDO_CI_CONCURRENT:-4} -C build/ install + - ninja -j${FDO_CI_CONCURRENT:-4} -C build/ test - .gitlab-ci/manpages-check meson-noglamor: diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh index 845b49581..93de2a6b4 100644 --- a/.gitlab-ci/debian-install.sh +++ b/.gitlab-ci/debian-install.sh @@ -34,13 +34,13 @@ git clone https://gitlab.freedesktop.org/mesa/piglit.git --depth 1 git clone https://gitlab.freedesktop.org/xorg/test/xts --depth 1 cd xts ./autogen.sh -xvfb-run make -j4 +xvfb-run make -j${FDO_CI_CONCURRENT:-4} cd .. git clone https://gitlab.freedesktop.org/xorg/test/rendercheck --depth 1 cd rendercheck meson build -ninja -j4 -C build install +ninja -j${FDO_CI_CONCURRENT:-4} -C build install cd .. rm -rf piglit/.git xts/.git piglit/tests/spec/ -- GitLab From 8fc84a00254f642947397276e14d7740f502895d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 11 Nov 2020 19:02:50 +0100 Subject: [PATCH 2/8] ci: Set GIT_STRATEGY=none for the container build job It doesn't need a full checkout of the xserver Git tree, so this can save some time and resources. Acked-by: Olivier Fourdan --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c4094974..07bf4f247 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,6 +44,8 @@ debian-testing: - .debian@container-ifnot-exists - .ci-run-policy stage: docker-image + variables: + GIT_STRATEGY: none .common-build-and-test: extends: .ci-run-policy -- GitLab From 996ba1b99a7212471d3c24359056c412de70c28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 11 Nov 2020 18:22:28 +0100 Subject: [PATCH 3/8] ci: Remove rendercheck Git tree Noticed this was missing while making changes in this area. Acked-by: Olivier Fourdan --- .gitlab-ci/debian-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh index 93de2a6b4..c204760da 100644 --- a/.gitlab-ci/debian-install.sh +++ b/.gitlab-ci/debian-install.sh @@ -43,7 +43,7 @@ meson build ninja -j${FDO_CI_CONCURRENT:-4} -C build install cd .. -rm -rf piglit/.git xts/.git piglit/tests/spec/ +rm -rf piglit/.git xts/.git piglit/tests/spec/ rendercheck/ echo '[xts]' > piglit/piglit.conf echo 'path=/root/xts' >> piglit/piglit.conf -- GitLab From 8469935fe26659219560f425c7b35d564ad77324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 12 Nov 2020 12:01:45 +0100 Subject: [PATCH 4/8] ci: Use a variable for ephemeral packages So that they only need to be listed once. Acked-by: Olivier Fourdan --- .gitlab-ci/debian-install.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh index c204760da..3454c8089 100644 --- a/.gitlab-ci/debian-install.sh +++ b/.gitlab-ci/debian-install.sh @@ -5,25 +5,31 @@ set -o xtrace echo 'deb-src https://deb.debian.org/debian testing main' > /etc/apt/sources.list.d/deb-src.list apt-get update + +# Packages which are needed by this script, but not for the xserver build +EPHEMERAL=" + git + libxkbcommon-dev + x11-utils + x11-xserver-utils + xauth + xvfb + " + apt-get install -y \ + $EPHEMERAL \ autoconf \ automake \ ca-certificates \ ccache \ - git \ libgl1 \ libglx-mesa0 \ libnvidia-egl-wayland-dev \ libtool \ - libxkbcommon-dev \ meson \ python3-mako \ python3-numpy \ - python3-six \ - x11-utils \ - x11-xserver-utils \ - xauth \ - xvfb \ + python3-six apt-get build-dep -y xorg-server @@ -52,11 +58,6 @@ find -name \*.a -o -name \*.o -o -name \*.c -o -name \*.h -o -name \*.la\* | xar strip xts/xts5/*/.libs/* apt-get purge -y \ - git \ - libxkbcommon-dev \ - x11-utils \ - x11-xserver-utils \ - xauth \ - xvfb \ + $EPHEMERAL apt-get autoremove -y --purge -- GitLab From 852d6d49109a3f0a9a73c86f5d5165d2c8dc5cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 12 Nov 2020 12:19:09 +0100 Subject: [PATCH 5/8] ci: Explicitly list packages needed to build xserver Instead of relying on apt-get build-dep. Acked-by: Olivier Fourdan --- .gitlab-ci/debian-install.sh | 72 ++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh index 3454c8089..7cc6d7459 100644 --- a/.gitlab-ci/debian-install.sh +++ b/.gitlab-ci/debian-install.sh @@ -3,9 +3,6 @@ set -e set -o xtrace -echo 'deb-src https://deb.debian.org/debian testing main' > /etc/apt/sources.list.d/deb-src.list -apt-get update - # Packages which are needed by this script, but not for the xserver build EPHEMERAL=" git @@ -20,18 +17,79 @@ apt-get install -y \ $EPHEMERAL \ autoconf \ automake \ + bison \ + build-essential \ ca-certificates \ ccache \ - libgl1 \ + flex \ + libaudit-dev \ + libbsd-dev \ + libdbus-1-dev \ + libdmx-dev \ + libdrm-dev \ + libegl1-mesa-dev \ + libepoxy-dev \ + libgbm-dev \ + libgcrypt-dev \ + libgl1-mesa-dev \ libglx-mesa0 \ libnvidia-egl-wayland-dev \ + libpciaccess-dev \ + libpixman-1-dev \ + libselinux1-dev \ + libsystemd-dev \ libtool \ + libudev-dev \ + libunwind-dev \ + libwayland-dev \ + libx11-dev \ + libx11-xcb-dev \ + libxau-dev \ + libxaw7-dev \ + libxcb-glx0-dev \ + libxcb-icccm4-dev \ + libxcb-image0-dev \ + libxcb-keysyms1-dev \ + libxcb-randr0-dev \ + libxcb-render-util0-dev \ + libxcb-render0-dev \ + libxcb-shape0-dev \ + libxcb-shm0-dev \ + libxcb-util0-dev \ + libxcb-xf86dri0-dev \ + libxcb-xkb-dev \ + libxcb-xv0-dev \ + libxcb1-dev \ + libxdmcp-dev \ + libxext-dev \ + libxfixes-dev \ + libxfont-dev \ + libxi-dev \ + libxinerama-dev \ + libxkbfile-dev \ + libxmu-dev \ + libxmuu-dev \ + libxpm-dev \ + libxrender-dev \ + libxres-dev \ + libxshmfence-dev \ + libxt-dev \ + libxtst-dev \ + libxv-dev \ + mesa-common-dev \ meson \ + nettle-dev \ + pkg-config \ python3-mako \ python3-numpy \ - python3-six - -apt-get build-dep -y xorg-server + python3-six \ + wayland-protocols \ + x11-xkb-utils \ + x11proto-dev \ + xfonts-utils \ + xkb-data \ + xtrans-dev \ + xutils-dev cd /root -- GitLab From ab73c16930d67e5c80a23727804850406309b787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 16 Sep 2020 16:32:02 +0200 Subject: [PATCH 6/8] ci: Update to the latest templates They now ensure the image is up to date in forked projects, and we no longer need to reconstruct the image name. Acked-by: Olivier Fourdan --- .gitlab-ci.yml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07bf4f247..e2c16ce9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,5 @@ -# DEBIAN_TAG is the tag of the docker image used for the build jobs. If the -# image doesn't exist yet, the docker-image stage generates it. +# FDO_DISTRIBUTION_TAG is the tag of the docker image used for the build jobs. +# If the image doesn't exist yet, the docker-image stage generates it. # # In order to generate a new image, one should generally change the tag. # While removing the image from the registry would also work, that's not @@ -7,23 +7,15 @@ # image after a significant amount of time might pull in newer versions of # gcc/clang or other packages, which might break the build with older commits # using the same tag. -# -# After merging a change resulting in generating a new image to the main -# repository, it's recommended to remove the image from the source repository's -# container registry, so that the image from the main repository's registry -# will be used there as well. You can manage your images on your fork of: -# https://gitlab.freedesktop.org/xorg/xserver/container_registry variables: UPSTREAM_REPO: xorg/xserver - DEBIAN_VERSION: testing-slim - DEBIAN_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh' - - DEBIAN_TAG: "2020-04-21" - IMAGE_LOCAL: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG" + FDO_DISTRIBUTION_VERSION: testing-slim + FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh' + FDO_DISTRIBUTION_TAG: "2020-11-16" include: - project: 'freedesktop/ci-templates' - ref: b7030c2cd0d6ccc5f6d4f8299bafa4daa9240d71 + ref: 4f06663cd1507136a0f8440925a2521098adb298 file: '/templates/debian.yml' stages: @@ -41,16 +33,17 @@ stages: debian-testing: extends: - - .debian@container-ifnot-exists + - .fdo.container-build@debian - .ci-run-policy stage: docker-image variables: GIT_STRATEGY: none .common-build-and-test: - extends: .ci-run-policy + extends: + - .fdo.distribution-image@debian + - .ci-run-policy stage: build-and-test - image: $IMAGE_LOCAL artifacts: when: on_failure paths: -- GitLab From 821399a9c920323e4934a2fd6375b86a151fa83c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Wed, 11 Nov 2020 12:45:36 +0100 Subject: [PATCH 7/8] ci: Base docker image on Debian buster instead of testing By its nature, testing incurs a risk of breaking something every time we bump the image. This requires building wayland-protocols locally, since the package in buster is too old for current Xwayland. Acked-by: Olivier Fourdan --- .gitlab-ci.yml | 4 ++-- .gitlab-ci/debian-install.sh | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e2c16ce9c..fecb63fda 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ # using the same tag. variables: UPSTREAM_REPO: xorg/xserver - FDO_DISTRIBUTION_VERSION: testing-slim + FDO_DISTRIBUTION_VERSION: buster-slim FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/debian-install.sh' FDO_DISTRIBUTION_TAG: "2020-11-16" @@ -31,7 +31,7 @@ stages: # Cancel CI run if a newer commit is pushed to the same branch interruptible: true -debian-testing: +debian-buster: extends: - .fdo.container-build@debian - .ci-run-policy diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh index 7cc6d7459..01db613e5 100644 --- a/.gitlab-ci/debian-install.sh +++ b/.gitlab-ci/debian-install.sh @@ -83,7 +83,6 @@ apt-get install -y \ python3-mako \ python3-numpy \ python3-six \ - wayland-protocols \ x11-xkb-utils \ x11proto-dev \ xfonts-utils \ @@ -93,6 +92,14 @@ apt-get install -y \ cd /root +# Xwayland requires wayland-protocols >= 1.18, but Debian buster has 1.17 only +git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.18 +cd wayland-protocols +./autogen.sh +make -j${FDO_CI_CONCURRENT:-4} install +cd .. +rm -rf wayland-protocols + git clone https://gitlab.freedesktop.org/mesa/piglit.git --depth 1 git clone https://gitlab.freedesktop.org/xorg/test/xts --depth 1 -- GitLab From 250db8708ac7ab11356b42faa493b6f1ba753013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 15 Sep 2020 11:49:20 +0200 Subject: [PATCH 8/8] xwayland: Add and hook up test script It runs XTS via piglit on (non-rootless) Xwayland on weston using the headless backend. Xwayland might use glamor if enabled in the build, but we're making sure it uses software rendering. v2: * Use weston-info to wait for weston to be ready, instead of just a fixed sleep. (Martin Peres) v3: * Build wayland 1.18 & weston 9.0 locally, since the packages in Debian buster are too old for current Xwayland. Acked-by: Olivier Fourdan --- .gitlab-ci/debian-install.sh | 33 ++++++++++++++++++++++++- hw/xwayland/meson.build | 2 +- test/Makefile.am | 6 +++++ test/meson.build | 13 ++++++++++ test/scripts/xwayland-piglit.sh | 43 +++++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+), 2 deletions(-) create mode 100755 test/scripts/xwayland-piglit.sh diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh index 01db613e5..07f09388a 100644 --- a/.gitlab-ci/debian-install.sh +++ b/.gitlab-ci/debian-install.sh @@ -6,6 +6,11 @@ set -o xtrace # Packages which are needed by this script, but not for the xserver build EPHEMERAL=" git + libcairo2-dev + libevdev-dev + libexpat-dev + libgles2-mesa-dev + libinput-dev libxkbcommon-dev x11-utils x11-xserver-utils @@ -24,15 +29,21 @@ apt-get install -y \ flex \ libaudit-dev \ libbsd-dev \ + libcairo2 \ libdbus-1-dev \ libdmx-dev \ libdrm-dev \ libegl1-mesa-dev \ libepoxy-dev \ + libevdev2 \ + libexpat1 \ + libffi-dev \ libgbm-dev \ libgcrypt-dev \ libgl1-mesa-dev \ + libgles2 \ libglx-mesa0 \ + libinput10 \ libnvidia-egl-wayland-dev \ libpciaccess-dev \ libpixman-1-dev \ @@ -41,7 +52,6 @@ apt-get install -y \ libtool \ libudev-dev \ libunwind-dev \ - libwayland-dev \ libx11-dev \ libx11-xcb-dev \ libxau-dev \ @@ -66,6 +76,7 @@ apt-get install -y \ libxfont-dev \ libxi-dev \ libxinerama-dev \ + libxkbcommon0 \ libxkbfile-dev \ libxmu-dev \ libxmuu-dev \ @@ -92,6 +103,14 @@ apt-get install -y \ cd /root +# weston 9.0 requires libwayland >= 1.18 +git clone https://gitlab.freedesktop.org/wayland/wayland.git --depth 1 --branch=1.18.0 +cd wayland +meson _build -D{documentation,dtd_validation}=false +ninja -C _build -j${FDO_CI_CONCURRENT:-4} install +cd .. +rm -rf wayland + # Xwayland requires wayland-protocols >= 1.18, but Debian buster has 1.17 only git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git --depth 1 --branch=1.18 cd wayland-protocols @@ -100,6 +119,18 @@ make -j${FDO_CI_CONCURRENT:-4} install cd .. rm -rf wayland-protocols +# Xwayland requires weston > 5.0, but Debian buster has 5.0 only +git clone https://gitlab.freedesktop.org/wayland/weston.git --depth 1 --branch=9.0 +cd weston +meson _build -Dbackend-{drm,drm-screencast-vaapi,fbdev,rdp,wayland,x11}=false \ + -Dbackend-default=headless -Dcolor-management-{colord,lcms}=false \ + -Ddemo-clients=false -Dimage-{jpeg,webp}=false \ + -D{pipewire,remoting,screenshare,test-junit-xml,wcap-decode,weston-launch,xwayland}=false \ + -Dshell-{fullscreen,ivi,kiosk}=false -Dsimple-clients= +ninja -C _build -j${FDO_CI_CONCURRENT:-4} install +cd .. +rm -rf weston + git clone https://gitlab.freedesktop.org/mesa/piglit.git --depth 1 git clone https://gitlab.freedesktop.org/xorg/test/xts --depth 1 diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build index d6772957b..74895bbec 100644 --- a/hw/xwayland/meson.build +++ b/hw/xwayland/meson.build @@ -112,7 +112,7 @@ if build_glx wayland_inc += glx_inc endif -executable( +xwayland_server = executable( 'Xwayland', srcs, include_directories: wayland_inc, diff --git a/test/Makefile.am b/test/Makefile.am index ce07c3551..1f797530c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -25,9 +25,14 @@ endif endif endif +if XWAYLAND +XWAYLAND_TESTS = scripts/xwayland-piglit.sh +endif + SCRIPT_TESTS = \ $(XVFB_TESTS) \ $(XEPHYR_GLAMOR_TESTS) \ + $(XWAYLAND_TESTS) \ $(NULL) TESTS = tests \ @@ -188,6 +193,7 @@ EXTRA_DIST = \ scripts/xvfb-piglit.sh \ scripts/xephyr-glamor-piglit.sh \ scripts/xinit-piglit-session.sh \ + scripts/xwayland-piglit.sh \ scripts/run-piglit.sh \ $(NULL) diff --git a/test/meson.build b/test/meson.build index 784100cca..d709dcf22 100644 --- a/test/meson.build +++ b/test/meson.build @@ -100,6 +100,19 @@ if get_option('xvfb') endif endif +if build_xwayland + xwayland_args = [ + xwayland_server.full_path(), + ] + + test('XTS', + find_program('scripts/xwayland-piglit.sh'), + env: piglit_env, + timeout: 1200, + suite: 'xwayland' + ) +endif + subdir('bigreq') subdir('damage') subdir('sync') diff --git a/test/scripts/xwayland-piglit.sh b/test/scripts/xwayland-piglit.sh new file mode 100755 index 000000000..f0bb9727b --- /dev/null +++ b/test/scripts/xwayland-piglit.sh @@ -0,0 +1,43 @@ +#!/bin/sh -e + +# this times out on Travis, because the tests take too long. +if test "x$TRAVIS_BUILD_DIR" != "x"; then + exit 77 +fi + +# Weston requires XDG_RUNTIME_DIR +if test "x$XDG_RUNTIME_DIR" = "x"; then + export XDG_RUNTIME_DIR=$(mktemp -d) +fi + +# Skip if weston isn't available +weston --version >/dev/null || exit 77 + +weston --no-config --backend=headless-backend.so --socket=wayland-$$ & +WESTON_PID=$! +export WAYLAND_DISPLAY=wayland-$$ + +# Wait for weston to initialize before starting Xwayland +timeout --preserve-status 60s bash -c 'while ! weston-info &>/dev/null; do sleep 1; done' + +# Start an Xwayland server +export PIGLIT_RESULTS_DIR=$XSERVER_BUILDDIR/test/piglit-results/xwayland +export SERVER_COMMAND="$XSERVER_BUILDDIR/hw/xwayland/Xwayland -noreset" + +# Make sure glamor doesn't use HW acceleration +export GBM_ALWAYS_SOFTWARE=1 + +# Tests that currently fail on llvmpipe on CI +PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@6" +PIGLIT_ARGS="$PIGLIT_ARGS -x xcleararea@7" +PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@4" +PIGLIT_ARGS="$PIGLIT_ARGS -x xclearwindow@5" +PIGLIT_ARGS="$PIGLIT_ARGS -x xcopyarea@1" + +export PIGLIT_ARGS + +$XSERVER_DIR/test/scripts/run-piglit.sh +PIGLIT_STATUS=$? + +kill $WESTON_PID +exit $PIGLIT_STATUS -- GitLab