-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Add Flatpak build system and support #12006
Conversation
This fixes an issue where the checkout would fail due to it checking out to a point where one of the files no longer existed in tree-sitter-cpp
You could try doing some simple automated summary of the release notes through something like OpenAI's API it shouldn't hallucinate with text summarization, but there is a small risk and it could drop some of the more important changes or focus on minor ones sometimes, but I don't know how else you'd automate it without eiter just trimming after x chars or having separate release summaries for flatpack. |
Maybe sorting based on the likes of the linked github issues it closes, then show the top 5 and link to the full release notes at the end? It’s unreasonable to shrink 30+ bullet points into 3 sentences without it being a word soup or completely skipping all of the details, ai isn’t magic. |
Seems like that is allowed.
We already have the <url> tag which does that. |
Fixes issues with background mode and ipc.
To build & install the Flatpak package locally follow the steps below: | ||
|
||
1. Install Flatpak for your distribution as outlined [here](https://flathub.org/setup). | ||
2. Run the `script/flatpak/deps` script to install the required dependencies. |
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.
Before that run script/generate-licenses
I think that’s because the mimetype list in the desktop file is very small atm. I was trying to keep the changes small since that’s a bit of a side tangent to this PR, but I’d be happy to add some more in a different PR. |
I've merged this for now. Thanks for pushing this over the line @someone13574 In terms of next steps:
|
has this been mentioned? flathub/flathub#5253 this is the draft in flathub for zed |
Yes, its been mentioned but will likely never go anywhere due to how we are doing flatpak on Zed's end (escaping the sandbox and rebundling the normal linux binary). |
oh i see, well i mean would that break its ability to be toggled with something like flatseal? |
Yes. If I understand correctly the permission that makes it all work is talk-name=org.freedesktop.Flatpak which is needed for flatpak-spawn --host |
okay great, so why does the sandbox need to be escaped? |
Because unless you're using containers for development, you'll want access to development resources (i.e. language support packages, language servers, etc.) outside the sandbox, and will want to run commands outside the sandbox |
I got the impression that these were things zed automatically downloaded and installed. I certainly would much prefer all of these things running inside the sandbox rather than outside? |
For those interested in at least launching Zed in Flatpak w/out the sandbox escape ( Lines 411 to 414 in 74e25c1
Seems like the sandbox escape is used to get an install directory. With the env set, I believe it works. Pywrite (default python lsp) seems to work and I was able to install an extension (Ruff) which also seems to work. I'm sure something will break eventually but seems usable at the moment. Also possible I'm missing something as I was surprised it worked. |
We've given the sandbox the permissions it needs for most features to function correctly inside the sandbox without modifying Zed's source. The main thing which will be broken is the terminal, as it will be spawned inside the sandbox which kind of cripples it. The implementation could probably be redone so that it doesn't do the full sandbox escape, but that would take time and effort which I don't have at the moment. If somebody was to go down that root I would recommend implementing it alongside the sandbox escape method to begin with and then removing the sandbox escape method once it has been tested for a while (I'm sure that there are other things broken which aren't immediately obvious). |
Hey @3lpsy, I've been using fully sandboxed Zed for several months now, and it very much works for all my needs! If you'd like, I can try to eventually put together some more detailed instructions (or even try to create a proper Flatpak manifest for this somehow), but for the moment, also considering that this PR probably isn't the best place for discussion (#6687 would be more appropriate, although it was closed so I'm not 100% sure), here's a not-so-short summary:
With this, I've been able to do anything I'd need from Zed, which mostly includes having access to its editor features, having language servers work and also being able to use compilation tools from the terminal, regardless of whether they're installed in the host. Personally, I'm fine with and actually would rather prefer having language servers run in the sandbox as previously pointed out by @jtolio, so I'm fairly happy with my setup as is. Let me know if it'd be interesting for me to share more details (at somewhere other than this PR's comments, haha). Footnotes
|
Thanks for the feedback ya'll! Seems like at the moment I can probably get 98% of what I need using the fully sandboxed Zed. I typically don't use the built-in terminal so that shouldn't be an issue. And so far I haven't noticed any tools I can't get from a flatpak extension or fiddling with paths and sharing specific binaries. Worst comes to worst, i can just make a custom flatpak extension but i don't see what I'd need to do that for yet as I mostly get by with just an lsp. |
ping #6687
This is the third iteration of this PR (v2 here) and uses a different approach to the first two (the process wrapper lib was a maintainability nightmare). While the first two attempted to spawn the necessary processes using flatpak-spawn and host-spawn from the app inside the sandbox, this version first spawns the cli binary which then restart's itself outside of the sandbox using flatpak-spawn. The restarted cli process than can call the bundled app binary normally, with no need for flatpak-spawn because it is already outside of the sandbox. This is done instead of keeping the cli in the sandbox because ipc becomes very difficult and broken when trying to do it across the sandbox.
Gnome software (example using nightly channel and release notes generated using the script):
TODO in this PR:
Future work:
(?) = Maybe / Request for feedback
Release Notes: