swift-kafka-client
swift-kafka-client copied to clipboard
Undeclared function 'RAND_priv_bytes' after switch to BoringSSL
$ sw_vers
ProductName: macOS
ProductVersion: 14.0
BuildVersion: 23A344
$ swift -v
Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Checked out main
:
commit 5dbf2fadd2ae30d4a90a1df0b8a02083727ba36a (HEAD -> main, origin/main, origin/HEAD)
Author: Felix Schlegel <[email protected]>
Date: Thu Oct 5 10:16:41 2023 +0200
Ship with BoringSSL (#135)
Pulled librdkafka
:
$ git submodule update --remote
Cloning into '/Users/axel/swift-kafka-client/Sources/Crdkafka/librdkafka'...
Submodule path 'Sources/Crdkafka/librdkafka': checked out 'be353be5f6ceaa11a95e21472e981d871ab1aaee'
Ran swift test
:
/Users/axel/swift-kafka-client/Sources/Crdkafka/librdkafka/src/rdkafka_admin.c:5481:21: error: call to undeclared function 'RAND_priv_bytes'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (RAND_priv_bytes(random_salt, sizeof(random_salt)) == 1) {
Thanks for reporting this. @axelandersson what OS are you trying to build this library on?
Thanks for reporting this. @axelandersson what OS are you trying to build this library on?
This is on Sonoma 14.0 with Xcode 15 toolchain. Swift version:
Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Ah you updated the librdkafka
version. If you don't do git submodule update --remote
then it should build fine. @felixschlegel we gotta check why it fails on the latest librdkafka
version though.
@FranzBusch anything we can do to help out here?
@FranzBusch anything we can do to help out here?
Would appreciate a PR for it. I think the solution should be as easy as doing something like this #define RAND_priv_bytes(x,sz) RAND_bytes((x),(sz))
in a C file where we shim boringssl to openssl.
https://github.com/swift-server/swift-kafka-client/pull/148
:-)