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
49.51k stars 3.02k forks source link

Windows: LSP archives are not downloaded #9424

Closed PhiSyX closed 5 months ago

PhiSyX commented 7 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

This is because the URLs for downloading the archives have the file extension .tar.gz. However, the archives built for Windows do not have this extension, often with the file extensions .zip, .7z, ..., depending on the repo.

Example in : https://github.com/zed-industries/zed/blob/ca6e58808595e6610ba3812bb061042e5fb32051/crates/node_runtime/src/node_runtime.rs#L156-L157

will generate in my case: https://nodejs.org/dist/v18.15.0/node-v18.15.0-win-x64.tar.gz (404 Not Found)

Environment

Zed: v1.0.0 (Zed Dev) OS: Windows 10.0.22631 Memory: 32.0 GiB Architecture: x86_64

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.

[2024-03-15T22:45:53+01:00 ERROR project] failed to start language server "json-language-server": failed to launch npm subcommand info subcommand [2024-03-15T22:45:53+01:00 ERROR project] server stderr: Some("") [2024-03-15T22:45:54+01:00 ERROR util] crates\languages\src\json.rs:193: no cached binary [2024-03-15T22:46:06+01:00 ERROR project] failed to start language server "typescript-language-server": failed to launch npm subcommand info subcommand [2024-03-15T22:46:06+01:00 ERROR project] server stderr: Some("") [2024-03-15T22:46:07+01:00 ERROR util] crates\languages\src\typescript.rs:404: failed to iterate over archive

Caused by: Invalid gzip header [2024-03-15T22:46:07+01:00 ERROR project] failed to start language server "eslint": failed to launch npm subcommand install subcommand [2024-03-15T22:46:07+01:00 ERROR project] server stderr: Some("") [2024-03-15T22:46:07+01:00 ERROR util] crates\languages\src\typescript.rs:222: missing executable in directory "C:\Users\Me\AppData\Roaming\Zed\languages\typescript-language-server" ...

a-usr commented 7 months ago

This is because the URLs for downloading the archives have the file extension .tar.gz. However, the archives built for Windows do not have this extension, often with the file extensions .zip, .7z, ..., depending on the repo.

Example in :

https://github.com/zed-industries/zed/blob/ca6e58808595e6610ba3812bb061042e5fb32051/crates/node_runtime/src/node_runtime.rs#L156-L157

will generate in my case: https://nodejs.org/dist/v18.15.0/node-v18.15.0-win-x64.tar.gz (404 Not Found)

This doesnt seem to be the only issue on windows, as the json lsp fails to launch even after compiling with

let file_name = format!("node-{VERSION}-{os}-{arch}.zip"); 

or

let file_name = format!("node-{VERSION}-{os}-{arch}.7z"); 
a-usr commented 7 months ago

I feel like zed is trying to save node to a different location than from where its being executed from, because the Zed\node folder in $env:Appdata remains empty

arihant2math commented 6 months ago

Seems like rust-analyzer works on windows, so it isn't a issue with everything, but a few others don't (specifically JSON and pyright)

arihant2math commented 5 months ago

Logs:

2024-05-15T08:25:11-07:00 [INFO] starting language servers for Python: pyright
2024-05-15T08:25:11-07:00 [INFO] starting language server "pyright", path: "D:\\[elided]\\[elided]\\[elided]", id: 2
2024-05-15T08:25:11-07:00 [INFO] starting language servers for Python: pyright
2024-05-15T08:25:11-07:00 [INFO] starting language servers for Python: pyright
2024-05-15T08:25:11-07:00 [INFO] starting language servers for Python: pyright
2024-05-15T08:25:11-07:00 [INFO] fetching latest version of language server "pyright"
2024-05-15T08:25:11-07:00 [INFO] Node runtime install_if_needed
2024-05-15T08:25:12-07:00 [INFO] building git repository, `.git` path in the worktree: "yolov9\\.git"
2024-05-15T08:25:19-07:00 [ERROR] missing executable in directory "C:\\Users\\[elided]\\AppData\\Local\\Zed\\languages\\pyright\\node_modules/pyright/langserver.index.js"
2024-05-15T08:25:19-07:00 [ERROR] failed to start language server "pyright": failed to execute npm info subcommand:
stdout: "{\n  \"error\": {\n    \"code\": \"EAI_FAIL\",\n    \"summary\": \"request to https://registry.npmjs.org/pyright failed, reason: getaddrinfo EAI_FAIL registry.npmjs.org\",\n    \"detail\": \"This is a problem related to network connectivity.\\nIn most cases you are behind a proxy or have bad network settings.\\n\\nIf you are behind a proxy, please make sure that the\\n'proxy' config is set properly.  See: 'npm help config'\"\n  }\n}\n"
stderr: "npm ERR! code EAI_FAIL\nnpm ERR! syscall getaddrinfo\nnpm ERR! errno EAI_FAIL\nnpm ERR! network request to https://registry.npmjs.org/pyright failed, reason: getaddrinfo EAI_FAIL registry.npmjs.org\nnpm ERR! network This is a problem related to network connectivity.\nnpm ERR! network In most cases you are behind a proxy or have bad network settings.\nnpm ERR! network \nnpm ERR! network If you are behind a proxy, please make sure that the\nnpm ERR! network 'proxy' config is set properly.  See: 'npm help config'\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\[elided]\\AppData\\Local\\Zed\\node\\node-v18.15.0-win-x64\\cache\\_logs\\2024-05-15T15_25_12_567Z-debug-0.log\n"
2024-05-15T08:25:19-07:00 [ERROR] server stderr: Some("")
2024-05-15T08:25:19-07:00 [INFO] retrying installation of language server "pyright" in 1s

and then it retries 2 or 3 more times.