-
Notifications
You must be signed in to change notification settings - Fork 136
error build src/uv.c:612:10: error: implicit declaration of function 'getrandom' #318
Comments
Which Linux distribution are you using? You are probably experiencing something similar to this: https://stackoverflow.com/questions/45237324/why-doesnt-getrandom-compile. Can you check if the solution in that topic fixes the problem for you? If yes, we can add something similar in our source. |
@SergeyDjam any update? |
Unfortunately, the news is sad. I was unable to solve the problem. The recommendation did not help. I tried a hack with |
|
We could add some logic to configure.ac that tries to compile a program like
and then define the syscall wrapper ourselves behind an ifdef if it fails. |
FWIW, if canonical/dqlite#584 goes through, you can fix this by switching to |
It seems we try to avoid blocking in raft_uv_init, and the libuv event loop isn't (necessarily?) running at that point, so I don't think we can use uv_random to do the seeding unfortunately unless we're willing to relax the first requirement. |
Given that we use That should be enough to get reasonable randomness for the election timeout, and we already have code for that, as a fallback in case |
@freeekanayaka that seems fine, I'm not itching to remove getrandom but I agree it's a little bit overkill here. |
raft 0.17.1
|
@SergeyDjam I guess you're using a glibc older than 2.25? |
rpm -qa | grep glibc |
Can't build with glibc 2.24? |
@SergeyDjam getrandom first appeared in glibc 2.25, so it's expected that you can't build libraft against glibc 2.24. We don't have an explicit policy for glibc support, and our CI covers only back to glibc 2.31, which is the version that ships in Ubuntu 20.04 (Focal Fossa, the older of the two currently-supported LTS releases). As discussed above, I think we'd be fine with a patch that removes the offending call to getrandom, but we're not treating this as a bug in libraft. |
Linux x86_64
gcc 5.5.0
libuv 1.24.0
how fix this problem?
The text was updated successfully, but these errors were encountered: