-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Linux Snap: Prevent GDK_PIXBUF env from leaking out #109608
Conversation
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.
Overall this looks OK to me, but ideally we could have this logic inside INativeHostMainService
and everyone else depends on this service. I think it should be possible to use it everywhere.
@bpasero I actually started there, but stumbled over that |
@joaomoreno yeah that is fine, I use it in vscode/src/vs/code/electron-main/auth2.ts Line 156 in 0ae821e
|
Fix works great 🎆 Tested Ubuntu, Manjaro and CentOS. Will refactor tomorrow. |
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.
Approach seems fine, it's a shame we need to jump through these hoops though.
Tell me about it. 🤦♂️ @deepak1556 Says:
The actual problem is that Code should always use the gdk-pixbuf inside the snap. But by removing the env very early on (7d62a5b) we hit the situation in which the About dialog reads the wrong env later on and looks up a path which doesn't exist in the snap, so ends up falling back to the OS. In Ubuntu this isn't a problem, but in other Linuxes the path doesn't exist. 7d62a5b must be reverted, but we still need to address spawning other processes (eg Firefox), that's what this PR does. |
This is a nasty one:
GFK_PIXBUF
env for our snap executable (PR from Snap team: Snapcraft update. Fixes #63194 Fixes #57019 #70884):vscode/resources/linux/snap/electron-launch
Lines 24 to 29 in d4da283
This PR takes the debacle even further by reverting 7d62a5b and making sure every single
shell.openExternal
call is wrapped with a unset-set env operation,when running as a Linux Snap. This hopefully fixes both the issue with Firefox as well as the issue with the native dialogs.shell.openExternal
make sense and is it in the right place?I've triggered a build and I have VMs ready to verify whether it works, will let you know asap.
cc @flexiondotorg @sergiusens