From b449e3796b3261c548284adcb1e17117f63d2394 Mon Sep 17 00:00:00 2001 From: 4gray Date: Mon, 13 Apr 2026 08:06:48 +0200 Subject: [PATCH] build: update Snap packaging to use core22 base for compatibility --- .github/workflows/build-and-make.yaml | 2 +- docs/architecture/sqlite-db-worker.md | 16 ++++++++++------ electron-builder.json | 1 + .../packaging/verify-electron-package-layout.mjs | 6 ++++++ 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-and-make.yaml b/.github/workflows/build-and-make.yaml index 8e82b2a40..2bd13f691 100644 --- a/.github/workflows/build-and-make.yaml +++ b/.github/workflows/build-and-make.yaml @@ -28,7 +28,7 @@ jobs: arch: arm64 # Linux and Windows - os: linux - runner: ubuntu-latest + runner: ubuntu-22.04 - os: windows runner: windows-latest diff --git a/docs/architecture/sqlite-db-worker.md b/docs/architecture/sqlite-db-worker.md index e6d14446a..6a850c14a 100644 --- a/docs/architecture/sqlite-db-worker.md +++ b/docs/architecture/sqlite-db-worker.md @@ -67,9 +67,9 @@ Keep SQL-heavy logic here so the worker entry remains a thin dispatcher: 3. `DatabaseWorkerClient` lazily starts one long-lived `worker_threads` worker and correlates requests with a generated `requestId`. 4. The worker executes SQLite work and sends back either: - 1. `ready` - 2. `event` - 3. `response` + 1. `ready` + 2. `event` + 3. `response` 5. The main process resolves the IPC request and forwards worker events back to the originating renderer process. @@ -166,9 +166,9 @@ events. 5. `dbDeletePlaylist(playlistId, operationId?)` 6. `dbDeleteAllPlaylists(operationId?)` 7. `dbCancelOperation(operationId)` -3. legacy compatibility: - 1. `onDbSaveContentProgress(callback)` - 2. `removeDbSaveContentProgress()` +8. legacy compatibility: + 1. `onDbSaveContentProgress(callback)` + 2. `removeDbSaveContentProgress()` `DatabaseService.saveXtreamContent(...)` now generates an `operationId`, subscribes to `onDbOperationEvent`, filters by that `operationId`, and only @@ -333,6 +333,10 @@ The script checks: 1. `epg-parser.worker.js` 2. `database.worker.js` 3. `better-sqlite3` in one approved unpacked node_modules location +4. Snap packaging compatibility settings for `better-sqlite3`: + - `snap.base = core22` + - Snap launch args keep the X11 fallback + - Snap builds stay aligned with the Ubuntu 22.04 Linux CI environment ### Development rebuild rule diff --git a/electron-builder.json b/electron-builder.json index e5d7e9344..4335e20d7 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -97,6 +97,7 @@ }, "afterPack": "./tools/packaging/linux-after-pack.cjs", "snap": { + "base": "core22", "confinement": "strict", "grade": "stable", "summary": "IPTV application for M3U playlists, Xtream Codes API, and Stalker portals", diff --git a/tools/packaging/verify-electron-package-layout.mjs b/tools/packaging/verify-electron-package-layout.mjs index 1efb9f24f..69d024220 100644 --- a/tools/packaging/verify-electron-package-layout.mjs +++ b/tools/packaging/verify-electron-package-layout.mjs @@ -410,6 +410,12 @@ function verifyFlatpakPermissions(errors) { } function verifySnapPackagingConfig(errors) { + if (snapConfigInspection.config?.base !== 'core22') { + errors.push( + `Snap config in ${snapConfigInspection.sourcePath} must set base to core22 so packaged native modules stay compatible with the Snap runtime glibc.` + ); + } + const snapExecutableArgs = Array.isArray( snapConfigInspection.config?.executableArgs )