node-rdkafka icon indicating copy to clipboard operation
node-rdkafka copied to clipboard

Fails to build librdkafka 2.5 in the latest node-rdkafka 3.1.0

Open pveller opened this issue 1 year ago • 9 comments

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

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

pveller avatar Jul 17 '24 22:07 pveller

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.

GaryWilber avatar Jul 18 '24 18:07 GaryWilber

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’

juanreynolds avatar Jul 21 '24 00:07 juanreynolds

Looks like the error comes directly from librdkafka (I opened an issue).

MarcAurel avatar Jul 23 '24 13:07 MarcAurel

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?

MarcAurel avatar Jul 23 '24 18:07 MarcAurel

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.

enzo-cappa avatar Aug 07 '24 15:08 enzo-cappa

Hello! Any updates on this issue? I encounter this as well.

volodymyrwalkme avatar Sep 16 '24 14:09 volodymyrwalkme

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

ricochenft avatar Sep 26 '24 18:09 ricochenft

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-rdkafka

Mac OSX 14.6.1 node: 20.11.0 node-rdkafka: 3.1.1

this is not working on my Mac, the same error :(

volodymyrwalkme avatar Sep 27 '24 08:09 volodymyrwalkme

@ricochenft what's your openssl version?

Also cannot seem to install dependencies, node-rdkafka 3.1.1 / Node 20.18 / OSX 15

kevcodez avatar Oct 05 '24 07:10 kevcodez