I'm seeing 100s of the following type of error when clojure-lsp
fires up on my work project:
[clojure-lsp.crawler:122] - Cannot find position data when analysing let* {:name let*, :filename "/home/mark/Code/Personal/clojure-lsp-issue/src/example.clj", :from example, :col nil, :from-var showcase, :arity 2, :bucket :var-usages, :row nil, :to clojure.core} nil
[clojure-lsp.crawler:122] - Cannot find position data when analysing fn* {:name fn*, :filename "/home/mark/Code/Personal/clojure-lsp-issue/src/example.clj", :from example, :col nil, :from-var showcase, :arity 2, :bucket :var-usages, :row nil, :to clojure.core} nil
Here's a minimal reproduction: https://github.com/codeasone/clojure-lsp-issue - are these innocuous?Released @codeasone!
This is a debug log, it's in my TODO improve that log, it confuses users indeed, it should not affect your work :)
Basically this happens because some kondo analysis don't return name positions which clojure-lsp uses
But after some tests, this is kind of expected for some specific analysis and don't affect user experience with clojure-lsp
Great, thanks @ericdallo
@ericdallo it seemed weird to me that Kondo returned those. Is it a bug on that side or is there a reason/use for them?
Yeah, with some tests I did, not deep though, I realized it happens with some macros like fn*
, let*
->
they don't contain :row
nor :col
Do you know if is that expected @borkdude? some analysis don't contain :row
and :col
?
That's macros that use those fns, not uses of fn*
directly correct?
this might be due to macro-expansion yes
"macro-expansion", clj-kondo's way of expanding these expressions
:clojure-lsp: Latest clojure-lsp
release reduce native binaries size drastically from 118MB -> 29MB 🎉
LMK if any issues!
Thanks so much for your work! I just downloaded the latest version (mac OS native) and it crashes: zsh: killed clojure-lsp
Setting xattr doesn’t help, previous versions worked fine for me. Just reinstalled 2021.02.12-03.13.12 and it works. If there is any debug output I can generate to help, I’d be happy too.
@javahippie Have you chmod+x it?
Yes, I did that. The error message would’ve been different, too, I guess
What if you execute it manually from a shell?
I just tried it myself on macOS Mojave and it worked for me.
Are you perhaps using M1?
This is the response when I start it from the commandline with zsh. I am on Big Sur, without M1
Hmm, I'm also using macOS with zsh, but not Big Sur
Hum, maybe UPX has some issue with macOS Big Sur? It'd be good to check if anyone has that too on Big Sur
@javahippie please open a issue so we check if there others with that issue, I found that also: https://github.com/upx/upx/issues/424
It seems to be a issue with Big Sur and UPX indeed 😕 maybe we should rollback clojure-lsp to not use UPX for mac users ?:thinking_face:
@ericdallo Just filed a Bug: https://github.com/clojure-lsp/clojure-lsp/issues/322
thank you!
Just updated one more thing, exit code is 137
137 means out of memory
@javahippie Could you check your OS memory while running clojure-lsp?
I cannot really see any changes as the process crashes instantly
I see, probably UPX bug indeed
> @andre.peric WDYT about creating a `clojure-lsp/homebrew-brew` repo with clojure-lsp custom formula? Yes, this looks saner. Great ideia. Will have a look at that after the holidays.
Fixed on latest release @javahippie 🙂
Very nice, thank you very much!
Maybe upx isn't worth the bother, since the releases are already zipped and disk space is usually not a concern when it comes to 100mb files
Yeah I thought about that, the zip with UPX is almost the same size of the zip without upx
upx is basically "unzip on run"
@borkdude is there any way to know is that analysis is a macro expansion? with that we could just don't log for those cases
• set a new flag during build related to dynaload
• Use https://upx.github.io/ to compress binary size (it increases the startup time by ~300ms but the tradeoff looks good for clojure-lsp case)
There are a few built-in ones, like ->
and ->>
, etc.
this is in src/clj_kondo/impl/macroexpand.clj
Nice, will not log for those so
@ericdallo Is it an idea to start distributing clojure-lsp through brew ?
Actually, it's already available but
very outdated, I had this Idea which @andre.peric is helping me though: https://github.com/clojure-lsp/clojure-lsp/pull/286
but homebrew core doesn't support graalvm yet
I would not recommend going the homebrew core route. Even clojure core isn't doing that anymore. Unless you like bureaucracy. Just make a tap
and we are having a hard time to make this PR pass on tests: https://github.com/Homebrew/homebrew-core/pull/69929
Yeah, thanks for the advice, I was really thinking to use the other homebrew way
Here are all my packages. They download directly from Github. https://github.com/borkdude/homebrew-brew
but I'm not a MacOS user, so don't know too much about homebrew
Well, brew also works for linux, so you will also help linux users
yeah, this looks way more easy, and we could get the binary from release
@borkdude why do you need a separated repo for the formulas? what users need to do to install via homebrew but poiting to your repo?
@ericdallo for a tap your repo must start with the name homebrew-<x> and then x is the name of your tap. Then people can install the package using: brew install borkdude/brew/babashka
oh, really easy indeed
@andre.peric WDYT about creating a clojure-lsp/homebrew-brew
repo with clojure-lsp custom formula?
Fixed, It'll be available one next release @codeasone 🙂