grafana/vscode-jsonnet

Auto-Update does not work for darwin-arm64 (M1/M2 macs)

ofsaleem opened this issue · 4 comments

vscode auto updated the binary to 0.6.4, but the server no longer runs. and since it cant run, even with --version, it cant check the versions, so it asks to auto-update again, and the process repeats

vscode output:

Not using custom binary path. Using default path
Binary path is /Users/omar/Library/Application Support/Code/User/globalStorage/julienduchesne.vscode-jsonnet/bin/jsonnet-language-server (exists: true)
Auto-update is enabled. Fetching latest release from https://api.github.com/repos/grafana/jsonnet-language-server/releases/latest
Latest release is 0.6.4
Failed to get current version from /Users/omar/Library/Application Support/Code/User/globalStorage/julienduchesne.vscode-jsonnet/bin/jsonnet-language-server
Error: Command failed: /Users/omar/Library/Application Support/Code/User/globalStorage/julienduchesne.vscode-jsonnet/bin/jsonnet-language-server --version

however the same binary works if its in ~/go/bin/

 ~/go/bin $ ./jsonnet-language-server --version 
jsonnet-language-server version 0.6.4
 ~/L/Application Su/Co/U/g/j/bin $ ./jsonnet-language-server --version
[1]    93390 killed     ./jsonnet-language-server

im using the darwin-arm64 binary. after auto-update failed, i downloaded it manually from github and moved it into my go/bin folder, then after confirming it worked via command line, copied it to the binary path given in the vscode output above

+1 on this issue for darwin-arm64 (M1) binary. We had experienced this issue during development as well, so definitely not a new issue.

For posterity, a workaround is to:

  • either download the binary release or build it yourself
  • disable Enable Auto Update in the Jsonnet Language Server settings (i.e. "jsonnet.languageServer.enableAutoUpdate": false)
  • Set Path to Binary in the Jsonnet Language Server settings to the associated path of binary (e.g. "jsonnet.languageServer.pathToBinary": "~/path/to/binary/jsonnet-language-server")

this happened again with 0.7.2, i was following zack's instructions but I also had to run sudo xattr -d com.apple.quarantine /path/to/language/server to be able to use it

Even all of the above steps were unable to resolve the issue (M1 Pro).

[Error - 4:14:39 PM] Jsonnet Language Server client: couldn't create connection to server.
Launching server using command /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix failed. Error: spawn /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix EACCES
[Error - 4:14:39 PM] Sending notification workspace/didChangeConfiguration failed.
Launching server using command /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix failed. Error: spawn /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix EACCES

Even all of the above steps were unable to resolve the issue (M1 Pro).

[Error - 4:14:39 PM] Jsonnet Language Server client: couldn't create connection to server.
Launching server using command /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix failed. Error: spawn /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix EACCES
[Error - 4:14:39 PM] Sending notification workspace/didChangeConfiguration failed.
Launching server using command /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix failed. Error: spawn /Users/jackson/.vscode-oss/extensions/grafana.vscode-jsonnet-0.3.1/vscode-jsonnet-0.3.1.vsix EACCES

You should grand execute access to binary, eg: chmod +x ./jsonnet-language-server_0.12.1_linux_arm64