From c30335b9c5d7720dca6a1d2eec800a863ec8892a Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Wed, 14 Oct 2026 09:36:28 +0200 Subject: [PATCH] feat: target Electron 44.7.2 (ABI 149), make the ABI a parameter Chromium before 151 clamps a Wayland fractional scale below 1 (e.g. KDE Plasma at 75%) to 1.0 on the wp_viewporter path, so the app is laid out at one scale and gets pointer input at another; clicks land where the controls would be at 100% (wispr-flow-linux/wispr-flow-linux#130, crbug.com/438038776). Electron 44 (Chromium 152) has the fix, Electron 42 and 43 do not. - rebuild-native-modules.sh: ELECTRON_ABI is an env parameter (default 149) next to ELECTRON_VERSION (default 44.7.2) instead of a hard-coded 146. - workflow: electron_abi input, passed to the smoke test and the release notes; defaults to 44.7.2 / 149. - smoke-test.sh: default ABI 149. - lockfile: node-abi 4.31.0 -> 4.37.0, which knows Electron 44 (4.31.0 fails with "Could not detect abi for version 44.7.2"). The V8 14.8 patch still applies and builds on V8 15.2. Verified locally: rebuild-native-modules.sh x86_64 with ELECTRON_BIN = Electron 44.7.2 gives "smoke: ABI 149 ok; encrypted round-trip + reject ok". Wispr Flow 1.6.957 runs on these modules under Electron 44.7.2, and at 75% scale on KDE Plasma 6.7 the clicks land on the controls. Co-Authored-By: Claude --- .github/workflows/build-native-modules.yml | 20 +++++++++++++------- README.md | 11 ++++++----- scripts/native-modules/package-lock.json | 12 ++++++------ scripts/native-modules/smoke-test.sh | 6 +++--- scripts/rebuild-native-modules.sh | 17 ++++++++++------- 5 files changed, 38 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-native-modules.yml b/.github/workflows/build-native-modules.yml index 4fcbe4f..dbed703 100644 --- a/.github/workflows/build-native-modules.yml +++ b/.github/workflows/build-native-modules.yml @@ -7,7 +7,7 @@ name: Build Native Modules # # build -> compile on an OLD-glibc container (manylinux_2_28, glibc 2.28 # floor) so the .node load on older-but-supported distros. -# validate -> on a normal runner, load each .node under real Electron 42 and +# validate -> on a normal runner, load each .node under the real target Electron and # run the encrypted-DB smoke test (ABI + round-trip + wrong-key). # publish -> only on a manual dispatch with publish=true: attach the four # .node + checksums + provenance to the release named by release_tag @@ -20,10 +20,15 @@ on: workflow_dispatch: inputs: electron_version: - description: "Electron version to target (ABI must be 146)" + description: "Electron version to target" required: false type: string - default: "42.3.0" + default: "44.7.2" + electron_abi: + description: "NODE_MODULE_VERSION of that Electron (44 -> 149)" + required: false + type: string + default: "149" release_tag: description: "Release tag to publish assets to (e.g. native-v1)" required: false @@ -46,7 +51,8 @@ permissions: env: NODE_VERSION: "22.22.0" - ELECTRON_VERSION: ${{ inputs.electron_version || '42.3.0' }} + ELECTRON_VERSION: ${{ inputs.electron_version || '44.7.2' }} + ELECTRON_ABI: ${{ inputs.electron_abi || '149' }} jobs: #============================================================================= @@ -107,7 +113,7 @@ jobs: if-no-files-found: error #============================================================================= - # validate -- load under real Electron 42 + encrypted-DB smoke, on a full + # validate -- load under the real target Electron + encrypted-DB smoke, on a full # runner (the old-glibc container can't reliably start Electron). #============================================================================= validate: @@ -150,7 +156,7 @@ jobs: run: | chmod +x scripts/native-modules/smoke-test.sh scripts/native-modules/smoke-test.sh \ - native-out "$PWD/electron-dist/electron" 146 + native-out "$PWD/electron-dist/electron" "$ELECTRON_ABI" #============================================================================= # publish -- attach the four .node + checksums + provenance to release_tag. @@ -197,6 +203,6 @@ jobs: body: | Prebuilt Linux native sqlite addons for Wispr Flow, rebuilt from public npm + the in-repo V8 14.8 patch against Electron - ${{ env.ELECTRON_VERSION }} (ABI 146). Built on glibc 2.28 + ${{ env.ELECTRON_VERSION }} (ABI ${{ env.ELECTRON_ABI }}). Built on glibc 2.28 (manylinux_2_28). Consumed via scripts/setup/fetch-native-bin.sh, pinned in native-modules-version.txt. Verify against SHA256SUMS. diff --git a/README.md b/README.md index 61f803b..f3d7d10 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,9 @@ Clean-room Linux rebuild of the two native sqlite addons Wispr Flow ships only a - `better-sqlite3-multiple-ciphers` — the encrypted SQLCipher DB engine - `sqlite3` — plain sqlite -On Linux they must be rebuilt against Electron 42's V8 14.8 / Node 24 ABI (146). -`better-sqlite3-multiple-ciphers` does **not** compile against V8 14.8 unpatched; +On Linux they must be rebuilt against the target Electron's V8 / Node ABI +(Electron 44.7.2: V8 15.2 / Node 24, ABI 149). +`better-sqlite3-multiple-ciphers` does **not** compile against V8 14.8 or newer unpatched; the clean-room patch in [`scripts/patches/`](scripts/patches/) is applied to a pristine public-npm checkout. **No Wispr Flow code is involved** — these are rebuilt entirely from public npm + the in-repo V8 patch, mirroring the @@ -25,8 +26,8 @@ rebuilt entirely from public npm + the in-repo V8 patch, mirroring the |---|---| | `scripts/rebuild-native-modules.sh` | The single source of rebuild truth (deterministic, lockfile-pinned). | | `scripts/native-modules/` | Pinned `package.json` / `package-lock.json` + the Electron smoke test. | -| `scripts/patches/v8-14.8-better-sqlite3-multiple-ciphers.patch` | The V8 14.8 ABI patch. | -| `.github/workflows/build-native-modules.yml` | build (old glibc) → validate (real Electron 42) → publish to a `native-v*` release. | +| `scripts/patches/v8-14.8-better-sqlite3-multiple-ciphers.patch` | The V8 ABI patch (written for 14.8, still applies on 15.2). | +| `.github/workflows/build-native-modules.yml` | build (old glibc) → validate (real Electron 44) → publish to a `native-v*` release. | ## Releases @@ -39,7 +40,7 @@ SHA256SUMS (over all .node) ``` Built on **glibc 2.28** (`manylinux_2_28`) so the addons load on older-but-still- -supported distros, and validated by loading each `.node` under real Electron 42 +supported distros, and validated by loading each `.node` under real Electron 44 plus an encrypted-DB round-trip + wrong-key smoke test. ## Consumed by diff --git a/scripts/native-modules/package-lock.json b/scripts/native-modules/package-lock.json index 2a04002..4d4a0b9 100644 --- a/scripts/native-modules/package-lock.json +++ b/scripts/native-modules/package-lock.json @@ -1218,9 +1218,9 @@ } }, "node_modules/node-abi": { - "version": "4.31.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.31.0.tgz", - "integrity": "sha512-Erq5w/t3syw3s4sDsUaX4QttIdBPsGKTT1DTRsCkTonGggczhlDKm/wDX3o+HPJpQ41EjXCbcmXf0tgr5YZJXw==", + "version": "4.37.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-4.37.0.tgz", + "integrity": "sha512-O9XXMXLeRHQtvh43NCah3y9N1K69tecOmu8Y5p2ay4iXvtpbQr0VaroJF9EmRVp3vkdoj3qn4IFfX+ZYtC94fw==", "dev": true, "license": "MIT", "dependencies": { @@ -1416,9 +1416,9 @@ } }, "node_modules/prebuild-install/node_modules/node-abi": { - "version": "3.92.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.92.0.tgz", - "integrity": "sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ==", + "version": "3.98.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.98.0.tgz", + "integrity": "sha512-Llh8noNw7s15m+rmIrZnZQbe4gLyasL9loT74rC92PkmwWKeEedKvc7o6pjp8B3MhrYT/Cl846NOYZbz1wmddw==", "license": "MIT", "dependencies": { "semver": "^7.3.5" diff --git a/scripts/native-modules/smoke-test.sh b/scripts/native-modules/smoke-test.sh index d66cfd5..23567c2 100755 --- a/scripts/native-modules/smoke-test.sh +++ b/scripts/native-modules/smoke-test.sh @@ -4,7 +4,7 @@ # # Runs the addons through their ACTUAL JS wrappers under Electron (RUN_AS_NODE, # so no display is needed) and asserts: -# 1. NODE_MODULE_VERSION matches the expected Electron ABI (default 146). +# 1. NODE_MODULE_VERSION matches the expected Electron ABI (default 149). # 2. better-sqlite3-multiple-ciphers opens an encrypted SQLCipher DB, round- # trips a row, and REJECTS a wrong key (the encrypted data path -- the V8 # patch's getters all run here). @@ -19,7 +19,7 @@ # Usage: smoke-test.sh [electron_abi] # node_dir dir holding better_sqlite3.node + node_sqlite3.node # electron_bin path to an Electron binary (the target version) -# electron_abi expected NODE_MODULE_VERSION (default: 146) +# electron_abi expected NODE_MODULE_VERSION (default: 149) # # Requires: node, npm, the Electron binary. Exit 0 on pass. #=============================================================================== @@ -34,7 +34,7 @@ die() { printf 'smoke-test: %s\n' "$*" >&2; exit 1; } node_dir="$(cd "$1" 2>/dev/null && pwd)" || die "node_dir not found: $1" electron_bin="$2" -electron_abi="${3:-146}" +electron_abi="${3:-149}" [[ -x $electron_bin ]] || die "electron binary not executable: $electron_bin" [[ -f "$node_dir/better_sqlite3.node" ]] \ diff --git a/scripts/rebuild-native-modules.sh b/scripts/rebuild-native-modules.sh index d85d9c9..7984c05 100755 --- a/scripts/rebuild-native-modules.sh +++ b/scripts/rebuild-native-modules.sh @@ -1,14 +1,15 @@ #!/usr/bin/env bash #=============================================================================== # rebuild-native-modules.sh -- rebuild Wispr Flow's native sqlite addons for the -# Linux Electron 42 ABI, deterministically, from public npm + the in-repo V8 +# target Linux Electron ABI, deterministically, from public npm + the in-repo V8 # patch. NO Wispr Flow code is involved. # # The shipped app carries WINDOWS PE .node for: # better-sqlite3-multiple-ciphers (encrypted SQLCipher DB engine) # sqlite3 (plain sqlite) -# On Linux they must be rebuilt against Electron's V8 14.8 / Node 24 ABI (146). -# better-sqlite3-multiple-ciphers does NOT compile against V8 14.8 unpatched; +# On Linux they must be rebuilt against the target Electron's V8 / Node ABI +# (Electron 44: V8 15.2 / Node 24, ABI 149). +# better-sqlite3-multiple-ciphers does NOT compile against V8 14.8+ unpatched; # the clean-room patch in scripts/patches/ is applied to a pristine checkout. # # This is the single source of rebuild truth, shared by: @@ -26,7 +27,8 @@ # x86_64 | aarch64 | amd64 | arm64 | x64 # out_dir where the verified .node + checksums + lock are written # Env: -# ELECTRON_VERSION electron to target (default: 42.3.0) +# ELECTRON_VERSION electron to target (default: 44.7.2) +# ELECTRON_ABI its NODE_MODULE_VERSION (default: 149) # ELECTRON_BIN electron binary for the runtime ABI assertion (optional # but STRONGLY recommended; without it the ABI check is # skipped and a wrong-ABI build could slip through) @@ -41,10 +43,11 @@ set -uo pipefail readonly BSC_VERSION='12.5.0' # better-sqlite3-multiple-ciphers readonly SQLITE_VERSION='5.1.7' # sqlite3 readonly REBUILD_VERSION='4.0.4' # @electron/rebuild -readonly ELECTRON_ABI='146' # NODE_MODULE_VERSION (Electron 42/V8 14.8) script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -electron_version="${ELECTRON_VERSION:-42.3.0}" +electron_version="${ELECTRON_VERSION:-44.7.2}" +# NODE_MODULE_VERSION of that Electron (44 -> 149, 42 -> 146) +readonly ELECTRON_ABI="${ELECTRON_ABI:-149}" patch_file="$script_dir/patches/v8-14.8-better-sqlite3-multiple-ciphers.patch" pinned_dir="$script_dir/native-modules" @@ -142,7 +145,7 @@ verify_smoke() { if [[ -z ${ELECTRON_BIN:-} ]]; then log 'WARNING: ELECTRON_BIN unset -- skipping the ABI + encrypted-DB smoke' log ' test. A wrong-ABI build (e.g. compiled against system Node headers)' - log ' will NOT be caught here. Set ELECTRON_BIN to the staged Electron 42.' + log ' will NOT be caught here. Set ELECTRON_BIN to the staged Electron.' return 0 fi bash "$pinned_dir/smoke-test.sh" "$out_dir" "$ELECTRON_BIN" "$ELECTRON_ABI" \