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.48k stars 1.47k forks source link

emit/importc regression in devel/1.6.4rc #19483

Open PMunch opened 2 years ago

PMunch commented 2 years ago

Noticed this when I created this issue . The example from that issue compiles on 1.6.2, but fails on 1.6.4 and devel with:

/home/peter/.cache/nim/dctest_d/stdlib_system.nim.c:6634:53: error: unknown type name ‘Vector2’
 6634 | N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___dctest_10)(Vector2 x, Vector2 y) {
      |                                                     ^~~~~~~
/home/peter/.cache/nim/dctest_d/stdlib_system.nim.c:6634:64: error: unknown type name ‘Vector2’
 6634 | N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, eqeq___dctest_10)(Vector2 x, Vector2 y) {
      |                                                                ^~~~~~~
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3   -I'/home/peter/.choosenim/toolchains/nim-#version-1-6/lib' -I/tmp -o /home/peter/.cache/nim/dctest_d/stdlib_system.nim.c.o /home/peter/.cache/nim/dctest_d/stdlib_system.nim.c' failed with exit code: 1

Compiling with 1.4.6 yields the same error, so it seems to have been fixed before 1.6.0 but regressed between 1.6.2 and 1.6.4.

narimiran commented 2 years ago

My bisecting on the version-1-6 branch has pointed to this PR: https://github.com/nim-lang/Nim/pull/19363/files (cc @xflywind)

ringabout commented 2 years ago

Not sure whether it is actually fixed in 1.6.0 which compiles accidentally and still cannot work due to https://github.com/nim-lang/Nim/issues/19482

19363 reverted a troublesome change in 1.6.0

Maybe it shouldn't block 1.6.4 release.