Skip to content
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

Not working on NixOS #12

Closed
ShiinaShy opened this issue Sep 8, 2024 · 4 comments
Closed

Not working on NixOS #12

ShiinaShy opened this issue Sep 8, 2024 · 4 comments
Labels
zed zed related issue

Comments

@ShiinaShy
Copy link

ShiinaShy commented Sep 8, 2024

extension (installed via store) does not work on NixOS:

2024-09-08T14:34:28.896850273+02:00 [INFO] starting language server "discord_presence", path: "/home/shiina/.DotNix", id: 8
2024-09-08T14:34:28.910265238+02:00 [INFO] starting language server. binary path: "/home/shiina/.local/share/zed/extensions/work/discord-presence/discord-presence-lsp-v0.5.0/discord-presence-lsp-x86_64-unknown-linux-gnu/discord-presence-lsp", working directory: "/home/shiina/.DotNix", args: []
2024-09-08T14:34:28.910578725+02:00 [ERROR] cannot read LSP message headers
2024-09-08T14:34:28.910622264+02:00 [ERROR] Broken pipe (os error 32)
2024-09-08T14:34:28.910659084+02:00 [ERROR] server shut down
2024-09-08T14:34:28.910684824+02:00 [ERROR] failed to start language server "discord_presence": oneshot canceled
2024-09-08T14:34:28.910709784+02:00 [ERROR] server stderr: Some("Could not start dynamically linked executable: /home/shiina/.local/share/zed/extensions/work/discord-presence/discord-presence-lsp-v0.5.0/discord-presence-lsp-x86_64-unknown-linux-gnu/discord-presence-lsp\nNixOS cannot run dynamically linked executables intended for generic\nlinux environments out of the box. For more information, see:\nhttps://nix.dev/permalink/stub-ld\n")
2024-09-08T14:34:28.910744793+02:00 [INFO] retrying installation of language server "discord_presence" in 1s
2024-09-08T14:34:29.891895999+02:00 [INFO] About to spawn test binary
2024-09-08T14:34:29.891933568+02:00 [WARN] test binary failed to launch
2024-09-08T14:34:29.891961038+02:00 [WARN] test binary check failed
2024-09-08T14:34:29.891989508+02:00 [INFO] beginning to reinstall server
2024-09-08T14:34:29.892022488+02:00 [INFO] deleting server container
2024-09-08T14:34:29.892071067+02:00 [ERROR] server container removal

NixOS cannot run dynamically linked executables intended for generic linux environments out of the box. For more information, see: https://nix.dev/permalink/stub-ld"

Edit: ldd output for discord-presence-lsp

linux-vdso.so.1 (0x00007ffee03fb000)
libz.so.1 => not found
libgcc_s.so.1 => /nix/store/mrsnnz2nmnb4mrma1bfv6inmy2k3k3k8-xgcc-13.3.0-libgcc/lib/libgcc_s.so.1 (0x00007f0ce6be0000)
libm.so.6 => /nix/store/wlffq5p6mxxgfap10sav3ij936jzqm59-glibc-2.39-52/lib/libm.so.6 (0x00007f0ce6afa000)
libc.so.6 => /nix/store/wlffq5p6mxxgfap10sav3ij936jzqm59-glibc-2.39-52/lib/libc.so.6 (0x00007f0ce6409000)
/lib64/ld-linux-x86-64.so.2 => /nix/store/wlffq5p6mxxgfap10sav3ij936jzqm59-glibc-2.39-52/lib64/ld-linux-x86-64.so.2 (0x00007f0ce6c07000)
@xhyrom
Copy link
Owner

xhyrom commented Sep 8, 2024

I don't think I can do something with this.

@xhyrom xhyrom added the zed zed related issue label Sep 8, 2024
@ShiinaShy
Copy link
Author

I also don't think I could help a lot here. I am pretty new to Nix. All i know is that Nix does not follow the Filesystem Hierarchy Standard, which means that dynamically linked executables need to be specially compiled in order to work. I am not even sure if it would work as an extension like this at all, depending on what dependencies it has? Would probably need someone that knows more about Nix to help here. Just thought I at least could bring it up.

@fdnt7
Copy link

fdnt7 commented Sep 15, 2024

This is related to NixOS/nixpkgs#309662. I came up with this, and it seems to work just fine:

environment.systemPackages = [
  (zed-editor.fhsWithPackages (pkgs: [ pkgs.zlib ]))
];

You can try this and see if it works for you.

@xhyrom xhyrom pinned this issue Sep 15, 2024
@KostaGorod
Copy link

This is related to NixOS/nixpkgs#309662. I came up with this, and it seems to work just fine:

environment.systemPackages = [
  (zed-editor.fhsWithPackages (pkgs: [ pkgs.zlib ]))
];

You can try this and see if it works for you.

solved my issues with
RPC request GetCachedEmbeddings failed: permission denied : failed to fetch cached embeddings via cloud model
and copilot fails to initialize!.

should we add this to nixpkg?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zed zed related issue
Projects
None yet
Development

No branches or pull requests

4 participants