After installing the plugin on a fresh Code installation, I cannot start the language server due to missing prebuilt binaries.
vscode-ruby version: 0.22.3Language server should start.
In Output Window, the Ruby Language Server context shows the following error message:
[Info - 12:23:12 PM] Initializing Ruby language server...
[Info - 12:23:12 PM] Rebuilding tree-sitter for local Electron version
[Error - 12:23:13 PM] Server initialization failed.
Message: Request initialize failed with message: No prebuilt binaries found (target=undefined runtime=undefined arch=undefined libc=undefined platform=undefined)
Code: -32603
NOTE: I don't know if the undefined values are an hint about the origin of the problem.
Can you try v0.23.0? I upgraded prebuild-install there and that may have also fixed a bug with detection.
Hello, I also tried 0.23.0 and all the listed versions from 0.20.0 on, but I always get the same error.
Is there something I can do to get more details?
Thank you
The undefineds are the issue as you suspected. It means prebuilt-install can鈥檛 figure out what arch it is running on.
If you open a console does the process global have arch and such defined?
I鈥檓 also pretty sure someone else on Arch had issues before too.
In dev console look defined
process.platform
-> "linux"
process.arch
-> "x64"
process.versions.modules
-> "69"
I tried to debug the extension but unfortunately the Launch Extension run configuration times out with a popup over the electron window saying "Cannot debug extension (timeout)." :( .
All of the code related to this is here: https://github.com/rubyide/vscode-ruby/blob/master/server/src/util/rebuilder.ts#L22-L42
FWIW, I'm also experiencing this on a Mac, fresh Code Insiders install.
I have the same issue:
[Info - 10:05:21 AM] Initializing Ruby language server...
[Info - 10:05:21 AM] Rebuilding tree-sitter for local Electron version
[Error - 10:05:22 AM] Server initialization failed.
Message: Request initialize failed with message: No prebuilt binaries found (target=undefined runtime=undefined arch=undefined libc=undefined platform=undefined)
Code: -32603
> process.platform
'linux'
> process.arch
'x64'
> process.versions.modules
'67'
> process.version
'v11.15.0'
Right, so I am ABI 67 and @LMolr is 69. That's the issue since tree-sitter-ruby is living in the dark ages on 64.
I downgraded to nodejs-lts-dubnium on Arch. IDK what @LMolr is doing. That ABI is non-existent.
Either way, Message: Request initialize failed with message: No prebuilt binaries found is still found with
> process.versions.modules
'64'
ABI 64 is Electron 4 and 69 is Electron 4.0.4. 64 isn't exactly ancient :-P
I'll push a PR to tree-sitter-ruby and bump the version here. I am looking at moving over to the WASM version of tree-sitter to avoid this in the future. It wasn't available when I initially did this implementation.
@BrandonShega what ABI is insiders running right now?
@wingrunr21 the issue might go beyond the ABI version, given I downgraded to Node LTS (ABI 64) and still have these issues, don't you think?
How would arch=undefined be output when process.arch is x64?
The ABI is based on electron (since the server runs within the VSCode instance) not the system installed node versions.
I have no idea why all that stuff is coming back undefined. I think that's probably a prebuild-install bug of some kind.
Ah, makes sense. This is the Electron REPL.
> process.arch
'x64'
> process.versions
{ http_parser: '2.9.0',
node: '10.11.0',
v8: '6.9.427.30-electron.0',
uv: '1.23.0',
zlib: '1.2.11',
ares: '1.15.0',
modules: '69',
Ahh. prebuild-install applicable lines. So it is something to do with how Electron is built in arch
Sorry, but I am not familiar with electron.
If I understand correctly, even if we have tree-sitter-ruby available for ABI 69, something weird is happening on prebuild-install (undefined values) which is not fetching the prebuild.
The strangest part is that on my Code installation, the dev console shows the values:
> process.arch
"x64"
> process.versions
ares: "1.15.0"
chrome: "69.0.3497.128"
cldr: "35.1"
electron: "4.1.4"
http_parser: "2.9.0"
icu: "64.1"
modules: "69"
napi: "3"
nghttp2: "1.36.0"
node: "10.11.0"
openssl: "1.1.0"
tz: "2019a"
unicode: "12.0"
uv: "1.23.0"
v8: "6.9.427.30-electron.0"
zlib: "1.2.11"
Version: 1.36.1
Commit: 2213894ea0415ee8c85c5eea0d0ff81ecc191529
Date: 2019-07-08T22:55:08.091Z
Electron: 4.2.5
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.0.0-20-generic snap
vscode-ruby: 0.24.0 - Jun 27 2019
I am on the latest stable release which got shipped a couple of days ago. I am still facing this issue. Are there any updates on this? Thank you
We are waiting for this to get merged. https://github.com/tree-sitter/tree-sitter-ruby/pull/108
For a workaround (note you'll need build tooling installed on your machine):
cd ~/.vscode/extensions/rebornix.ruby-0.24.0/server/node_modules/tree-sitter-ruby
npm install # this should trigger prebuild-install to build a binary but it will be for node.js not electron
npx prebuild -t 4.0.4 -r electron --strip
This should get a binary built on your machine
v0.24.1 was just published
Sorry, but still getting the error on v0.24.1
For a workaround (note you'll need build tooling installed on your machine):
cd ~/.vscode/extensions/rebornix.ruby-0.24.0/server/node_modules/tree-sitter-ruby npm install # this should trigger prebuild-install to build a binary but it will be for node.js not electron npx prebuild -t 4.0.4 -r electron --stripThis should get a binary built on your machine
Same error even with this workaround. I am on v0.24.1
Welllllll awesome.
@ranjan-purbey did it build the binary successfully? There must be a bug in prebuild-install.
I'm prioritizing #506 immediately.
Yes, the build was successful
Same, tried the workaround but no change. Using the latest insiders version on Mac.
I started work on moving over to the WASM version this weekend. Almost done but need to test a few things as it isn't a direct swap-out and VSCode doesn't officially support WASM in extensions.
I am having the EXACT. SAME. PROBLEM. I have spent 2 hours looking at building the binary workaround and still doesn't work. Looks like they just released a version that no one can use now (I even went and changed back to a python 2 extension). I guess we will just have to not have formatting/etc. until they release a fix... please let me know if any other work around has worked (to continue the path of using the npx prebuild -t 4.0.4 -r electron --strip build I would not have to mess with gyp and yea--time to code ugly...)
@jessicabrady16 , @wingrunr21 said that he is converting prebuilt binaries to WASM. So, we are waiting until he finishes working.
Hi all,
I pushed a few PRs to tree-sitter tonight. The WASM build is not yet at feature parity with the node build so working to get it there. I also need to make sure the WASM implementation provides a good level of performance. I continue to think this is the right long-term solve though.
I also dug into this specific problem more and identified a couple of things I can do to fix:
node-tree-sitter used to build against all ABIs but was switched at some point. It doesn't have a binary for ABI 69 which is needed for the latest VSCode. PR is up to correct thatFor a workaround (note you'll need build tooling installed on your machine):
cd ~/.vscode/extensions/rebornix.ruby-0.24.0/server/node_modules/tree-sitter-ruby npm install # this should trigger prebuild-install to build a binary but it will be for node.js not electron npx prebuild -t 4.0.4 -r electron --stripThis should get a binary built on your machine
Same error even with this workaround. I am on v0.24.1
This only works if you use Python 2.x, fails with Python 3.x
The workaround does not work for me either. I tried 0.24.0 and 0.24.1. Using python 2.7.10 and node 10.15.3.
It's working with 0.24.2 :+1:
[Info - 9:55:27 AM] Initializing Ruby language server...
[Info - 9:55:27 AM] Rebuilding tree-sitter for local Electron version
[Info - 9:55:27 AM] Rebuild succeeded!
The move to the WASM distribution of tree-sitter was shipped in v0.25.0. There was an issue with publishing that version to the Marketplace so v0.25.1 is the first version with the WASM switch.
Most helpful comment
It's working with 0.24.2 :+1: