nim-lang / langserver

The Nim language server implementation (based on nimsuggest)
204 stars 31 forks source link

nimlangserver@1.2.0 install failed mac os sonoma M1 #180

Closed ninovanhooff closed 9 months ago

ninovanhooff commented 9 months ago

I'm using nim 1.6.16, on mac os sonoma with M1 chip

nimble install nimlangserver:

command: /Users/ninovanhooff/.nimble/bin/nim c --colors:on --noNimblePath -d:release -d:NimblePkgVersion=1.3.1 [..]

Installing nimlangserver@1.2.0
   Building nimlangserver/nimlangserver using c backend
/Users/ninovanhooff/.nimble/pkgs/faststreams-0.3.0/faststreams/async_backend.nim(35, 12) Warning: asyncdispatch backend currently fails tests - it may or may not work as expected [User]
/private/var/folders/ww/sx_qg7z51jz6bgr15k4_5y8m0000gn/T/nimble_83662/githubcom_nimlanglangserver/asyncprocmonitor.nim(4, 8) Warning: imported and not used: 'os' [UnusedImport]
/private/var/folders/ww/sx_qg7z51jz6bgr15k4_5y8m0000gn/T/nimble_83662/githubcom_nimlanglangserver/nimlangserver.nim(175, 73) template/generic instantiation of `async` from here
/private/var/folders/ww/sx_qg7z51jz6bgr15k4_5y8m0000gn/T/nimble_83662/githubcom_nimlanglangserver/nimlangserver.nim(176, 30) Error: expression 'parseWorkspaceConfiguration do:
  var internalTmpFuture`gensym140: FutureBase = ls.workspaceConfiguration
  yield internalTmpFuture`gensym140
  read(cast[typeof(ls.workspaceConfiguration)](internalTmpFuture`gensym140))' is of type 'NlsConfig' and has to be used (or discarded)
    Prompt: Build failed for 'nimlangserver@1.2.0', would you like to try installing 'nimlangserver@#head' (latest unstable)? [y/N]

Also the attempt to use the latest unstable version fails

nickysn commented 9 months ago

Hm, it appears that you need to use Nim 2.x to compile the nimlangserver from source. After compilation, you can still use it with 1.6.16. We also provide binaries for various platforms, including macOS: https://github.com/nim-lang/langserver/releases/tag/v1.2.0 and: https://github.com/nim-lang/langserver/releases/tag/latest I've bumped the requirement to nim >= 2.0.0 in nimlangserver.nimble, so the latest unstable version should (at least in theory) now build.

ninovanhooff commented 9 months ago

This worked, thanks.

I guess that you are not planning to support compiling with Nim 1.6?

nickysn commented 9 months ago

Why should we support compilation with Nim 1.6? Does it matter whether nimlangserver can be compiled with Nim 1.6, when you can compile it with 2.x and use it with Nim and nimsuggest 1.6?

ninovanhooff commented 9 months ago

My motivation would be that I would like to include the nim-lang vscode extension in a template project that has to be easy to set up.

But it seems like we will be able to update that to nim 2 soon, so I guess there is no need.

On Sun, 11 Feb 2024, 03:10 Nikolay Nikolov, @.***> wrote:

Why should we support compilation with Nim 1.6? Does it matter whether nimlangserver can be compiled with Nim 1.6, when you can compile it with 2.x and use it with Nim and nimsuggest 1.6?

— Reply to this email directly, view it on GitHub https://github.com/nim-lang/langserver/issues/180#issuecomment-1937394878, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACO7DHYYBQGTI6K2JABCCI3YTASC5AVCNFSM6AAAAABC43ENPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXGM4TIOBXHA . You are receiving this because you modified the open/close state.Message ID: @.***>

nickysn commented 9 months ago

Closing this. We're not planning to support compilation of the language server with Nim 1.6.x. You can still use Nim 1.6.x with a matching nimsuggest 1.6.x with a language server, compiled with Nim 2.x. There's no need for the Nim version, used for compilation of the server to match the version you're using in the project you're using the language server with. For convenience, we now also provide nimlangserver binaries. There's also a proposal to bundle such binaries in the vscode-nim extension, but that is a separate issue: https://github.com/nim-lang/vscode-nim/issues/9