nim_websitecreator icon indicating copy to clipboard operation
nim_websitecreator copied to clipboard

SYS_getrandom undefined

Open cvanelteren opened this issue 3 years ago • 3 comments

Hi, I was trying out your package and ran into some compilations issues. I had some looking around and found a related error call (here), but I am not running the mentioned kernel there (<3.17 vs 5.19.4) do you perhaps know how to solve this underlying issue?

Detail: nim 1.6.4

output
/home/casper/.cache/nim/nimwc_main_r/stdlib_sysrand.nim.c: In function 'urandomInternalImpl__stdZsysrand_17':
/home/casper/.cache/nim/nimwc_main_r/stdlib_sysrand.nim.c:61:56: error: 'SYS_getrandom' undeclared (first use in this function); did you mean 'SYS_getuid'?
   61 |                         readBytesX60gensym0_ = syscall(SYS_getrandom, ((void*) ((&dest[result]))), ((int) ((NI)(TM__sT0fWggTrXhnxQ79bl9a8nHg_2))), ((unsigned int) 0));
      |                                                        ^~~~~~~~~~~~~
      |                                                        SYS_getuid
/home/casper/.cache/nim/nimwc_main_r/stdlib_sysrand.nim.c:61:56: note: each undeclared identifier is reported only once for each function it appears in
Error: execution of an external compiler program 'gcc -c  -w -fmax-errors=3 -O3 -fno-strict-aliasing -fno-ident   -I/home/casper/.choosenim/toolchains/nim-1.6.4/lib -I/home/casper/projects/nimwc/nimwcpkg -o /home/casper/.cache/nim/nimwc_main_r/stdlib_sysrand.nim.c.o /home/casper/.cache/nim/nimwc_main_r/stdlib_sysrand.nim.c' failed with exit code: 1

cvanelteren avatar Sep 09 '22 15:09 cvanelteren

Hi @cvanelteren

That is a new one to me. Could you try adding -d:nimNoGetRandom to nimwc.nim.cfg before compiling?

ThomasTJdev avatar Sep 09 '22 15:09 ThomasTJdev

The problem is coming from this: https://github.com/ThomasTJdev/nim_websitecreator/blob/25da50c01a15338336d9a624c729f8f51c9697a0/nimwcpkg/passwords/passwords.nim

let useUrandom = urandom.open("/dev/urandom")

You could try setting that to false. That will affect the makeSalt() procedure to not using urandom.

ThomasTJdev avatar Sep 09 '22 15:09 ThomasTJdev

Unfortunately, same error when setting it to false. It seems like it is not an issue with nimwc, the error originates from the stdlib it seems.

cvanelteren avatar Sep 09 '22 16:09 cvanelteren

This automagically fixed itself, closed!

cvanelteren avatar Sep 29 '22 18:09 cvanelteren

Perfect 😃

tor. 29. sep. 2022 20.47 skrev Casper van Elteren @.***

:

This automagically fixed itself, closed!

— Reply to this email directly, view it on GitHub https://github.com/ThomasTJdev/nim_websitecreator/issues/142#issuecomment-1262680279, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAONDOHFVJNVUTVJ7W453UDWAXP43ANCNFSM6AAAAAAQIZULFI . You are receiving this because you commented.Message ID: @.***>

ThomasTJdev avatar Sep 29 '22 19:09 ThomasTJdev