nim-lang/langserver

nimlangserver@1.2.0 install failed mac os sonoma M1

Closed this issue · 5 comments

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

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.

This worked, thanks.

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

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?

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:
nim-lang/vscode-nim#9