Open rudolf-enum opened 1 month ago
Just found this note on the Zed website which could explain this.
That worked, thanks @ShobuPrime . Though as expected, the things listed in the comment simply don't work -- e.g. the terminal, which seems to be some sort of a Flatpak /bin/sh
shell.
$ flatpak override dev.zed.Zed --env=ZED_FLATPAK_NO_ESCAPE=true --user
$ flatpak run dev.zed.Zed
I was having the same issue and passing ZED_FLATPAK_NO_ESCAPE=1
as an env var fixed it.
doing an ldd
on zed, it turns out that it requires glibc, which I don't have on my alpine system. I think escaping the flatpak sandbox misses the entire point of flatpak, and maybe this flag can be added as default in this project.
I also had this issue in NixOS, but your method solved my problem.
That worked, thanks @ShobuPrime . Though as expected, the things listed in the comment simply don't work -- e.g. the terminal, which seems to be some sort of a Flatpak
/bin/sh
shell.$ flatpak override dev.zed.Zed --env=ZED_FLATPAK_NO_ESCAPE=true --user $ flatpak run dev.zed.Zed
Come to think of it, wouldn't it be possible to specifically re-include the org.freedesktop.Sdk
-bundled libs so that musl libc users can run it without the ESCAPE? I'm assuming that's the only thing preventing it from running.
I tried the following without success, but that could be just my lack of understanding of how LD_LIBRARY_PATH
works.
flatpak override --user dev.zed.Zed --env=LD_LIBRARY_PATH="/var/lib/flatpak/runtime/org.freedesktop.Sdk/x86_64/23.08/be4a045f86be2b8a7a592bab299c7dd41c174eba94ab804
8401b1fa01c9eb86a/files/lib/x86_64-linux-gnu/"
Oh, nevermind, the LD_LIBRARY_PATH
can be modified directly inside Zed too (it's defined together with the NO_ESCAPE var), however no matter what I set it to, the problem is still the same.
$ flatpak run --verbose dev.zed.Zed
[redacted]
F: Running 'bwrap --args 37 -- zed'
Portal call failed: Failed to start command: Failed to execute child process “/var/lib/flatpak/app/dev.zed.Zed/x86_64/stable/dc4752dc5761f9d27856381519f381170580c99c6bc020aad980cea8efe18378/files/bin/zed” (No such file or directory)
It seems that the issue is not with the bundled libs.
So I think the current best approach if you want (or need) to use Zed without the sandbox escape is to enable the ZED_FLATPAK_NO_ESCAPE=1
variable, and then add the following to user settings:
{
"terminal": {
"shell": {
"with_arguments": {
"program": "flatpak-spawn",
"args": ["--host", "--env=TERM=xterm-256color", "bash"]
}
}
}
This will enable the terminal to launch as if it was on the host.
This was adapted from VSCode. It would be better if host-spawn
was bundled together with the app though.
It would be better if
host-spawn
was bundled together with the app though.
That’s what I was doing in some earlier prototypes of flatpak support, but the Zed developers were against having a third party program as a critical part. Not sure if it not being the primary method changes anything.
but the Zed developers were against having a third party program as a critical part.
Sure, but adding a sandbox escape is a worse idea tbh.
Hello, I'm having trouble running this on Alpine Linux -- though I assume that the choice of distro shouldn't matter too much since it's flatpak.
Zed doesn't even start,
flatpak run dev.zed.Zed
immediately fails to launch the binary.The file is there, but I can't run it directly (outside of flatpak) because Alpine has
musl
instead ofglibc
and the Linux release of Zed is dynamically linked toglibc
.There is a seemingly relevant open issue in Flatpak itself where the OS is NixOS, which tends to share with Alpine these kinds of issues.
Since I don't have issues with any other Flatpak package, could it be that the issue is with
dev.zed.Zed
? Thank you.