Blizzard / Blizzard/node-rdkafka

Failing to build on M1

Open
#950 4 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.2k
Forks
403
PR merge metrics
No merged PRs in 30d

Description

Trying to do an npm install of node-rdkafka.

I've brew installed openssl, librdkafka and set the env variables

LDFLAGS=-L/opt/homebrew/opt/openssl@3/lib
CPPFLAGS=-I/opt/homebrew/opt/openssl@3/include
PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@3/lib/pkgconfig

During the build, I'm seeing this problem:

ld: warning: ignoring file /opt/homebrew/Cellar/lz4/1.9.3/lib/liblz4.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/openssl@3/lib/libssl.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /opt/homebrew/opt/openssl@3/lib/libcrypto.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

So I suspect it's ignoring the crypto library, for example, and thus failing with a bunch of missing symbol errors... e.g.:

Undefined symbols for architecture x86_64:
"_BIO_ctrl", referenced from:
_rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
"_BIO_free", referenced from:
_rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
_rd_kafka_ssl_ctx_init in rdkafka_ssl.o
"_BIO_new_mem_buf", referenced from:
_rd_kafka_conf_set_ssl_cert in rdkafka_cert.o
_rd_kafka_ssl_ctx_init in rdkafka_ssl.o
"_CRYPTO_free", referenced from:
_rd_kafka_transport_ssl_cert_verify_cb in rdkafka_ssl.o
... and on and on

I'm wondering why it's trying to build for x86_64.. and indeed earlier it says

Configuration summary:
prefix /Users/gjbaxter/dev/xxx/platform/node_modules/node-rdkafka/build/deps
MKL_DISTRO osx
SOLIB_EXT .dylib
ARCH x86_64
CPU generic
...
LDFLAGS -L/opt/homebrew/opt/openssl@3/lib -L/Users/gjbaxter/dev/xxx/platform/node_modules/node-rdkafka/build/deps
CC gcc
CXX g++
CPPFLAGS -I/opt/homebrew/opt/openssl@3/include -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align

**Environment Information**
- OS [e.g. Mac, Arch, Windows 10]: Mac OSX 12.3.1
- Node Version [e.g. 8.2.1]: 12.20.1
- NPM Version [e.g. 5.4.2]: 6.14.10
- C++ Toolchain [e.g. Visual Studio, llvm, g++]: seems to be using gcc.
- node-rdkafka version [e.g. 2.3.3]: "^2.12.0"

**Steps to Reproduce**

**node-rdkafka Configuration Settings**

**Additional context**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.