Closed winrid closed 1 year ago
Ah, looks like maybe a Windows-specific error w/ nimterop and DuckDB:
# const 'DUCKDB_API' has unsupported value '__declspec(dllimport)'
# const 'DUCKDB_API_LATEST' has unsupported value 'DUCKDB_API_0_3_2'
# const 'DUCKDB_API_VERSION' has unsupported value 'DUCKDB_API_LATEST'
Confirmed compiles fine on Linux.
Regarding this package not being available on nimble that is fine.
You can use the command nimble install https://github.com/ayman-albaz/nim-duckdb
for any packages not yet on nimble.
Windows error should now be gone. Error was due to incorrect dynamic library selection. Windows now added to CICD to insure windows support.
Also note, you may have to delete the nimcache
folder from your windows machine in order for the new libraries to download.
If problems persists, please open this issue.
Thanks! That solved it. I now get another issue, which might be a bug in Nim, or maybe something wrong with the toolchain on my machine, but not sure yet. It's:
C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c: In function 'c_setjmp__systemZansi95c_42':
C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c:27:11: error: too many arguments to function '_setjmp'
result = _setjmp(jmpb, NIM_NIL);
^~~~~~~
In file included from C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c:8:0:
c:\mingw\include\setjmp.h:39:37: note: declared here
_CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf);
^~~~~~~
CC: ../../../.choosenim/toolchains/nim-1.6.8/lib/system/ansi_c.nim
CC: ../../../.choosenim/toolchains/nim-1.6.8/lib/system.nim
Error: execution of an external compiler program 'gcc.exe -c -w -fmax-errors=3 -mno-ms-bitfields -IC:\Users\winrid\.choosenim\toolchains\nim-1.6.8\lib -IC:\Users\winrid\nimcache\nimterop\cPlugins -o C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c.o C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c' failed with exit code: 1
C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem.nim.c: In function 'showErrorMessage__system_2538':
C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem.nim.c:3802:44: error: too many arguments to function '_setjmp'
TM__Q5wkpxktOdTGvlSRo9bzt9aw_26.status = _setjmp(TM__Q5wkpxktOdTGvlSRo9bzt9aw_26.context, 0);
^~~~~~~
In file included from C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem.nim.c:9:0:
c:\mingw\include\setjmp.h:39:37: note: declared here
_CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf);
^~~~~~~
Failed to compile cPlugin()
cmd: C:\Users\winrid\.choosenim\toolchains\nim-1.6.8\bin\nim.exe c --app:lib --gc:markAndSweep --out:"C:\Users\winrid\nimcache\nimterop\cPlugins\nimterop_1221099484.dll" C:\Users\winrid\nimcache\nimterop\cPlugins\nimterop_1221099484.nim [AssertionDefect]
Looks like Nim is trying to pass NIM_NIL
as a second argument to _setjmp, which does only takes one argument: https://linux.die.net/man/3/_setjmp
Note - the above does not appear related to this library. Ripped out library and deleted nimcache etc. But, it was compiling before, and not after installing duckdb. Weird! I've tried setting nimcache to a different directory, not sure what else to try yet. Anyway, thanks for fixing the bug. :)
Update: well, it compiles fine on WSL... screw windows I guess. :)
Thanks! That solved it. I now get another issue, which might be a bug in Nim, or maybe something wrong with the toolchain on my machine, but not sure yet. It's:
C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c: In function 'c_setjmp__systemZansi95c_42': C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c:27:11: error: too many arguments to function '_setjmp' result = _setjmp(jmpb, NIM_NIL); ^~~~~~~ In file included from C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c:8:0: c:\mingw\include\setjmp.h:39:37: note: declared here _CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf); ^~~~~~~ CC: ../../../.choosenim/toolchains/nim-1.6.8/lib/system/ansi_c.nim CC: ../../../.choosenim/toolchains/nim-1.6.8/lib/system.nim Error: execution of an external compiler program 'gcc.exe -c -w -fmax-errors=3 -mno-ms-bitfields -IC:\Users\winrid\.choosenim\toolchains\nim-1.6.8\lib -IC:\Users\winrid\nimcache\nimterop\cPlugins -o C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c.o C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem@sansi_c.nim.c' failed with exit code: 1 C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem.nim.c: In function 'showErrorMessage__system_2538': C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem.nim.c:3802:44: error: too many arguments to function '_setjmp' TM__Q5wkpxktOdTGvlSRo9bzt9aw_26.status = _setjmp(TM__Q5wkpxktOdTGvlSRo9bzt9aw_26.context, 0); ^~~~~~~ In file included from C:\Users\winrid\nimcache\@m..@s..@s..@s.choosenim@stoolchains@snim-1.6.8@slib@ssystem.nim.c:9:0: c:\mingw\include\setjmp.h:39:37: note: declared here _CRTIMP int __cdecl __MINGW_NOTHROW _setjmp (jmp_buf); ^~~~~~~ Failed to compile cPlugin() cmd: C:\Users\winrid\.choosenim\toolchains\nim-1.6.8\bin\nim.exe c --app:lib --gc:markAndSweep --out:"C:\Users\winrid\nimcache\nimterop\cPlugins\nimterop_1221099484.dll" C:\Users\winrid\nimcache\nimterop\cPlugins\nimterop_1221099484.nim [AssertionDefect]
Looks like Nim is trying to pass
NIM_NIL
as a second argument to _setjmp, which does only takes one argument: https://linux.die.net/man/3/_setjmp
This appears to be a compiler bug. I have seen something similar to this before for C interop libs and specific GC configs.
Try removing the gc you selected and try the default nim one and if that fails try ORC.
I also recommend submitting this bug to the official nim github repo.
Note - the above does not appear related to this library. Ripped out library and deleted nimcache etc. But, it was compiling before, and not after installing duckdb. Weird! I've tried setting nimcache to a different directory, not sure what else to try yet. Anyway, thanks for fixing the bug. :)
Update: well, it compiles fine on WSL... screw windows I guess. :)
WSL saves the day for windows yet again !
Hello!
Thanks for taking the time to do this and put it on GitHub!
I'm fairly new to Nim, but I was wondering how to use this library. It does not appear in Nimble for me.
As a temporary workaround I've copied the sources into my project, but it fails to compile with:
I haven't found much searching for this Error, yet. :)