From 3f56166655576b908fe13bc9db4c7a6f55c93c87 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Sat, 12 Oct 2024 13:03:39 +0200 Subject: [PATCH] Fix CI/CD runtime checks failing on Ubuntu 24.04 GitHub runners now use Ubuntu 24.04, which introduces two issues affecting Electron application runtime checks: 1. AppArmor restrictions on unprivileged user namespaces 2. Outdated Mesa drivers This commit resolves both with workarounds. Changes: - Disable AppArmor restrictions on unprivileged user namespaces: - Resolves the following error: ``` [5475:1011/121711.489417:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/.mount_privacv1kcOj/chrome-sandbox is owned by root and has mode 4755. ``` - Related key Electron issues: - electron/electron#41066 - electron/electron#42510 - electron-userland/electron-builder#8440 - Update Mesa drivers - Fixes following errors: ``` MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen ``` - Installs latest Mesa drivers from Kisak PPA --- .../workflows/checks.desktop-runtime-errors.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/checks.desktop-runtime-errors.yaml b/.github/workflows/checks.desktop-runtime-errors.yaml index 1c5a924e..d89da1e8 100644 --- a/.github/workflows/checks.desktop-runtime-errors.yaml +++ b/.github/workflows/checks.desktop-runtime-errors.yaml @@ -31,7 +31,7 @@ jobs: uses: ./.github/actions/install-imagemagick - name: Configure Ubuntu - if: contains(matrix.os, 'ubuntu') # macOS runner is missing Docker + if: contains(matrix.os, 'ubuntu') shell: bash run: |- sudo apt update @@ -61,6 +61,18 @@ jobs: # Install xdotool and xprop (from x11-utils) for window title capturing sudo apt install -y xdotool x11-utils + + # Workaround for Electron AppImage apps failing to initialize on Ubuntu 24.04 due to AppArmor restrictions + # Disables unprivileged user namespaces restriction to allow Electron apps to run + # Reference: https://github.com/electron/electron/issues/42510 + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + + # Workaround for Mesa driver issues on Ubuntu 24.04 + # Installs latest Mesa drivers from Kisak PPA + # Reference: https://askubuntu.com/q/1516040 + sudo add-apt-repository ppa:kisak/kisak-mesa + sudo apt update + sudo apt upgrade - name: Test shell: bash