Chronos doesn't compile under Nim 1.6.0. I noticed this when trying to run the nim-libp2p examples.
Minimal example
bar.nim:
import chronos
Trying to compile bar.nim:
~$ nim c -r --threads:on bar.nim
Hint: used config file 'C:\Users\Admin\.choosenim\toolchains\nim-1.6.0\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\Admin\.choosenim\toolchains\nim-1.6.0\config\config.nims' [Conf]
Hint: used config file 'C:\Users\Admin\AppData\Roaming\nim\config.nims' [Conf]
...................................................................................................................................
C:\Users\Admin\.nimble\pkgs\chronos-3.0.6\chronos\streams\asyncstream.nim(434, 34) template/generic instantiation of `async` from here
C:\Users\Admin\.nimble\pkgs\chronos-3.0.6\chronos\asyncmacro2.nim(67, 17) Error: ':anonymous' is not GC-safe as it calls 'nameIterVar`gensym33'
Another attempt:
~$ nim c -r --threads:on -d:chronosStrictException bar.nim
Hint: used config file 'C:\Users\Admin\.choosenim\toolchains\nim-1.6.0\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\Admin\.choosenim\toolchains\nim-1.6.0\config\config.nims' [Conf]
Hint: used config file 'C:\Users\Admin\AppData\Roaming\nim\config.nims' [Conf]
...................................................................................................................................
C:\Users\Admin\.nimble\pkgs\chronos-3.0.6\chronos\streams\asyncstream.nim(434, 34) template/generic instantiation of `async` from here
C:\Users\Admin\.nimble\pkgs\chronos-3.0.6\chronos\asyncmacro2.nim(30, 17) Error: ':anonymous' is not GC-safe as it calls 'nameIterVar`gensym31'
I also tried compiling on 1.4.2 and 1.4.8, and compilation succeeded.
Extra info
~$ nimble dump chronos
name: "chronos"
version: "3.0.6"
author: "Status Research & Development GmbH"
desc: "Chronos"
license: "Apache License 2.0 or MIT"
skipDirs: "tests"
skipFiles: ""
skipExt: ""
installDirs: "chronos"
installFiles: "chronos.nim"
installExt: ""
requires: "nim > 1.2.0, stew any version, bearssl any version, httputils any version, https://github.com/status-im/nim-unittest2.git #head"
bin: ""
binDir: ""
srcDir: ""
backend: "c"
~$ nim --version
nim --version
Nim Compiler Version 1.6.0 [Windows: amd64]
Compiled at 2021-10-19
Copyright (c) 2006-2021 by Andreas Rumpf
active boot switches: -d:release
Chronos doesn't compile under Nim 1.6.0. I noticed this when trying to run the nim-libp2p examples.
Minimal example
bar.nim:
Trying to compile bar.nim:
Another attempt:
I also tried compiling on 1.4.2 and 1.4.8, and compilation succeeded.
Extra info