fix(ci): add egl and gzip workaround #21

Merged
santiagon610 merged 1 commit from ns/fixAppImageAgain into main 2026-03-15 00:32:05 +00:00
santiagon610 commented 2026-03-15 00:15:01 +00:00 (Migrated from github.com)

Fix AppImage EGL crash, Linux build deps, and Release Please versioning

Problem

  • AppImage blank window on some Linux systems: When running the built AppImage on Fedora (e.g. ThinkPad X12 Detachable Gen 1), the app showed "Could not create default EGL display: EGL_BAD_PARAMETER" and a blank white window. WebKitGTK was using EGL for GPU rendering; when that failed, the app aborted. Setting WEBKIT_SKIA_ENABLE_CPU_RENDERING=1 in Rust main() was too late because EGL is initialized during library load.
  • Linux AppImage build failures: Local and CI AppImage builds failed with "failed to run linuxdeploy" (FUSE/strip/verbose issues) and with missing gio-2.0 / librsvg-2.0 pkg-config when building the bundle.
  • Single source of version: Only package.json was managed by Release Please; src-tauri/Cargo.toml and src-tauri/tauri.conf.json were not updated in release PRs.
  • Released AppImage: The repack step only patched script-based AppRun; when Tauri produced a binary AppRun, the EGL workaround was never applied to the released artifact.

Solution

  • EGL workaround in AppImage entrypoint: The repack script (scripts/repack-appimage-gzip.sh) now ensures WEBKIT_SKIA_ENABLE_CPU_RENDERING=1 is set before the app runs: if AppRun is a script, inject the export after the shebang; if AppRun is a binary, replace it with a wrapper script that sets the var and execs the original binary. This is applied to every AppImage during repack (CI and release).
  • Reliable AppImage build: Use APPIMAGE_EXTRACT_AND_RUN=1, NO_STRIP=1, and --verbose for the Tauri AppImage build (Justfile and build-installers.yml). Fix the Justfile repack loop so the shell variable $f is not interpreted by Just (sh -c '...').
  • Linux deps: Document and recommend glib2-devel and librsvg2-devel for Fedora (Justfile gui-deps and README) so gio-2.0 and librsvg-2.0 are available for build and for the linuxdeploy GTK plugin.
  • Release Please for Cargo and Tauri config: Add extra-files so Release Please updates src-tauri/Cargo.toml (generic updater, # x-release-please-version) and src-tauri/tauri.conf.json (json updater, $.version). Adjust scripts/sync-version.js so it preserves the trailing comment on the Cargo.toml version line when syncing from package.json.

Changes

  • scripts/repack-appimage-gzip.sh: Inject export WEBKIT_SKIA_ENABLE_CPU_RENDERING=1 into script AppRun after the shebang; when AppRun is a binary, move it to AppRun.bin and install a wrapper script that sets the var and execs AppRun.bin.
  • Justfile: New appimage recipe with APPIMAGE_EXTRACT_AND_RUN=1, NO_STRIP=true, and --verbose; repack step runs via sh -c 'for f in ...; do ./scripts/repack-appimage-gzip.sh "$f"; done'. gui-deps includes glib2-devel and librsvg2-devel.
  • .github/workflows/build-installers.yml: Linux AppImage job sets NO_STRIP: "1" and passes --verbose to the Tauri build; repack step renamed to "Repack AppImage (gzip + EGL workaround)".
  • Release Please: release-please-config.json adds extra-files for src-tauri/Cargo.toml (type generic) and src-tauri/tauri.conf.json (type json, jsonpath: "$.version"). src-tauri/Cargo.toml version line gets # x-release-please-version. scripts/sync-version.js keeps trailing content (e.g. that comment) when updating the Cargo.toml version line.
  • README: Fedora deps list includes glib2-devel and librsvg2-devel; EGL section documents running with WEBKIT_SKIA_ENABLE_CPU_RENDERING=1 for existing AppImages and that release builds use the repack for the EGL workaround.
  • Rust: In main(), set WEBKIT_SKIA_ENABLE_CPU_RENDERING=1 on Linux when unset (fallback for non-AppImage runs; AppImage relies on the repack).
## Fix AppImage EGL crash, Linux build deps, and Release Please versioning ### Problem - **AppImage blank window on some Linux systems:** When running the built AppImage on Fedora (e.g. ThinkPad X12 Detachable Gen 1), the app showed "Could not create default EGL display: EGL_BAD_PARAMETER" and a blank white window. WebKitGTK was using EGL for GPU rendering; when that failed, the app aborted. Setting `WEBKIT_SKIA_ENABLE_CPU_RENDERING=1` in Rust `main()` was too late because EGL is initialized during library load. - **Linux AppImage build failures:** Local and CI AppImage builds failed with "failed to run linuxdeploy" (FUSE/strip/verbose issues) and with missing `gio-2.0` / `librsvg-2.0` pkg-config when building the bundle. - **Single source of version:** Only `package.json` was managed by Release Please; `src-tauri/Cargo.toml` and `src-tauri/tauri.conf.json` were not updated in release PRs. - **Released AppImage:** The repack step only patched script-based AppRun; when Tauri produced a binary AppRun, the EGL workaround was never applied to the released artifact. ### Solution - **EGL workaround in AppImage entrypoint:** The repack script (`scripts/repack-appimage-gzip.sh`) now ensures `WEBKIT_SKIA_ENABLE_CPU_RENDERING=1` is set before the app runs: if AppRun is a script, inject the export after the shebang; if AppRun is a binary, replace it with a wrapper script that sets the var and execs the original binary. This is applied to every AppImage during repack (CI and release). - **Reliable AppImage build:** Use `APPIMAGE_EXTRACT_AND_RUN=1`, `NO_STRIP=1`, and `--verbose` for the Tauri AppImage build (Justfile and `build-installers.yml`). Fix the Justfile repack loop so the shell variable `$f` is not interpreted by Just (`sh -c '...'`). - **Linux deps:** Document and recommend `glib2-devel` and `librsvg2-devel` for Fedora (Justfile `gui-deps` and README) so `gio-2.0` and `librsvg-2.0` are available for build and for the linuxdeploy GTK plugin. - **Release Please for Cargo and Tauri config:** Add `extra-files` so Release Please updates `src-tauri/Cargo.toml` (generic updater, `# x-release-please-version`) and `src-tauri/tauri.conf.json` (json updater, `$.version`). Adjust `scripts/sync-version.js` so it preserves the trailing comment on the Cargo.toml version line when syncing from `package.json`. ### Changes - **`scripts/repack-appimage-gzip.sh`:** Inject `export WEBKIT_SKIA_ENABLE_CPU_RENDERING=1` into script AppRun after the shebang; when AppRun is a binary, move it to `AppRun.bin` and install a wrapper script that sets the var and execs `AppRun.bin`. - **Justfile:** New `appimage` recipe with `APPIMAGE_EXTRACT_AND_RUN=1`, `NO_STRIP=true`, and `--verbose`; repack step runs via `sh -c 'for f in ...; do ./scripts/repack-appimage-gzip.sh "$f"; done'`. `gui-deps` includes `glib2-devel` and `librsvg2-devel`. - **`.github/workflows/build-installers.yml`:** Linux AppImage job sets `NO_STRIP: "1"` and passes `--verbose` to the Tauri build; repack step renamed to "Repack AppImage (gzip + EGL workaround)". - **Release Please:** `release-please-config.json` adds `extra-files` for `src-tauri/Cargo.toml` (type `generic`) and `src-tauri/tauri.conf.json` (type `json`, `jsonpath: "$.version"`). `src-tauri/Cargo.toml` version line gets `# x-release-please-version`. `scripts/sync-version.js` keeps trailing content (e.g. that comment) when updating the Cargo.toml version line. - **README:** Fedora deps list includes `glib2-devel` and `librsvg2-devel`; EGL section documents running with `WEBKIT_SKIA_ENABLE_CPU_RENDERING=1` for existing AppImages and that release builds use the repack for the EGL workaround. - **Rust:** In `main()`, set `WEBKIT_SKIA_ENABLE_CPU_RENDERING=1` on Linux when unset (fallback for non-AppImage runs; AppImage relies on the repack).
Sign in to join this conversation.
No description provided.