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
39.31k stars 2.04k forks source link

Copilot can't be started NixOS #12610

Open ArikRahman opened 4 weeks ago

ArikRahman commented 4 weeks 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 4 weeks 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 4 weeks 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 3 weeks 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 3 weeks ago

Does not work, says oneshot canceled

What do Zed's logs say?

duvetfall commented 2 weeks ago

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

wizardwatch commented 2 weeks 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```