zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.82k stars 3.15k forks source link

Copilot can't be started NixOS #12610

Open ArikRahman opened 5 months ago

ArikRahman commented 5 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Copilot oneshot failed -> Copilot cannot be started -> Reinstall copilot -> error Screenshot from 2024-05-28 03-04-46 Copilot can't be started: failed to unpack /home/arik/.local/share/zed/node/node- v18.15.0-linux-x64/bin/node Reinstall Copilot

Environment

│  distro │ NixOS 24.11 (Vicuña) │ 漣kernel │ 6.6.32 │  de/wm │ Hyprland

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

ArikRahman commented 5 months ago

image Copilot can't be started: failed to unpack `/home/arik/.local/share/zed/node/node- v18.15.0-linux-x64/include/node/openssl/ archs/linux-elf/asm_avx2/providers/com mon/include/prov/der_dsa.h Reinstall Copilot

msanft commented 5 months ago

You can work around this for now by using the node toolchain from Nix, assuming you have the NodeJS 18 toolchain (pkgs.nodejs_18) in your system closure.

rm -r /home/arik/.local/share/zed/node/node- v18.15.0-linux-x64
# Take the Nix store path from $(which node), which resolves to the below in my case (nixpkgs-unstable)
NODE_PATH=/nix/store/l6sykmmiavsfl44p16643x59282n78ll-nodejs-18.20.2
ln -sf $NODE_PATH /home/arik/.local/share/zed/node/node- v18.15.0-linux-x64
ArikRahman commented 5 months ago

You can work around this for now by using the node toolchain from Nix, assuming you have the NodeJS 18 toolchain (pkgs.nodejs_18) in your system closure.

rm -r /home/arik/.local/share/zed/node/node- v18.15.0-linux-x64
# Take the Nix store path from $(which node), which resolves to the below in my case (nixpkgs-unstable)
NODE_PATH=/nix/store/l6sykmmiavsfl44p16643x59282n78ll-nodejs-18.20.2
ln -sf $NODE_PATH /home/arik/.local/share/zed/node/node- v18.15.0-linux-x64

Does not work, says oneshot canceled

msanft commented 5 months ago

Does not work, says oneshot canceled

What do Zed's logs say?

dvtfl commented 5 months ago

As an another workaround you can use nix-ld-rs.

wizardwatch commented 5 months ago

I made a user-agnostic version of this script because I have many machines that I would like to use Zed on. Thank you for suggesting the solution!


rm -r /home/$USER/.local/share/zed/node/node-v18.15.0-linux-x64
NODE_PATH=$(dirname $(dirname $(readlink $(which node))))
echo $NODE_PATH
ln -sf $NODE_PATH /home/$USER/.local/share/zed/node/node-v18.15.0-linux-x64```
6d6f6d656e746f commented 3 months ago

Same problem, is there a solution?

notpeter commented 3 weeks ago

Zed now supports finding your system node as long as it's in your path. Can anyone verify whether this is working for them as intended on NixOS?

Arcohol commented 2 weeks ago

Zed now supports finding your system node as long as it's in your path. Can anyone verify whether this is working for them as intended on NixOS?

Yes. It works on Zed 0.160.7.