llm-ls icon indicating copy to clipboard operation
llm-ls copied to clipboard

WIP: statically linked build for non Alpine Linux x86_64

Open kalinkrustev opened this issue 2 years ago • 7 comments
trafficstars

This was going to work very well, but the recent addition of tree-sitter broke the build, as it has few modules written in C++ and they fail to build with Rust and musl. For two of them I have found the git repo already contained code rewritten in C, so only Ruby didn't, so I disabled it in the fork. I could not find any solution how to build C++ with Rust and musl.


Below is the error related to C++ tree-sitter-ruby code. Similar ones happened for tree-sitter-elixir, tree-sitter-html

  running: "musl-g++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src" "-Wall" "-Wextra" "-o" "/home/runner/work/llm-ls/llm-ls/target/x86_64-unknown-linux-musl/release/build/tree-sitter-ruby-7669b38d3e7a5c68/out/src/scanner.o" "-c" "src/scanner.cc"

  --- stderr


  error occurred: Failed to find tool. Is `musl-g++` installed?

kalinkrustev avatar Oct 13 '23 14:10 kalinkrustev

@kalinkrustev quick question, can I use the target x86_64-unknown-linux-gnu instead of the x86_64-unknown-linux-musl? My local servers do not support that g++ version.

cmosguy avatar Oct 13 '23 15:10 cmosguy

The x86_64-unknown-linux-musl published in the fork works fine on older Ubuntu and probably many other distributions. The error above is a compilation error before removing the Ruby parser.

kalinkrustev avatar Oct 14 '23 08:10 kalinkrustev

@kalinkrustev and @McPatate see my comment, here: https://github.com/huggingface/llm-ls/issues/25#issuecomment-1764466147 still does not work with older versions of GLIBC

cmosguy avatar Oct 16 '23 13:10 cmosguy

I tested the version from @kalinkrustev's fork and was able to get it running fine. What do we need to change to get this PR merged?

spew avatar Feb 07 '24 03:02 spew

I tested the version from @kalinkrustev's fork and was able to get it running fine. What do we need to change to get this PR merged?

@McPatate I am really keen on using this fix as trying to orchestrate other forks is a bit cumbersome. Would be grateful if you could expedite the merge. Cheers!

cmosguy avatar Feb 07 '24 21:02 cmosguy

Let me finish up some fixes for 0.5.0 and I'll merge this PR as well before the release :)

McPatate avatar Feb 08 '24 09:02 McPatate

I'm not convinced we have to modify the CI yaml. The fix looks like it's about the tree sitter crates using C++

Maybe we can break out the removal of the tree sitter C++ dependency into it's own PR and then we can reason about the changes seperately.

spew avatar Feb 09 '24 17:02 spew