refi64 / zypak

Run Electron binaries in a sandboxed Flatpak environment
BSD 3-Clause "New" or "Revised" License
116 stars 5 forks source link

Atom fails to start on v2021.01.1 #10

Open cpba opened 3 years ago

cpba commented 3 years ago

io.atom.Atom works fine on v2020.02 but fails to start on v2021.01.1:

[carles@localhost ~]$ flatpak run io.atom.Atom 
[2 preload-host-spawn-strategy] Warning: waitpid override ignores groups
[2 preload-host-spawn-strategy] Warning: waitpid override ignores groups
[10 preload-host-spawn-strategy] Bus thread is not joinable
[10 preload-host-spawn-strategy] src/base/evloop.cc:197(Wait): Assertion failed: (zypak_assert_r = (pfds[0].fd)) >= 0: No child processes
[2 preload-host-spawn-strategy] Warning: waitpid override ignores groups
[2 preload-host-spawn-strategy] Warning: waitpid override ignores groups
[2 preload-host-spawn-strategy] Warning: waitpid override ignores groups
[2 preload-host-spawn-strategy] Warning: waitpid override ignores groups
Your platform (Linux localhost.localdomain 5.10.12-200.fc33.x86_64 #1 SMP Mon Feb 1 02:40:52 UTC 2021 x86_64 GNU/Linux) is not supported.

Related issues:

https://github.com/flathub/org.electronjs.Electron2.BaseApp/issues/19 https://github.com/flathub/io.atom.Atom/issues/89

refi64 commented 3 years ago

zypak-wrapper needs to directly be run on the binary, not on any shell script wrappers. It's technically always been error-prone to do otherwise, but the failures weren't as obvious before. However, with the new spawn strategy, a D-Bus thread is injected into the main process, so if you wrap a shell script, it ends up injecting the D-Bus thread into the shell which...generally won't do what you want.

In Atom's case, it seems atom-real is indeed a wrapper shell script, so you'd have to patch it to run zypak-wrapper over Atom itself.

Leaving this open since I just realized I never documented this...

cpba commented 3 years ago

I'd never noticed atom-real was also a shell script.

Thank you, this explains everything.