node-rdkafka build/run: dyld: Symbol not found: _timespec_get

Created on 26 Sep 2019  路  16Comments  路  Source: Blizzard/node-rdkafka

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: MacOS 10.14.6
  • Node Version [e.g. 8.2.1]: 11.9.0
  • NPM Version [e.g. 5.4.2]: 6.9.0
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]: XCode Version 11.0 (11A420a)
  • node-rdkafka version [e.g. 2.3.3]: 2.7.1

Steps to Reproduce
Did an npm i as usual; we have some warnings on build:

gcc -MD -MP -I/usr/local/opt/openssl/include -I/usr/local/opt/openssl/include -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -I/usr/local/opt/openssl/include -gstrict-dwarf -O2 -fPIC -Wall -Wsign-compare -Wfloat-equal -Wpointer-arith -Wcast-align -DLIBRDKAFKA_GIT_VERSION="\"\"" -c rdkafka_queue.c -o rdkafka_queue.o
In file included from rdkafka_queue.c:29:
In file included from ./rdkafka_int.h:46:
./rdtime.h:172:17: warning: 'timespec_get' is only available on macOS 10.15 or newer [-Wunguarded-availability-new]
timespec_get(tspec, TIME_UTC);
^~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/time.h:199:5: note: 'timespec_get' has been marked as being introduced in macOS 10.15 here, but the deployment target is macOS
10.14.0
int timespec_get(struct timespec *ts, int base);
^
./rdtime.h:172:17: note: enclose 'timespec_get' in a __builtin_available check to silence this warning
timespec_get(tspec, TIME_UTC);
^~~~

1 warning generated.

Upon running the code, after node-rdkafka has been initialized I get:

dyld: lazy symbol binding failed: Symbol not found: _timespec_get
Referenced from: /Users/bela/projects/aix-next/services/stream-router/node_modules/node-rdkafka/build/deps/librdkafka.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _timespec_get
Referenced from: /Users/bela/projects/aix-next/services/stream-router/node_modules/node-rdkafka/build/deps/librdkafka.1.dylib
Expected in: /usr/lib/libSystem.B.dylib

This has not been happening in the past (about 1 month ago).
CC @edenhill

stale

Most helpful comment

Hi guys, this is merged in https://github.com/edenhill/librdkafka/releases/tag/v1.2.2-RC1.

Could you please bump librdkafka in your package?

All 16 comments

I found the issue and a workaround: XCode was automatically updated to v11, with it MacOS SDK was updated to 11.15. Reverted to XCode 10.3 and MacOS SDK 10.14, and everything just works fine

@belabartha Hi, this is a temporary solution. But to solve the problem thoroughly still need

@z0091 Yes, this is a temporary solution until it's fixed in librdkafka.

Hi guys, this is merged in https://github.com/edenhill/librdkafka/releases/tag/v1.2.2-RC1.

Could you please bump librdkafka in your package?

How would we incorporate this fix if we're using the blizzard wrapper? Would a simple download into the node_module's folder suffice?

Hi guys, this is merged in https://github.com/edenhill/librdkafka/releases/tag/v1.2.2-RC1.

Could you please bump librdkafka in your package?

@klesgidis @nahomDiscover eventually make a PR and ask review of @iradul on it. IMHO I'd not integrate librdkafka RC1 in node-rdkafka.

@belabartha in that case, do you know of any other fixes to the timespec_get issue? I can't use the workaround as I am not in control of updating/downgrading the mac/sdk version.

@nahomDiscover worst case you can use directly from the repo, or make your own package and publish it (private package eventually). If you check npm, it has many node-rdkafka packages.

According to this, librdkafka v1.2.2 is going to be released later this week

@nahomDiscover @klesgidis node-rdkafka was updated to 2.7.4 on NPM, including librdkafka 1.2.2.

@belabartha that's awesome! Thanks a lot!

@belabartha any luck with 2.7.4 ?

@iradul At the moment we're pretty close to release, so even if we switch to 2.7.4 won't upgrade MacOS SDK locally, for me it's more important the Node 12 support.

I was curious if the error you described is still on. Also both 2.7.3 and 2.7.4 support Node 12.

2.7.4 is working like a charm for us! Thank you very much for the help!
馃 馃 馃

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JaapRood picture JaapRood  路  3Comments

Rick83600 picture Rick83600  路  3Comments

codeburke picture codeburke  路  3Comments

klalafaryan picture klalafaryan  路  5Comments

meierval picture meierval  路  4Comments