-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
electron-builder: Add '--no-sandbox' launch arg for Linux build targets #1029
Conversation
Fixes Dev Tools not being able to be opened, among other subtle issue. This is a frequently reported bug, and we try to apply this workaround elsewhere, it's just that the .desktop file that electron-builder generates skips the workaround we have applie e.g. in the /us/bin/pulsar launcher script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy approve!
Alright, I can confirm from some further testing this is working well for Fedora as well. More precisely: In a VirtualBox VM with a Fedora Workstation 40 x64 Live guest, I tried the After installing the The In both cases with or without this PR's changes, running So, that seems to confirm that the fix is valid in the (Notes on what wasn't tested: Apparently Suse can install |
Was able to test the AppImage. There is no difference from before/after this change. It would seem there's no provision for adding CLI flags to the underlying app when putting together an AppImage bundle, or else our version of Oh well, at least it's no different and no worse than before for the AppImage crowd, even if it means they still need to apply the flag themselves somehow as the workaround, given what we're shipping. (This is the best state I'm aware of being able to ship the AppImage in at the moment, with regards to this "failure to launch" / "No Dev Tools" issue.) Tested the AppImages of the same releases/tags as mentioned in my previous comment just above. In a VirtualBox VM with an Ubuntu 24.04 x64 Live guest, I tried the Testing notes: Need to install Without the
A web search leads to here, indicating this needs either the (There is no hint if launching the AppImage from the GUI, the app just silently/invisibly exits immediately. Although, if I recall correctly, it does briefly show in task managers such as |
No notes about the And with that, that's all the four types of launcher/binaries we offer on Linux. All either improved ( With the review-approve, I'm merging this. Thanks again! |
Fixes Dev Tools not being able to be opened, among other subtle issue.
This is a frequently reported bug, and we try to apply this workaround elsewhere, it's just that the .desktop file that electron-builder generates skips the workaround we have applie e.g. in the /us/bin/pulsar launcher script.
Identify the Bug
Appears to apply to:
--no-sandbox
#199May apply to:
--no-sandbox
option on exec to be enabled in the AppImage version #397Description of the Change
Specify the
--no-sandbox
flag in ourlinux
config forelectron-builder
.This adds a
--no-sandbox
flag to the.desktop
file installed by the.deb
installer, allowing Dev Tools to work as expected with our older (pre-13) version of Electron on newer Linux distros when launching Pulsar from the OS's graphical app launcher interface.This is the same workaround we already do in our launcher bash script
/usr/bin/pulsar
. Just applying the workaround here too, so we are consistently applying the workaround for all the ways a user has available to launch Pulsar (I hope this gets all of them), at least for our officially supported releases. (This probably doesn't affect the community-supported FlatPak.)Alternate Designs
--in-process-gpu
flag is a quirkier, potentially less-compatible alternative when compared to--no-sandbox
. I consider it a less reliable workaround than--no-sandbox
, however. I think--in-process-gpu
may be buggy for some scenarios, if I recall correctly, but it's honestly hard to comprehensively know these things for all of the Linux ecosystem at once..desktop
launcher file manually..desktop
file point to our launcher bash script/usr/bin/pulsar
instead (this should be another way that users can apply the--no-sandbox
workaround, if they can edit that path to be the "Exec=" line of the.desktop
file) but I had no luck gettingelectron-builder
to accept that as the executable path in theelectron-builder
config script.Possible Drawbacks
Having no sandboxing in place is presumably a bona-fide security downgrade.
However, Atom's security posture, which we have inherited, has relied mostly on trusting package authors -- packages are able to do essentially arbitrary code execution by way of the NodeJS and Atom APIs. "Sandboxing" against untrusted code seems to me to be patching a whole in the wall while the gate is wide open. A good idea, but also not a comprehensive solution for the threat model of Atom/Pulsar, IMO. Meanwhile, and for what it's worth, browsing arbitrary websites is not particularly easy in Atom/Pulsar, if it can indeed be done. Thankfully, most packages don't appear to do stuff over the network, once they've been installed. But there is no guarantee of this, to my knowledge.
Regardless of whether that assessment of the threat model is perfect or not, we have users who ask for the Dev Tools to be available, and this is the workaround needed to do it.
NOTE: We have applied this workaround for a while now via the bash launcher script
/usr/bin/pulsar
. This is just being consistent by applying it to the GUI launcher as well.Verification Process
Ran CI with this change on my personal fork of Pulsar. Using the binaries built with this change, on a VM running a Ubuntu 24.04 Live session, after installing the
.deb
, Pulsar was launchable from the OS's GUI app launcher and Dev Tools worked fine.(Without this change, there were errors, and the app wouldn't launch at all from the OS's GUI launcher, if I recall correctly. But running
pulsar
from the terminal worked fine, with or without this PR's change, aspulsar
in the terminal calls the bash launcher script/usr/bin/pulsar
, which has the--no-sandbox
flag applied already, from well before this PR.)Release Notes
Fixed
--no-sandbox
flag not being applied to the.desktop
launcher on Linux (Fixes Dev Tools)