My bcrypt module did not compile correctly when I tested it recently as a dependency. I created a simple test project and made bcrypt a require in the nimble file. Then I ran nimble install and it said it was ok. But with my test code for bcrypt in my test.nim file, nim c test.nim gave an error that it could not find the file I used in the .compile pragma.
However, when I used nimble develop and tried again, the test program compiled fine.
The project is on github at https://github.com/runvnc/bcryptnim
This is how I am using .compile:
{.compile: "arc4random.c".}
{.compile: "blowfish.c".}
{.compile: "crypt-blowfish.c".}
{.pragma: mydll.}
proc bcrypt_gensalt(rounds: int8): cstring {.cdecl, mydll, importc: "bcrypt_gensalt".}
So originally I was getting this error:
Hint: used config file '/home/runvnc/.choosenim/toolchains/nim-0.19.0/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: test [Processing]
Hint: bcrypt [Processing]
Error: unhandled exception: cannot open: arc4random.c [IOError]
But when I cloned my repo, ran nimble install and nimble develop, then went back and tried to compile the test, it worked with no problem for some reason. Do I need to change the pragmas for newer version of nim, and if so, can I get a hint as to what is different for this type of thing? Thanks.