Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start clojure-lsp client failed #1590

Closed
paomian opened this issue Mar 11, 2022 · 32 comments
Closed

start clojure-lsp client failed #1590

paomian opened this issue Mar 11, 2022 · 32 comments
Labels

Comments

@paomian
Copy link

paomian commented Mar 11, 2022

can start Clojure language client

my pc version

MacBook Pro (14-inch, 2021)
Apple M1 Pro

vscode version

Version: 1.65.2
Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
Date: 2022-03-10T14:42:05.236Z (13 hrs ago)
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 21.3.0

when I open Clojure project I got an error

[Error - 11:29:18 AM] Starting client failed
Error: spawn Unknown system error -86
	at ChildProcess.spawn (internal/child_process.js:403:11)
	at Object.spawn (child_process.js:570:9)
	at /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/out/extension.js:2:751660
@PEZ
Copy link
Collaborator

PEZ commented Mar 11, 2022

Sometimes the client download fails. Check if you see a clojure-lsp binary in /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/ and if you do, delete it. Then reload the vscode window. Please let us know if it works or not.

@paomian
Copy link
Author

paomian commented Mar 11, 2022

emm.i found clojure-lsp binary and delete it.
now the error become

Launching server using command /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp failed.

by the way my jdk is zulu8,maybe it have some trouble about clojure-lsp.

It is no redownload clojure-lsp step on my situation.
and i uninstall calva and delete betterthantomorrow.calva-2.0.253 dir.then i reinstall calva got the same error which in the first commit in this issue.
and i delete clojure-lsp got the same error which in this commit.

@PEZ
Copy link
Collaborator

PEZ commented Mar 11, 2022

What are your settings for calva.clojureLspPath and calva.clojureLspVersion?

@PEZ
Copy link
Collaborator

PEZ commented Mar 11, 2022

zulu8 should be fine, btw.

@PEZ
Copy link
Collaborator

PEZ commented Mar 11, 2022

Also check the the developer console (Help menu -> Toggle Developer Tools) for any clojure-lsp related messages and paste here. Maybe I can figure out where it goes wrong if I have those.

@paomian
Copy link
Author

paomian commented Mar 11, 2022

calva.clojureLspPath and calva.clojureLspVersion i did not change that.
calva.clojureLspPath is empty.calva.clojureLspVersion is latest

i found some error,but seem to useless.
and it's hard to format it.so i take a screenshot.

workbench.desktop.main.js:787 Couldn't start client Clojure Language Client
onDidChangeNotification @ workbench.desktop.main.js:787
workbench.desktop.main.js:605   ERR [Extension Host] clojure-lsp: Launching server using command /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp failed.
workbench.desktop.main.js:71 [Extension Host] clojure-lsp: Launching server using command /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp failed.
I @ workbench.desktop.main.js:71
workbench.desktop.main.js:605   ERR spawn /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp ENOENT: Error: spawn /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp ENOENT
	at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
	at onErrorNT (internal/child_process.js:465:16)
	at processTicksAndRejections (internal/process/task_queues.js:80:21)

image

@PEZ
Copy link
Collaborator

PEZ commented Mar 11, 2022

Can you try also deleting clojure-lsp_backup file and what messages you get then?

@paomian
Copy link
Author

paomian commented Mar 11, 2022

where is clojure-lsp_backup ?
I have no clojure-lsp_backup file in extension.

➜  betterthantomorrow.calva-2.0.253 find . -name "*_backup"
➜  betterthantomorrow.calva-2.0.253

and i delete clojure-lsp too.

➜  betterthantomorrow.calva-2.0.253 find . -name "clojure-*"
./clojure-lsp-version
./clojure-lsp-native-macos-amd64.zip
./assets/images/clojure-cli.svg

@PEZ
Copy link
Collaborator

PEZ commented Mar 11, 2022

Hmmm, it should be there. But only if a download succeeds. Maybe it is that zip-file you need to move away, come to think of it. See if that triggers a re-download.

@paomian
Copy link
Author

paomian commented Mar 14, 2022

I move clojure-lsp-native-macos-amd64.zip to other dir and restart vscode.
I got the same error.

[Error - 11:59:23 AM] Starting client failed
Launching server using command /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp failed.
find . -name "clojure-*"
./clojure-lsp-version
./assets/images/clojure-cli.svg

@PEZ
Copy link
Collaborator

PEZ commented Mar 14, 2022

What does clojure-lsp-version contain? When you've read that you can remove this file too.

It is clear that the download does not happen. Do you see any attempt to downloading it. There should flash a statusbar item about this when the window is reloaded.

@PEZ
Copy link
Collaborator

PEZ commented Mar 14, 2022

Can you try this Calva VSIX: https://19430-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.254-1592-stop-start-clojure-lsp-5fcf9853.vsix

(Download and from the VS Code Extension pane, in the meatballs (the three dots) menu, select Install from VSIX.)

It's a development version:

It should give you a statusbar icon for clojure-lsp which can be clicked and give you a download option. This should force a new download. (It could also be that things never reach a state where the statusbar button is activated, but we will see.)

@paomian
Copy link
Author

paomian commented Mar 15, 2022

sorry for the late reply.I'm busy these days.

What does clojure-lsp-version contain? When you've read that you can remove this file too.

cat clojure-lsp-version
2022.02.23-12.12.12%

It is clear that the download does not happen. Do you see any attempt to downloading it. There should flash a statusbar item about this when the window is reloaded.

after I delete clojure-lsp-version and reload vscode. the clojure-lsp redownload.but the error is still exists
and then i check the clojure-lsp-version.It is contain 2022.02.23-12.12.12 like before.


Now I'm downloadi Calv VSIX which you provider.

@paomian
Copy link
Author

paomian commented Mar 15, 2022

I don't know much about js.So I'm not very clear on what this pr does.
after I install extension you provider. the error is still exists.and the clojure-lsp in status bar always show Clojure-LSP is staring.

@PEZ
Copy link
Collaborator

PEZ commented Mar 15, 2022

Thanks for testing that VSIX.

Now what to do.... Hmmm. Can you check if you have a file /tmp/clojure-lsp.out and if so paste it's content here?

@PEZ PEZ changed the title start client failed start clojure-lsp client failed Mar 15, 2022
@PEZ
Copy link
Collaborator

PEZ commented Mar 15, 2022

Can you try running clojure-lsp from the command line and see what that gives you?

/Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp --version

@PEZ
Copy link
Collaborator

PEZ commented Mar 15, 2022

BTW, @paomian . I hope you are aware that Calva is still perfectly useable without the clojure-lsp client? The error messages can be a bit alarming and maybe give the impression that all is lost.

@paomian
Copy link
Author

paomian commented Mar 16, 2022

file /tmp/clojure-lsp.out not exists.

less /tmp/clojure-lsp.out
/tmp/clojure-lsp.out: No such file or directory

I think clojure-lsp unsupport m1 CPU.

/Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp --version
zsh: bad CPU type in executable: /Users/paomian/.vscode/extensions/betterthantomorrow.calva-2.0.253/clojure-lsp

I hope you are aware that Calva is still perfectly useable without the clojure-lsp client?

yes i can still use repl in calva.

@PEZ
Copy link
Collaborator

PEZ commented Mar 16, 2022

Are you running VS Code in a docker container, maybe? I'm running into very similar issues here:

@paomian
Copy link
Author

paomian commented Mar 17, 2022

Are you running VS Code in a docker container, maybe?

No i running vs code in host.but I'm not install Rosetta.

@bpringe bpringe added the lsp label Mar 22, 2022
@bpringe
Copy link
Member

bpringe commented Mar 22, 2022

Can you try installing Rosetta and see if that helps? Clojure-lsp runs on my my company M1 Macbook.

@rileysu
Copy link

rileysu commented Mar 29, 2022

To fix this issue either install rosetta (not sure if this will work but am pretty sure) or install clojure-lsp via brew and link the absolute path in the extension settings. The version of clojure-lsp shipped with calva won't run natively on M1 processors.

@PEZ
Copy link
Collaborator

PEZ commented Mar 29, 2022

The version of clojure-lsp shipped with calva won't run natively on M1 processors

We should fix this. FYI Calva doesn't ship with a clojure-lsp version. Calva downloads it. So if we just figure out how to properly figure out the right version to download this should be sorted.

@rileysu
Copy link

rileysu commented Mar 31, 2022

The issue seems to be here:

function getZipFileName(platform: string): string {
return {
darwin: 'clojure-lsp-native-macos-amd64.zip',
linux: 'clojure-lsp-native-linux-amd64.zip',
win32: 'clojure-lsp-native-windows-amd64.zip',
}[platform];
}

From looking at the clojure-lsp github though there doesn't seem to be a release for arm64 on darwin. The brew package seems to just use the generic version.

@bpringe
Copy link
Member

bpringe commented Apr 4, 2022

Yeah, I don't think there is a binary version for Apple Silicon yet. CC @ericdallo. Installing Rosetta is the way to go for now.

@ericdallo
Copy link
Contributor

If GraalVM supports it, we could support on clojure-lsp, but AFAIK there are already M1 users using clojure-lsp, not sure if the binary is the same for other macos.

@borkdude what binary M1 babashka users download? Do you know what binary a M1 user should use?

@PEZ
Copy link
Collaborator

PEZ commented Apr 4, 2022

AFAIK there are already M1 users using clojure-lsp

Indeed. I am one of them. The key might be Rosetta. Which probably most devs use. We can consider making that requirement explicit/documented. Like @rileysu is suggesting. The choice for the user would be to use rosetta or handle the download themselves.

@borkdude
Copy link

borkdude commented Apr 4, 2022

So far I haven't distributed any M1 binaries, just home-compiled them. Should just work with the GraalVM dev build.

@ericdallo
Copy link
Contributor

I'm no macos user and not sure what Rosetta is, but LMK if there is anything to improve on clojure-lsp side

@borkdude
Copy link

borkdude commented Apr 4, 2022

clojure-lsp should run just fine when people have installed rosetta2.

@borkdude
Copy link

borkdude commented Apr 4, 2022

At least on macOS Monterey 12.3 - not sure about older macOS versions.

@PEZ
Copy link
Collaborator

PEZ commented Apr 4, 2022

Rosetta is a backwards compatibility layer that let's M1 Macs run x86 binaries, @ericdallo. Some people are holding out, refusing to install it, waiting for native stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants