From 4316f4d95de4147b115ad65adb3ce0642e3d9e45 Mon Sep 17 00:00:00 2001 From: 4gray <4gray@users.noreply.github.com> Date: Sat, 11 Jul 2026 23:38:12 +0200 Subject: [PATCH] chore(packaging): CI + package guards for the Linux frame-copy helper - build-and-make.yaml: install libegl-dev/libgl-dev/libgbm-dev on the Linux runner (the helper's EGL backend needs them now that the helper target builds on Linux), and verify the built helper exists and DOES link libmpv - the inverse of the addon's no-libmpv rule, which still holds and stays validated. - electron-after-pack.cjs: strip iptvnator_mpv_helper from packaged Linux apps. It links the build host's system libmpv, which end-user systems cannot be assumed to have; the support probe treats the missing helper as frame-copy-unavailable (dev-build-only engine until the bundled-runtime staging milestone). - frame_helper_gl.h: log the chosen EGL display tier to stderr (the adapter mirrors helper stderr), so bring-up problems on exotic setups are diagnosable. Co-Authored-By: Claude Fable 5 --- .github/workflows/build-and-make.yaml | 11 ++++++++++- .../native/helper/frame_helper_gl.h | 17 ++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-make.yaml b/.github/workflows/build-and-make.yaml index 41dd2a48e..9032775f1 100644 --- a/.github/workflows/build-and-make.yaml +++ b/.github/workflows/build-and-make.yaml @@ -68,7 +68,7 @@ jobs: if: matrix.os == 'linux' run: | sudo apt-get update - sudo apt-get install --no-install-recommends -y rpm libarchive-tools flatpak flatpak-builder appstream libx11-dev libxext-dev libmpv-dev mpv pkg-config + sudo apt-get install --no-install-recommends -y rpm libarchive-tools flatpak flatpak-builder appstream libx11-dev libxext-dev libmpv-dev mpv pkg-config libegl-dev libgl-dev libgbm-dev # Configure Flatpak # 1. Add the Flathub repository (source of runtimes) @@ -336,6 +336,15 @@ jobs: ldd dist/apps/electron-backend/native/embedded_mpv.node exit 1 fi + # The frame-copy helper is the inverse: a separate process + # that MUST link libmpv (dev-mode engine; stripped from + # packages until the bundled-runtime staging lands). + test -x dist/apps/electron-backend/native/iptvnator_mpv_helper + if ! ldd dist/apps/electron-backend/native/iptvnator_mpv_helper | grep -q 'libmpv'; then + echo "::error::Linux frame-copy helper must link libmpv" + ldd dist/apps/electron-backend/native/iptvnator_mpv_helper + exit 1 + fi ;; esac diff --git a/apps/electron-backend/native/helper/frame_helper_gl.h b/apps/electron-backend/native/helper/frame_helper_gl.h index 46cae3ebe..b7ad7895c 100644 --- a/apps/electron-backend/native/helper/frame_helper_gl.h +++ b/apps/electron-backend/native/helper/frame_helper_gl.h @@ -212,18 +212,29 @@ public: private: bool acquireDisplay() { + /* Tier log goes to stderr (the adapter mirrors it) — stdout is + * reserved for the JSON event protocol. */ display_ = eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, nullptr, nullptr); - if (initDisplay(display_)) return true; + if (initDisplay(display_)) { + std::fprintf(stderr, "egl display: surfaceless-mesa\n"); + return true; + } display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); - if (initDisplay(display_)) return true; + if (initDisplay(display_)) { + std::fprintf(stderr, "egl display: default\n"); + return true; + } display_ = EGL_NO_DISPLAY; if (openGbmDevice()) { display_ = eglGetPlatformDisplay(EGL_PLATFORM_GBM_KHR, gbmDevice_, nullptr); - if (initDisplay(display_)) return true; + if (initDisplay(display_)) { + std::fprintf(stderr, "egl display: gbm render node\n"); + return true; + } } display_ = EGL_NO_DISPLAY; return false;