PMunch / nimlsp

Language Server Protocol implementation for Nim
MIT License
419 stars 51 forks source link

#125 broke compatibility with Nim v1.2 #130

Closed michaelsbradleyjr closed 2 years ago

michaelsbradleyjr commented 2 years ago

nimble build prior to ad8ef187c69e7a4fb76c5d52839482f0a1b4b47b works correctly with Nim v1.2, but after the changes in #125 were merged the build fails with Nim v1.2

$ nim --version
Nim Compiler Version 1.2.18 [MacOSX: amd64]
Compiled at 2022-03-09
Copyright (c) 2006-2020 by Andreas Rumpf

$ nimble --version
nimble v0.13.1 compiled at 2022-03-09 22:10:33
git hash: couldn't determine git hash

$ git show -q HEAD
commit ad8ef187c69e7a4fb76c5d52839482f0a1b4b47b (HEAD)
Author: Bung <crc32@qq.com>
Date:   Mon May 23 21:26:26 2022 +0800

    windows compatibility through multisync (#125)

    * windows compatibility through multisync

    * re-organize all imports

    * make multisyncTask beautiful

$ nimble build
  Verifying dependencies for nimlsp@0.4.0
      Info: Dependency on jsonschema@>= 0.2.1 already satisfied
  Verifying dependencies for jsonschema@0.2.1
      Info: Dependency on ast_pattern_matching@any version already satisfied
  Verifying dependencies for ast_pattern_matching@1.0.0
      Info: Dependency on asynctools@any version already satisfied
  Verifying dependencies for asynctools@0.1.1
   Building nimlsp/nimlsp using c backend
/path/to/repos/nimlsp-codex/src/nimlsppkg/baseprotocol.nim(2, 8) Warning: imported and not used: 'logger' [UnusedImport]
/path/to/repos/nimlsp-codex/src/nimlsp.nim(133, 83) template/generic instantiation of `multisync` from here
/path/to/repos/nimlsp-codex/src/nimlsp.nim(135, 3) template/generic instantiation of `multisyncTask` from here
/path/to/repos/nimlsp-codex/src/nimlsp.nim(131, 13) template/generic instantiation of `await` from here
/path/to/.choosenim/toolchains/nim-1.2.18/lib/pure/asyncmacro.nim(455, 10) Error: Await only available within .async
       Tip: 7 messages have been suppressed, use --verbose to show them.
     Error: Build failed for package: nimlsp
        ... Execution failed with exit code 256
        ... Command: /path/to/.nimble/bin/nim c --colors:on --noNimblePath -d:NimblePkgVersion=0.4.0 --path:/path/to/.nimble/pkgs/jsonschema-0.2.1 --path:/path/to/.nimble/pkgs/ast_pattern_matching-1.0.0 --path:/path/to/.nimble/pkgs/asynctools-0.1.1 --hints:off -o:/path/to/repos/nimlsp-codex/nimlsp /path/to/repos/nimlsp-codex/src/nimlsp.nim
PMunch commented 2 years ago

@bung87

bung87 commented 2 years ago

can you upgrade to nim 1.4 or upper ? https://github.com/nim-lang/Nim/blob/018ae963ba83934a68d815c3c1c44c06e8ec6178/lib/pure/asyncmacro.nim#L358

michaelsbradleyjr commented 2 years ago

can you upgrade to nim 1.4 or upper ? https://github.com/nim-lang/Nim/blob/018ae963ba83934a68d815c3c1c44c06e8ec6178/lib/pure/asyncmacro.nim#L358

My hope was to have it working with Nim v1.2, since that is the version of the compiler built by default by the nimbus-build-system.

If the problem is intractable, no worries, I can override locally with make variable NIM_COMMIT=version-1-6 (or version-1-4).

PMunch commented 2 years ago

@bung87, we should try to support the 1.2 branch as well, so if it's possible please add a when NimVersion check and shim the required things.

bung87 commented 2 years ago

we can make a backward compatibility change.