nimlsp icon indicating copy to clipboard operation
nimlsp copied to clipboard

#125 broke compatibility with Nim v1.2

Open michaelsbradleyjr opened this issue 1 year ago • 5 comments

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 <[email protected]>
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 [email protected]
      Info: Dependency on jsonschema@>= 0.2.1 already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on ast_pattern_matching@any version already satisfied
  Verifying dependencies for [email protected]
      Info: Dependency on asynctools@any version already satisfied
  Verifying dependencies for [email protected]
   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

michaelsbradleyjr avatar Jul 21 '22 22:07 michaelsbradleyjr

@bung87

PMunch avatar Jul 22 '22 07:07 PMunch

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

bung87 avatar Jul 23 '22 05:07 bung87

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).

michaelsbradleyjr avatar Jul 26 '22 18:07 michaelsbradleyjr

@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.

PMunch avatar Aug 07 '22 10:08 PMunch

we can make a backward compatibility change.

bung87 avatar Aug 07 '22 11:08 bung87