-
-
Notifications
You must be signed in to change notification settings - Fork 22
Add flatpak support #83
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
base: main
Are you sure you want to change the base?
Conversation
|
Hey @wiktorpyk - thanks for submitting this! Everything looks good here in terms of the packaging - I had no issues creating and installing the .flatpak on my local system. Two things that I did see that we need to sort:
Once we've sorted those, I'll see if we can get this merged. Whether or not the .flatpak goes on Flathub or is just distributed on Github is something we'll need to decide to. |
|
Hey, sorry for late reply. I'll be gone for two weeks but I'll look into those asap. |
|
All seems to work now but the file access permission fix needs more work |
|
Hey @wiktorpyk, apologies for the delay with this! I've been investigating this, and still running into issues with PID not being defined. It looks like an issue with how Grist spawns sandboxes, conflicting with something flatpak's doing with PID namespaces. This might be a major issue for supporting Flatpak officially, but I'll talk with the team and update you when I've got more info. If you want to look into this more yourself, here's the error + stack trace I'm getting: |
|
@wiktorpyk - Don't worry, we found the root cause in the end. Electron builder uses zypak internally to make the Electron sandbox work with the Flatpak sandbox. Zypak monitors any new programs spawned/forked from the main process, and modifies the command in certain situations to wrap the new process in the Zypak/Flatpak sandbox. One of those situations is when the process tries to re-invoke it's own binary (as decided by checking the inode numbers on Linux). Normally, Grist works by spawning an "engine" for each document - this is a new process that handles all the Python. By default, we use Pyodide to sandbox the engine. Pyodide sandboxes Python using web assembly... which executes inside a node process. The result was this:
We've put a fix into grist-core, that allows us to pass an extra command to Zypak to bypass both the Electron sandbox (so it just spawns node) and its special process check. That solves the PID issue and lets Flatpak work! When we next update Grist Core in Grist Desktop, Flatpak should work as expected, as long as we pass a new environment variable that enables the bypass. |
Everything works except the .desktop icon. Haven't checked file associations yet