This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-30
Channels
- # adventofcode (4)
- # aleph (1)
- # announcements (6)
- # babashka (11)
- # beginners (63)
- # calva (73)
- # clj-kondo (9)
- # clj-on-windows (20)
- # cljdoc (8)
- # cljsrn (4)
- # clojure (48)
- # clojure-europe (20)
- # clojure-italy (1)
- # clojure-nl (11)
- # clojure-spec (11)
- # clojure-uk (3)
- # clojurescript (32)
- # cloverage (1)
- # conjure (1)
- # cryogen (5)
- # datomic (83)
- # fulcro (28)
- # graphql (23)
- # gratitude (4)
- # helix (15)
- # honeysql (4)
- # improve-getting-started (14)
- # introduce-yourself (3)
- # jackdaw (5)
- # kaocha (11)
- # leiningen (1)
- # malli (1)
- # meander (5)
- # off-topic (18)
- # pathom (17)
- # pedestal (6)
- # polylith (15)
- # practicalli (1)
- # quil (2)
- # reitit (4)
- # releases (6)
- # shadow-cljs (38)
- # sql (20)
- # testing (6)
- # timbre (5)
- # tools-deps (11)
- # vim (2)
hey hey! i'm having a problem with Clojure Language Server trying to start up, hoping someone here might know an answer 🙂 i'm working • in VSCode • remote-ssh'ed onto a Raspberry Pi 2 • Calva extension installed on the remote (also using leiningen & OpenJDK 11.0.12 on the remote; all these mirror my local computer) • Clojure language server fails to start up, with output:
[Error - 12:46:36] Connection to server is erroring. Shutting down server.
/home/pi/.vscode-server/extensions/betterthantomorrow.calva-2.0.210/clojure-lsp: 1: /home/pi/.vscode-server/extensions/betterthantomorrow.calva-2.0.210/clojure-lsp: Syntax error: ")" unexpected
• only the language server fails; repls seem to work fine!
has someone here encountered this before, perhaps? my googling has yielded little thus far.
i'm happy to provide more output if desired!You are using probably a wrong clojure-lsp binary, and there is no binary for aarch64 yet :/
ah, that would explain it, indeed - thanks!
technically, the Raspberry Pi 2 in question here is 32bit, but i'm guessing that there's even less demand for a clojure-lsp on that architecture 😛
There is a workaround for now, download the clojure-lsp
file from https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.08.24-14.41.56, which is a embedded jar, so you just need java on PATH
cool! but looking at the files, it looks like it's intended for 64-bit, right? i so it would probably not work like that, would it? i mean, i can try, of course, just want to cull my expectations
that embedded jar is a java jar in a executable file, so it should work in everything that runs java fine
awesome! going ahead with attempt now
oh, so basically, Calva's language server implementation relies specifically on graal?
Calva language server implementation = https://clojure-lsp.github.io/clojure-lsp/ it generates native binaries for most used OS
Windows, Linux, MacOS ATM, if you don't use any of these, the embedded jar is the fallback
so, i've put both the clojure-lsp.jar
into the folder where Calva expected to find it (and also its companion clojure-lsp
binary file, just to be sure)
then i have set the remote vscode's setting
"calva.clojureLspPath": "~/.vscode-server/extensions/betterthantomorrow.calva-2.0.210/clojure-lsp.jar"
,
and i also previously have made sure that the system's path has a JAVA_HOME
pointing to OpenJDK's java binary
but still, it doesn't work :thinking_face: did i miss something?
you don't need the clojure-lsp.jar, the clojure-lsp one already has the jar embedded in the file.
right, i also tried using that in the settings, as well
can you try running clojure-lsp --version
with tthat downloaded binary and check if it's working?
yeah, already tried that^ 😕
[Error - 14:39:39] Starting client failed
Launching server using command ~/.vscode-server/extensions/betterthantomorrow.calva-2.0.210/clojure-lsp failed.
and clojure-lsp --version
only yields
bash: clojure-lsp: command not found
but if the binary is somehow made with graalvm, which requires 64-bit architecture- it would make sense that clojure-lsp
can't function properly on a 32-bit system anyway, even with its jarfile includedthat's what came with the vscode extension, so i've tried to use both, one at a time
calva, specifically
the vscode extension for clj-kondo should work independently from calva, it just uses java
you could maybe download the jar file and then make a bash script which does java -jar the-jar.jar
and then set that as the "lsp binary"
yeah, when i downloaded the source code of the binaries mentioned up above (simply called "clojure-lsp"), i saw that it even uses clj-kondo
you can find the jar here: https://github.com/clojure-lsp/clojure-lsp/releases/download/2021.08.24-14.41.56/clojure-lsp.jar
the clojure-lsp
from the releases, is a embedded jar, which means is a executable that calls a java -jar on its file, is just a easy way for you to doesn't need to java -jar
then i noticed that you were the author of clj-kondo (@U04V15CAJ), so that was cool 😉 wouldn't it be easier, though, if i somehow just disabled Calva's lsp? and used clj-kondo instead?
is just that before graalvm everyone was using the clojure-lsp
one as it's easy as ./clojure-lsp
and you just need java installed
> if i somehow just disabled Calva's lsp? You will lose a lot of features, not sure it's possible as well on Calva
> and `clojure-lsp --version` only yields
> bash: clojure-lsp: command not found
Is this the output of the downloaded clojure-lsp
from the releases page?
hang on, i might have derped about which terminal/folder i was in when i tried that
actually, it's already documented: https://clojure-lsp.github.io/clojure-lsp/installation/#embedded-jar-legacy-executable
^ no, i was right, while in bash in the correct folder; i either get error from bash for alias not existing or permission denied if i try to run it as an executable
@UKFSJSM38 that's not what I meant
@U02AQ7MGEQ1 the docs say to chmod +x
the downloaded clojure-lsp
to avoid the permission error
a user should just be able to write a bash script and use the normal jar, no weird shit with embedded stuff, as that's what's likely causing the trouble
I agree if that is causing the issue, but I never saw an issue with the clojure-lsp embedded jar
regarding "place it in your $PATH with chmod 755"; do they mean to edit the /etc/environment file with sudo, or ... ?
however, the chmod +x (thanks for reminding me!) made the file executable, and so we got this instead
hahaha, i should have known!
ahhh, that's actually extremely funny to our project
having discussed arm32 vs arm64 multiple times over and over, because graalvm was very attractive (but now apparently also the increased memory on each of the corresponding alternatives) could be attractive as well
hey, crazy thought - could i use my local VSCode's resources to run the lsp, even though the codebase is on the remote?
i am, indeed
what you could also do is open your project locally, but connect to a REPL on the machine
open the REPL on the machine and then connect to a remote running REPL from your local editor
thanks, it's worth a try indeed! :)