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

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 16

Most upvoted comments

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?

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

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

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.

@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.

@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.

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