Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

No prebuilt binaries found (target=undefined ...) #486

Closed
LMolr opened this issue Jun 11, 2019 · 35 comments
Closed

No prebuilt binaries found (target=undefined ...) #486

LMolr opened this issue Jun 11, 2019 · 35 comments
Assignees
Milestone

Comments

@LMolr
Copy link

LMolr commented Jun 11, 2019

After installing the plugin on a fresh Code installation, I cannot start the language server due to missing prebuilt binaries.

Your environment

  • vscode-ruby version: 0.22.3
  • Ruby version: 2.6.0p0
  • Ruby version manager (if any): rbenv 1.1.2
  • VS Code version: 1.35.0
    (Electron 4.1.4 Chrome 69.0.3497.128 Node.js 10.11.0 V8: 6.9.427.30-electron.0)
  • Operating System: Arch Linux Linux 5.1.7-arch1-1-ARCH
  • Using language server? Yes

Expected behavior

Language server should start.

Actual behavior

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.

@wingrunr21
Copy link
Collaborator

Can you try v0.23.0? I upgraded prebuild-install there and that may have also fixed a bug with detection.

@LMolr
Copy link
Author

LMolr commented Jun 11, 2019

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

@wingrunr21
Copy link
Collaborator

wingrunr21 commented Jun 11, 2019

The undefineds are the issue as you suspected. It means prebuilt-install can’t figure out what arch it is running on.

If you open a console does the process global have arch and such defined?

I’m also pretty sure someone else on Arch had issues before too.

@LMolr
Copy link
Author

LMolr commented Jun 11, 2019

In dev console look defined

process.platform

-> "linux"

process.arch

-> "x64"

process.versions.modules

-> "69"

@LMolr
Copy link
Author

LMolr commented Jun 11, 2019

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)." :( .

@wingrunr21
Copy link
Collaborator

@BrandonShega
Copy link

FWIW, I'm also experiencing this on a Mac, fresh Code Insiders install.

@maletor
Copy link

maletor commented Jun 12, 2019

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'

@maletor
Copy link

maletor commented Jun 12, 2019

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.

@maletor
Copy link

maletor commented Jun 12, 2019

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'

@wingrunr21
Copy link
Collaborator

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.

@wingrunr21
Copy link
Collaborator

@BrandonShega what ABI is insiders running right now?

@maletor
Copy link

maletor commented Jun 12, 2019

@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?

@wingrunr21
Copy link
Collaborator

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.

@maletor
Copy link

maletor commented Jun 12, 2019

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',

@wingrunr21
Copy link
Collaborator

wingrunr21 commented Jun 12, 2019

Ahh. prebuild-install applicable lines. So it is something to do with how Electron is built in arch

@LMolr
Copy link
Author

LMolr commented Jun 13, 2019

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"

@ranjan-purbey
Copy link

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

@minkir014
Copy link

We are waiting for this to get merged. tree-sitter/tree-sitter-ruby#108

@wingrunr21
Copy link
Collaborator

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

maxbrunsfeld pushed a commit to tree-sitter/tree-sitter-ruby that referenced this issue Jul 11, 2019
* package.json: expand to include electron 4.0.4

https://github.com/lgeiger/node-abi/blob/master/index.js#L71
rubyide/vscode-ruby#486

* Prebuild electron 4, 4.0.4, and 5

* ⬆️ tree-sitter-cli
@wingrunr21
Copy link
Collaborator

v0.24.1 was just published

@ranjan-purbey
Copy link

Sorry, but still getting the error on v0.24.1

@ranjan-purbey
Copy link

ranjan-purbey commented Jul 11, 2019

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

Same error even with this workaround. I am on v0.24.1

@wingrunr21
Copy link
Collaborator

Welllllll awesome.

@ranjan-purbey did it build the binary successfully? There must be a bug in prebuild-install.

I'm prioritizing #506 immediately.

@ranjan-purbey
Copy link

Yes, the build was successful

@ilkkao
Copy link

ilkkao commented Jul 15, 2019

Same, tried the workaround but no change. Using the latest insiders version on Mac.

@wingrunr21
Copy link
Collaborator

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.

@wingrunr21 wingrunr21 pinned this issue Jul 15, 2019
@wingrunr21
Copy link
Collaborator

#506 is the tracking issue for the WASM move. I'll use this issue to represent the general problem (eg I'll close this after shipping the WASM support and people verify it is working).

@jessicabrady16
Copy link

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...)

@minkir014
Copy link

@jessicabrady16 , @wingrunr21 said that he is converting prebuilt binaries to WASM. So, we are waiting until he finishes working.

@wingrunr21
Copy link
Collaborator

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 that
  • I will be putting improved log output into place here to make it clearer when something in this process does not work.
  • I am looking into a fallback binary search location so that in the event upstream is missing a binary I can upload the correct build and keep people moving

@willian
Copy link

willian commented Jul 17, 2019

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

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

@solnic
Copy link

solnic commented Jul 19, 2019

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.

@LMolr
Copy link
Author

LMolr commented Jul 25, 2019

It's working with 0.24.2 👍

[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!

@wingrunr21 wingrunr21 added this to the v0.25.0 milestone Aug 26, 2019
@wingrunr21 wingrunr21 self-assigned this Aug 26, 2019
@wingrunr21
Copy link
Collaborator

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.

@wingrunr21 wingrunr21 unpinned this issue Sep 2, 2019
tmacwill pushed a commit to serenadeai/serenade-tree-sitter-ruby that referenced this issue Jun 23, 2021
* package.json: expand to include electron 4.0.4

https://github.com/lgeiger/node-abi/blob/master/index.js#L71
rubyide/vscode-ruby#486

* Prebuild electron 4, 4.0.4, and 5

* ⬆️ tree-sitter-cli

Former-commit-id: 248c663f9aa63037eda72cdf9c74301fab2eb7b3 [formerly 5252a6b56960ab4b8d30ad7a883de48bcf118808]
Former-commit-id: d130faef48a9f9393cc07685ac87fdce8d058e29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants