From fd02fc0b04655de54be369762786355526858c3e Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 4 Feb 2025 14:45:43 +0100 Subject: [PATCH] .github: workflow for building Xservers and some drivers Add a github workflow that builds the Xservers on Linux and also runs build-test of several common drivers against xorg sdk. Signed-off-by: Enrico Weigelt, metux IT consult --- .github/scripts/compile-drivers.sh | 31 ++++ .github/scripts/conf.sh | 6 + .github/scripts/install-prereq.sh | 27 ++++ .github/scripts/ubuntu/install-pkg.sh | 95 ++++++++++++ .github/scripts/ubuntu/remove-unused-pkg.sh | 161 ++++++++++++++++++++ .github/scripts/util.sh | 90 +++++++++++ .github/workflows/build-xserver.yml | 118 ++++++++++++++ 7 files changed, 528 insertions(+) create mode 100755 .github/scripts/compile-drivers.sh create mode 100644 .github/scripts/conf.sh create mode 100755 .github/scripts/install-prereq.sh create mode 100755 .github/scripts/ubuntu/install-pkg.sh create mode 100755 .github/scripts/ubuntu/remove-unused-pkg.sh create mode 100644 .github/scripts/util.sh create mode 100644 .github/workflows/build-xserver.yml diff --git a/.github/scripts/compile-drivers.sh b/.github/scripts/compile-drivers.sh new file mode 100755 index 000000000..7145042d3 --- /dev/null +++ b/.github/scripts/compile-drivers.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +. .github/scripts/util.sh + +export PKG_CONFIG_PATH="/usr/local/lib/x86_64-linux-gnu/pkgconfig/:$PKG_CONFIG_PATH" +export ACLOCAL_PATH="/usr/share/aclocal:/usr/local/share/aclocal" +export X11L_DRV_GIT=https://github.com/X11Libre/ + +mkdir -p $DRV_BUILD_DIR +cd $DRV_BUILD_DIR + +build_drv_ac xf86-input-elographics $X11L_DRV_GIT/xf86-input-elographics master +build_drv_ac xf86-input-evdev $X11L_DRV_GIT/xf86-input-evdev master +build_drv_ac xf86-input-libinput $X11L_DRV_GIT/xf86-input-libinput master +build_drv_ac xf86-input-synaptics $X11L_DRV_GIT/xf86-input-synaptics master + +build_drv_ac xf86-video-amdgpu $X11L_DRV_GIT/xf86-video-amdgpu xf86-video-amdgpu-23.0.0 +build_drv_ac xf86-video-ati $X11L_DRV_GIT/xf86-video-ati xf86-video-ati-22.0.0 +build_drv_ac xf86-video-intel $X11L_DRV_GIT/xf86-video-intel.git master +build_drv_ac xf86-video-nouveau $X11L_DRV_GIT/xf86-video-nouveau xf86-video-nouveau-1.0.18 +build_drv_ac xf86-video-omap $X11L_DRV_GIT/xf86-video-omap master +build_drv_ac xf86-video-qxl $X11L_DRV_GIT/xf86-video-qxl master +build_drv_ac xf86-video-r128 $X11L_DRV_GIT/xf86-video-r128 master +build_drv_ac xf86-video-vesa $X11L_DRV_GIT/xf86-video-vesa xf86-video-vesa-2.6.0 +build_drv_ac xf86-video-vmware $X11L_DRV_GIT/xf86-video-vmware xf86-video-vmware-13.4.0 + +# doesn't compile on Linux +# build_drv_ac xf86-input-mouse $X11L_DRV_GIT/xf86-input-mouse master +# build_drv_ac xf86-input-keyboard $X11L_DRV_GIT/xf86-input-keyboard master diff --git a/.github/scripts/conf.sh b/.github/scripts/conf.sh new file mode 100644 index 000000000..fd6fb5320 --- /dev/null +++ b/.github/scripts/conf.sh @@ -0,0 +1,6 @@ +export X11_PREFIX=/home/runner/x11 +export PATH="$X11_PREFIX/bin:$PATH" +export PKG_CONFIG_PATH="$X11_PREFIX/lib/x86_64-linux-gnu/pkgconfig:$X11_PREFIX/lib/pkgconfig:$X11_PREFIX/share/pkgconfig:$PKG_CONFIG_PATH" +export FDO_CI_CONCURRENT=`nproc` +export X11_BUILD_DIR=/home/runner/build-deps +export DRV_BUILD_DIR=/home/runner/build-drivers diff --git a/.github/scripts/install-prereq.sh b/.github/scripts/install-prereq.sh new file mode 100755 index 000000000..e201126a1 --- /dev/null +++ b/.github/scripts/install-prereq.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +. .github/scripts/util.sh + +mkdir -p $X11_BUILD_DIR +cd $X11_BUILD_DIR + +build_meson rendercheck https://gitlab.freedesktop.org/xorg/test/rendercheck rendercheck-1.6 +build_meson drm https://gitlab.freedesktop.org/mesa/drm libdrm-2.4.121 \ + -Domap=enabled +build_meson libxcvt https://gitlab.freedesktop.org/xorg/lib/libxcvt libxcvt-0.1.0 +build_ac xorgproto https://gitlab.freedesktop.org/xorg/proto/xorgproto xorgproto-2024.1 +build_meson wayland https://gitlab.freedesktop.org/wayland/wayland 1.21.0 \ + -Dtests=false -Ddocumentation=false -Ddtd_validation=false +build_meson wayland-protocols https://gitlab.freedesktop.org/wayland/wayland-protocols 1.38 +build_meson libdecor https://gitlab.freedesktop.org/libdecor/libdecor 0.1.1 \ + -D{demo,install_demo}=false +build_meson libei https://gitlab.freedesktop.org/libinput/libei 1.0.0 \ + -Dtests=disabled -Ddocumentation=[] -Dliboeffis=enabled +build_ac_xts xts https://gitlab.freedesktop.org/xorg/test/xts master # dbbfa96c036e596346147081cbceda136e7c86c1 + +clone_source piglit https://gitlab.freedesktop.org/mesa/piglit main # 265896c86f90cb72e8f218ba6a3617fca8b9a1e3 + +echo '[xts]' > piglit/piglit.conf +echo "path=$X11_BUILD_DIR/xts" >> piglit/piglit.conf diff --git a/.github/scripts/ubuntu/install-pkg.sh b/.github/scripts/ubuntu/install-pkg.sh new file mode 100755 index 000000000..2529f1c52 --- /dev/null +++ b/.github/scripts/ubuntu/install-pkg.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +set -e + +# Packages which are needed by this script, but not for the xserver build +EPHEMERAL=" + libexpat-dev + libgles2-mesa-dev + libxkbcommon-dev + x11-utils + x11-xserver-utils + xauth + xvfb +" + +apt-get update + +apt-get install -y \ + $EPHEMERAL \ + autoconf \ + automake \ + build-essential \ + ca-certificates \ + libaudit-dev \ + libbsd-dev \ + libcairo2-dev \ + libdbus-1-dev \ + libdrm-dev \ + libegl1-mesa-dev \ + libepoxy-dev \ + libevdev2 \ + libexpat1 \ + libffi-dev \ + libgbm-dev \ + libgcrypt-dev \ + libgl1-mesa-dev \ + libgles2 \ + libglx-mesa0 \ + libinput10 \ + libinput-dev \ + libnvidia-egl-wayland-dev \ + libpciaccess-dev \ + libpixman-1-dev \ + libselinux1-dev \ + libspice-protocol-dev \ + libsystemd-dev \ + libudev-dev \ + libunwind-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 \ + libxkbcommon0 \ + 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 \ + libpango1.0-dev \ + pkg-config \ + x11-xkb-utils \ + xfonts-utils \ + xkb-data \ + xtrans-dev \ + xutils-dev \ + libxaw7-dev \ + python3-mako diff --git a/.github/scripts/ubuntu/remove-unused-pkg.sh b/.github/scripts/ubuntu/remove-unused-pkg.sh new file mode 100755 index 000000000..472f11680 --- /dev/null +++ b/.github/scripts/ubuntu/remove-unused-pkg.sh @@ -0,0 +1,161 @@ +#!/bin/bash + +apt-mark auto \ + 7zip \ + 7zip-rar \ + acl \ + ant \ + apache2 \ + apache2-bin \ + aria2 \ + azure-cli \ + brotli \ + buildah \ + chrony \ + cifs-utils \ + clang-format-16 \ + clang-format-17 \ + clang-format-18 \ + clang-tidy-16 \ + clang-tidy-17 \ + clang-tidy-18 \ + cloud-init \ + dbus \ + dotnet-sdk-8.0 \ + eatmydata \ + efibootmgr \ + firefox \ + fonts-noto-color-emoji \ + gfortran \ + gfortran-12 \ + gfortran-13 \ + gfortran-14 \ + google-chrome-stable \ + google-cloud-cli \ + haveged \ + keyutils \ + kubectl \ + libeatmydata1 \ + libgmp-dev \ + liblz4-dev \ + libmysqlclient-dev \ + libpq-dev \ + libsqlite3-dev \ + libssl-dev \ + libtss2-esys-3.0.2-0t64 \ + libtss2-mu-4.0.1-0t64 \ + libtss2-rc0t64 \ + libwrap0 \ + libyaml-dev \ + lsscsi \ + lz4 \ + mediainfo \ + mercurial \ + microsoft-edge-stable \ + mysql-client \ + mysql-server \ + ncurses-base \ + ncurses-bin \ + ncurses-term \ + nginx \ + nvme-cli \ + packages-microsoft-prod \ + php-pear \ + php8.3 \ + php8.3-amqp \ + php8.3-apcu \ + php8.3-bcmath \ + php8.3-bz2 \ + php8.3-cgi \ + php8.3-cli \ + php8.3-common \ + php8.3-curl \ + php8.3-dba \ + php8.3-dev \ + php8.3-enchant \ + php8.3-fpm \ + php8.3-gd \ + php8.3-gmp \ + php8.3-igbinary \ + php8.3-imagick \ + php8.3-imap \ + php8.3-interbase \ + php8.3-intl \ + php8.3-ldap \ + php8.3-mbstring \ + php8.3-memcache \ + php8.3-memcached \ + php8.3-mongodb \ + php8.3-mysql \ + php8.3-odbc \ + php8.3-opcache \ + php8.3-pcov \ + php8.3-pgsql \ + php8.3-phpdbg \ + php8.3-pspell \ + php8.3-readline \ + php8.3-redis \ + php8.3-snmp \ + php8.3-soap \ + php8.3-sqlite3 \ + php8.3-sybase \ + php8.3-tidy \ + php8.3-xdebug \ + php8.3-xml \ + php8.3-xsl \ + php8.3-yaml \ + php8.3-zip \ + php8.3-zmq \ + pigz \ + podman \ + pollinate \ + postgresql-16 \ + powershell \ + python-babel-localedata \ + python3-babel \ + python3-dev \ + python3-jinja2 \ + python3-json-pointer \ + python3-jsonpatch \ + python3-jsonschema \ + python3-markupsafe \ + python3-parted \ + python3-pyrsistent \ + python3-serial \ + python3-six \ + python3-tz \ + python3-venv \ + rpm \ + ruby-full \ + session-manager-plugin \ + shellcheck \ + shim-signed \ + skopeo \ + snap \ + snmp \ + software-properties-common \ + sphinxsearch \ + sqlite3 \ + swig \ + sysstat \ + systemd-coredump \ + temurin-11-jdk \ + temurin-17-jdk \ + temurin-21-jdk \ + temurin-8-jdk \ + texinfo \ + tk \ + tree \ + tzdata \ + ubuntu-server \ + ubuntu-standard \ + unzip \ + upx-ucl \ + util-linux \ + walinuxagent \ + xvfb \ + xz-utils \ + zip \ + zsync + +apt-get autoremove -y diff --git a/.github/scripts/util.sh b/.github/scripts/util.sh new file mode 100644 index 000000000..43bccfd24 --- /dev/null +++ b/.github/scripts/util.sh @@ -0,0 +1,90 @@ + +. .github/scripts/conf.sh + +clone_source() { + local pkgname="$1" + local url="$2" + local ref="$3" + + if [ ! -f $pkgname/.git/config ]; then + echo "need to clone $pkgname" + git clone $url $pkgname --branch=$ref --depth 1 + else + echo "already cloned $pkgname" + fi +} + +build_meson() { + local pkgname="$1" + local url="$2" + local ref="$3" + shift + shift + shift + if [ -f $X11_PREFIX/$pkgname.DONE ]; then + echo "package $pkgname already built" + else + clone_source "$pkgname" "$url" "$ref" + ( + cd $pkgname + meson "$@" build -Dprefix=$X11_PREFIX + ninja -j${FDO_CI_CONCURRENT:-4} -C build install + ) + touch $X11_PREFIX/$pkgname.DONE + fi +} + +build_ac() { + local pkgname="$1" + local url="$2" + local ref="$3" + shift + shift + shift + if [ -f $X11_PREFIX/$pkgname.DONE ]; then + echo "package $pkgname already built" + else + clone_source "$pkgname" "$url" "$ref" + ( + cd $pkgname + ./autogen.sh --prefix=$X11_PREFIX + make -j${FDO_CI_CONCURRENT:-4} install + ) + touch $X11_PREFIX/$pkgname.DONE + fi +} + +build_drv_ac() { + local pkgname="$1" + local url="$2" + local ref="$3" + shift + shift + shift + clone_source "$pkgname" "$url" "$ref" + ( + cd $pkgname + ./autogen.sh # --prefix=$X11_PREFIX + make -j${FDO_CI_CONCURRENT:-4} # install + ) +} + +build_ac_xts() { + local pkgname="$1" + local url="$2" + local ref="$3" + shift + shift + shift + if [ -f $X11_PREFIX/$pkgname.DONE ]; then + echo "package $pkgname already built" + else + clone_source "$pkgname" "$url" "$ref" + ( + cd $pkgname + CFLAGS=-fcommon ./autogen.sh --prefix=$X11_PREFIX + xvfb-run make -j${FDO_CI_CONCURRENT:-4} install + ) + touch $X11_PREFIX/$pkgname.DONE + fi +} diff --git a/.github/workflows/build-xserver.yml b/.github/workflows/build-xserver.yml new file mode 100644 index 000000000..af9c0a2c1 --- /dev/null +++ b/.github/workflows/build-xserver.yml @@ -0,0 +1,118 @@ +name: Build X servers + +env: + MESON_BUILDDIR: "build" + X11_PREFIX: /home/runner/x11 + X11_BUILD_DIR: /home/runner/build-deps + +on: + push: + +jobs: + xserver-build-ubuntu: + env: + MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=true -Dwerror=false -Dxcsecurity=true -Dxorg=true -Dxvfb=true -Dxnest=true + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: prepare build environment + run: | + export MACHINE=`gcc -dumpmachine` + echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV" + sudo chown root /bin/tar && sudo chmod u+s /bin/tar + + - name: apt cache + uses: actions/cache@v4 + with: + path: /var/cache/apt + key: apt-cache-${{ hashFiles('.github/scripts/ubuntu/install-pkg.sh') }} + restore-keys: apt-cache- + + - name: pkg install + run: sudo .github/scripts/ubuntu/install-pkg.sh + + - name: X11 prereq cache + uses: actions/cache@v4 + with: + path: | + ${{ env.X11_PREFIX }} + ${{ env.X11_BUILD_DIR }}/xts + ${{ env.X11_BUILD_DIR }}/piglit + key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }} + restore-keys: ${{ runner.os }}-x11-deps- + + - name: generic prereq + run: sudo .github/scripts/install-prereq.sh + + - name: build + run: .gitlab-ci/meson-build.sh + + - name: tests (may fail) + continue-on-error: true + run: meson test -C "${{ env.MESON_BUILDDIR }}" --print-errorlogs || true + env: + XTEST_DIR: ${{ env.X11_BUILD_DIR }}/xts + PIGLIT_DIR: ${{ env.X11_BUILD_DIR }}/piglit + + - name: archive build logs + uses: actions/upload-artifact@v4 + with: + name: build-logs + path: | + build/meson-logs/* + - name: ddx build check + run: .gitlab-ci/check-ddx-build.sh + - name: manpage check + run: .gitlab-ci/manpages-check + + drivers-build-ubuntu: + env: + MESON_ARGS: -Dc_args="-fno-common" -Dprefix=/usr -Dxephyr=false -Dwerror=false -Dxcsecurity=false -Dxwayland=false -Dxorg=true -Dxvfb=false -Dxnest=false + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: prepare build environment + run: | + export MACHINE=`gcc -dumpmachine` + echo "PKG_CONFIG_PATH=$X11_PREFIX/share/pkgconfig:$X11_PREFIX/lib/$MACHINE/pkgconfig:$X11_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> "$GITHUB_ENV" + sudo chown root /bin/tar && sudo chmod u+s /bin/tar + + - name: apt cache + uses: actions/cache@v4 + with: + path: /var/cache/apt + key: apt-cache-${{ hashFiles('.github/scripts/ubuntu/install-pkg.sh') }} + restore-keys: apt-cache- + + - name: pkg install + run: sudo .github/scripts/ubuntu/install-pkg.sh + + - name: X11 prereq cache + uses: actions/cache@v4 + with: + path: | + ${{ env.X11_PREFIX }} + ${{ env.X11_BUILD_DIR }}/xts + ${{ env.X11_BUILD_DIR }}/piglit + key: ${{ runner.os }}-x11-deps-${{ hashFiles('.github/scripts/install-prereq.sh') }} + restore-keys: ${{ runner.os }}-x11-deps- + + - name: generic prereq + run: sudo .github/scripts/install-prereq.sh + + - name: build xserver sdk + run: | + echo -n > .meson_environment + echo "export MESON_BUILDDIR=$MESON_BUILDDIR" >> .meson_environment + echo "export PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> .meson_environment + .gitlab-ci/meson-build.sh --skip-test + sudo meson install --no-rebuild -C "$MESON_BUILDDIR" + sudo mkdir -p /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules + sudo chown -R runner /usr/local/lib/$MACHINE/xorg/modules # /home/runner/x11/lib/xorg/modules + + - name: compile drivers + run: .github/scripts/compile-drivers.sh