node-rdkafka
node-rdkafka copied to clipboard
Fails to build librdkafka 2.5 in the latest node-rdkafka 3.1.0
Environment Information
- OS [e.g. Mac, Arch, Windows 10]: Mac OS Sonoma 14.5
- Node Version [e.g. 8.2.1]: 18.19.0
- NPM Version [e.g. 5.4.2]: 10.2.3
- C++ Toolchain [e.g. Visual Studio, llvm, g++]: x-code
More specifically:
checking for C compiler from CC env... failed checking for gcc (by command)... ok checking for C++ compiler from CXX env... failed checking for C++ compiler (g++)... ok
- node-rdkafka version [e.g. 2.3.3]: 3.1.0
Steps to Reproduce
npm install [email protected]
I get the following:
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from rdkafka.c:43:
npm ERR! In file included from ./rdkafka_int.h:110:
npm ERR! ./rdkafka_op.h:696:25: error: unknown type name 'rd_kafka_broker_t'
npm ERR! rd_kafka_broker_t *rkb;
npm ERR! ^
npm ERR! 1 error generated.
3.0.1 installs just fine so I believe it has to do with the latest librdkafka update
Is that only happening on Mac? I tried updating the test runner to macos 14 in #1088 but the build & test passed. I don't have a local mac to test with so someone else may need to investigate this.
Same error here on Ubuntu 22.04, node 20.14.0, node-gyp 10.2.0
rdkafka_op.h:696:25: error: unknown type name ‘rd_kafka_broker_t’
Looks like the error comes directly from librdkafka (I opened an issue).
librdkafka maintainer confirmed v2.5.0 isn't working without OpenSSL configured, and apparently they can't release a fix now (https://github.com/confluentinc/librdkafka/issues/4793#issuecomment-2245680877)
@GaryWilber you could maybe revert librdkafka to v2.4.0 as a temporary fix, WDYT? Otherwise, what would be the other options?
Hello!
Looks like the fix on librdkafka was merged (https://github.com/confluentinc/librdkafka/commit/d72576a3aca3baed317b26395de7968af94d8273). Probably using the version 2.5.0-2 would fix the compilation problems.
Hello! Any updates on this issue? I encounter this as well.
I use this method to install without a problem:
brew install openssl
CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" npm i node-rdkafka
Mac OSX 14.6.1 node: 20.11.0 node-rdkafka: 3.1.1
this is not working on my Mac :(
I use this method to install without a problem:
brew install openssl CPPFLAGS="-I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" npm i node-rdkafkaMac OSX 14.6.1 node: 20.11.0 node-rdkafka: 3.1.1
this is not working on my Mac, the same error :(
@ricochenft what's your openssl version?
Also cannot seem to install dependencies, node-rdkafka 3.1.1 / Node 20.18 / OSX 15