arturo-lang / arturo

Simple, expressive & portable programming language for efficient scripting
http://arturo-lang.io
MIT License
673 stars 29 forks source link

Weird issue when compiling on Windows #1630

Closed drkameleon closed 1 month ago

drkameleon commented 1 month ago

Describe the bug

During the Windows CI builds we are getting a weird error regarding function signatures:

CC: vm/values/operaD:\a\arturo\arturo\.cache\@mhelpers@srepl.nim.c: In function 'completionsCback__helpersZrepl_u24':
D:\a\arturo\arturo\.cache\@mhelpers@srepl.nim.c:583:80: error: passing argument 1 of 'linenoiseAddCompletion' from incompatible pointer type [-Wincompatible-pointer-types]
  583 |                                                         linenoiseAddCompletion(lc_p1, nimToCStringConv(colontmpD__5));
      |                                                                                ^~~~~
      |                                                                                |
      |                                                                                tyObject_LinenoiseCompletions__vHTaA31a7cRxxKiWyfvAxA *
In file included from D:\a\arturo\arturo\.cache\@mhelpers@srepl.nim.c:9:
D:\a\arturo\arturo\src\extras/linenoise/linenoise.h:65:51: note: expected 'linenoiseCompletions *' but argument is of type 'tyObject_LinenoiseCompletions__vHTaA31a7cRxxKiWyfvAxA *'
   65 | void linenoiseAddCompletion(linenoiseCompletions *comp, const char *str);
      |                             ~~~~~~~~~~~~~~~~~~~~~~^~~~
D:\a\arturo\arturo\.cache\@mhelpers@srepl.nim.c: In function 'initRepl__helpersZrepl_u12':
D:\a\arturo\arturo\.cache\@mhelpers@srepl.nim.c:748:36: error: assignment to 'void (**)(const char *, tyObject_LinenoiseCompletions__vHTaA31a7cRxxKiWyfvAxA *, void *)' from incompatible pointer type 'void (*)(const char *, tyObject_LinenoiseCompletions__vHTaA31a7cRxxKiWyfvAxA *, void *)' [-Wincompatible-pointer-types]
  748 |                 completionCallback = completionsCback__helpersZrepl_u24;
      |                                    ^
D:\a\arturo\arturo\.cache\@mhelpers@srepl.nim.c:750:55: error: passing argument 1 of 'linenoiseSetCompletionCallback' from incompatible pointer type [-Wincompatible-pointer-types]
  750 |                 T15_ = linenoiseSetCompletionCallback(completionCallback, NIM_NIL);
      |                                                       ^~~~~~~~~~~~~~~~~~
      |                                                       |
      |                                                       void (**)(const char *, tyObject_LinenoiseCompletions__vHTaA31a7cRxxKiWyfvAxA *, void *)
D:\a\arturo\arturo\src\extras/linenoise/linenoise.h:59:91: note: expected 'void (*)(const char *, linenoiseCompletions *, void *)' but argument is of type 'void (**)(const char *, tyObject_LinenoiseCompletions__vHTaA31a7cRxxKiWyfvAxA *, void *)'
   59 | linenoiseCompletionCallback * linenoiseSetCompletionCallback(linenoiseCompletionCallback *comp, void *userdata);
      |                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~

Could this be a Nim bug?

@RickBarretto Could you please have a look at it? Do you have any similar issues when compiling the master branch version?

Also see: https://github.com/arturo-lang/arturo/actions/runs/9046060430/job/24888600617?pr=1629

RickBarretto commented 1 month ago

image

@drkameleon Strange... Just updated my main branch and compiled. Everything is working fine. Generally when I have this kind of error, I just recompile it again.

drkameleon commented 1 month ago

@RickBarretto That's so weird! Could you try it with Nim 2.0.4? (the CI builds use this one).

If it's not that, I simply don't get it. Either way, the CI builds keep failing consistently (but only for Windows)... 🤔

RickBarretto commented 1 month ago

@drkameleon , I think I'm using the 2.0.0, I'll update and compile it ASAP. Well, following the convention of semver, this must not occur... Strange...