[desktop] Add a workaround for the SUID sandbox helper error on Linux (#1695)

I am able to reproduce this on Ubuntu 24 ARM.

> The SUID sandbox helper binary was found, but is not configured
correctly.

See:
- https://github.com/electron/electron/issues/17972
-
https://stackoverflow.com/questions/63780918/building-electron-linux-distro-the-suid-sandbox-helper-binary-was-found-but-i
This commit is contained in:
Manav Rathi 2024-05-12 15:42:39 +05:30 committed by GitHub
commit 170e0b3e60
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -133,6 +133,15 @@ const registerPrivilegedSchemes = () => {
]);
};
/**
* The Chromium sandbox causes the app to fail to run on various Linux
* distributions. Reproducible on Ubuntu 24.
*
* See: https://github.com/electron/electron/issues/17972
*/
const suidWorkaroundOnLinux = () =>
process.platform == "linux" && app.commandLine.appendSwitch("--no-sandbox");
/**
* Create an return the {@link BrowserWindow} that will form our app's UI.
*
@ -356,6 +365,7 @@ const main = () => {
initLogging();
logStartupBanner();
suidWorkaroundOnLinux();
// The order of the next two calls is important
setupRendererServer();
registerPrivilegedSchemes();