nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.49k stars 1.46k forks source link

hotcodereloading compile error with orc/arc #18393

Open n0bra1n3r opened 3 years ago

n0bra1n3r commented 3 years ago

--hotcodereloading:on and --gc:orc causes a compile error on Windows on latest devel and 1.4.8. A similar error message is printed if --define:useNimRtl is passed instead of --hotcodereloading. Compilation works with the traditional GC.

Example

nim.exe c --hotcodereloading:on --gc:orc main.nim

Output

C:\Users\User\.choosenim\toolchains\nim-#devel\lib\system\mmdisp.nim(86, 25) template/generic instantiation of `instantiateForRegion` from here
C:\Users\User\.choosenim\toolchains\nim-#devel\lib\system\alloc.nim(1028, 3) Error: redefinition of 'deallocOsPages'; previous declaration here: C:\Users\User\.choosenim\toolchains\nim-#devel\lib\system\threads.nim(112, 8)
The terminal process "C:\Users\User\.nimble\bin\nim.exe 'check', '--errorMax:1', 'main.nim'" terminated with exit code: 1.

Expected Output

Successful compile.

Nim Compiler Version 1.5.1 [Windows: amd64]
Compiled at 2021-06-29
Copyright (c) 2006-2021 by Andreas Rumpf

active boot switches: -d:release
# Nim 2021-06-29-devel-6387e289631c22b8fa81e8e478c97cc500b90e26
ringabout commented 3 years ago

Related https://github.com/nim-lang/Nim/issues/16458