@bobfrankston/msger 0.1.411 → 0.1.412
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
Binary file
|
|
@@ -202,6 +202,36 @@ if (!isWindows) {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
// Step 5: Linux — warn now if the WebKitGTK runtime is missing.
|
|
206
|
+
//
|
|
207
|
+
// npm cannot install it for you: it's an OS package, apt needs root, and the
|
|
208
|
+
// package name differs per distro — so all msger can do is check and tell you.
|
|
209
|
+
// Without this the first run dies with a bare loader error ("libwebkit2gtk-4.1
|
|
210
|
+
// .so.0: cannot open shared object file", exit 127) that reads like a broken
|
|
211
|
+
// msger rather than a missing dependency (Bob 2026-07-31, fresh Pi 4 with a
|
|
212
|
+
// Lite image; a Pi with the full desktop already has it via other packages).
|
|
213
|
+
if (!isWindows && process.platform === "linux") {
|
|
214
|
+
const soNames = ["libwebkit2gtk-4.1.so.0", "libjavascriptcoregtk-4.1.so.0"];
|
|
215
|
+
const libDirs = [
|
|
216
|
+
"/usr/lib", "/usr/local/lib", "/lib",
|
|
217
|
+
`/usr/lib/${process.arch === "arm64" ? "aarch64" : "x86_64"}-linux-gnu`,
|
|
218
|
+
];
|
|
219
|
+
const found = soNames.every(so =>
|
|
220
|
+
libDirs.some(dir => { try { return fs.existsSync(path.join(dir, so)); } catch { return false; } })
|
|
221
|
+
);
|
|
222
|
+
if (!found) {
|
|
223
|
+
console.log("");
|
|
224
|
+
console.log(" msger: WARNING — the WebKitGTK runtime was not found.");
|
|
225
|
+
console.log(" msger renders with the system webview and cannot");
|
|
226
|
+
console.log(" start without it. Install it with:");
|
|
227
|
+
console.log("");
|
|
228
|
+
console.log(" sudo apt install libwebkit2gtk-4.1-0");
|
|
229
|
+
console.log("");
|
|
230
|
+
console.log(" (runtime only; -dev is needed just to build msger)");
|
|
231
|
+
console.log("");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
205
235
|
// Friendly message about the EPERM warnings npm itself emits during a
|
|
206
236
|
// subsequent global upgrade. They come from npm trying to delete its own
|
|
207
237
|
// staging directory while the previously-running msgernative.exe inside
|
package/package.json
CHANGED
package/shower.js
CHANGED
|
@@ -72,6 +72,18 @@ export function setAppName(name) { _appName = name; }
|
|
|
72
72
|
* provision so Rust's window icon search picks it up. Per-call `icon` in
|
|
73
73
|
* `MessageBoxOptions` still takes precedence. */
|
|
74
74
|
export function setAppIcon(iconPath) { _appIcon = iconPath; }
|
|
75
|
+
/** The Linux/Pi binary dynamically links WebKitGTK, which a Lite or trimmed
|
|
76
|
+
* Raspberry Pi OS image doesn't ship — the loader then fails with a bare
|
|
77
|
+
* "libwebkit2gtk-4.1.so.0: cannot open shared object file" and exit 127, which
|
|
78
|
+
* reads like a broken msger rather than a missing dependency (Bob 2026-07-31,
|
|
79
|
+
* fresh pi4d). Turn it into the apt line that fixes it. */
|
|
80
|
+
function missingWebkitHint(stderr) {
|
|
81
|
+
if (!/libwebkit2gtk|libjavascriptcoregtk/.test(stderr))
|
|
82
|
+
return '';
|
|
83
|
+
return '\n\nmsger needs the WebKitGTK runtime, which this system does not have.\n' +
|
|
84
|
+
' sudo apt install libwebkit2gtk-4.1-0\n' +
|
|
85
|
+
'(runtime only — the -dev package is needed just for building msger.)';
|
|
86
|
+
}
|
|
75
87
|
/** Raspberry Pi: WebKitGTK's DMABUF rendering path is broken on the vc4/v3d
|
|
76
88
|
* driver — the page comes up as interlaced shredded scanlines instead of
|
|
77
89
|
* content (verified on a Pi 5 / Debian 13 / WebKitGTK 2.50.6 Wayland session,
|
|
@@ -454,7 +466,7 @@ function createMessageBoxHandle(options) {
|
|
|
454
466
|
return;
|
|
455
467
|
}
|
|
456
468
|
if (code !== 0) {
|
|
457
|
-
reject(new Error(`msger exited with code ${code}: ${stderr}`));
|
|
469
|
+
reject(new Error(`msger exited with code ${code}: ${stderr}${missingWebkitHint(stderr)}`));
|
|
458
470
|
return;
|
|
459
471
|
}
|
|
460
472
|
try {
|
|
@@ -724,6 +736,11 @@ export function showService(options) {
|
|
|
724
736
|
child.stderr?.on("data", (data) => {
|
|
725
737
|
// Forward Rust stderr to parent stderr (debug messages)
|
|
726
738
|
process.stderr.write(data);
|
|
739
|
+
// Service mode never inspects the exit code, so surface the
|
|
740
|
+
// missing-WebKitGTK case as it happens or it stays a bare loader error.
|
|
741
|
+
const hint = missingWebkitHint(data.toString());
|
|
742
|
+
if (hint)
|
|
743
|
+
process.stderr.write(hint + '\n');
|
|
727
744
|
});
|
|
728
745
|
child.stdin?.on("error", () => { });
|
|
729
746
|
// Send options as first line of stdin (Rust reads one line for options, then keeps reading)
|