PMunch / nimlsp

Language Server Protocol implementation for Nim
MIT License
414 stars 49 forks source link

Build fails on linux (opensuse & arch) #122

Closed yummy-licorice closed 2 years ago

yummy-licorice commented 2 years ago

The error I get:

/home/luke/tmp/nimlsp/src/nimlsppkg/suggestlib.nim(11, 8) template/generic instantiation of `mImport` from here /home/luke/tmp/nimlsp/src/nimlsppkg/suggestlib.nim(7, 14) Error: cannot open file: /usr/lib64/nim/nimsuggest/nimsuggest.nim Error: Build failed for package: nimlsp ... Execution failed with exit code 1 ... Command: /usr/lib64/nim/bin/nim c --colors:on --noNimblePath -d:NimblePkgVersion=0.4.0 --path:/home/luke/.nimble/pkgs/jsonschema-0.2.1 --path:/home/luke/.nimble/pkgs/ast_pattern_matching-1.0.0 -o:/home/luke/tmp/nimlsp/nimlsp /home/luke/tmp/nimlsp/src/nimlsp.nim

SolitudeSF commented 2 years ago

this is millions time duplicate. your distribution doesnt provide nimsuggest sources so you have to clone repo yourself and read build instructions https://github.com/PMunch/nimlsp#compile-nimlsp=

yummy-licorice commented 2 years ago

I am building from source

SolitudeSF commented 2 years ago

You need nim repo. Please, read linked instructions.

PMunch commented 2 years ago

As the error you got suggest the file /usr/lib64/nim/nimsuggest/nimsuggest.nim doesn't exist. This is because you have installed Nim either through your package manager or manually. NimLSP builds directly against Nim sources, and since most people have installed Nim through choosenim or similar they will already have these sources available and placed relative to the Nim binary. If you don't have these sources available you need to download them, and in any case you need to use the -d:explicitSourcePath when compiling, as described in the README.