Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not call timespec_get on mac #2569

Merged
merged 1 commit into from
Oct 16, 2019

Conversation

maparent
Copy link
Contributor

rdtime.h avoids use of timespec on macos in general, but it was introduced in #7ee0fdcfd . With the latest 10.15 SDK, timespec_get is gone, and the library breaks.
This is a very simple correction, there may be a better way.

dyld: lazy symbol binding failed: Symbol not found: _timespec_get
...
Expected in: /usr/lib/libSystem.B.dylib```

@Aashna-Agrawal
Copy link

Aashna-Agrawal commented Oct 13, 2019

Will it break with macOs 10.14.5 too? Also, could you provide me with the reference to #7ee0fdcfd to see the change?

@maparent
Copy link
Contributor Author

maparent commented Oct 13, 2019

It breaks in 10.14.5 if you install the latest XCode, which comes with 10.15 SDK.
I'm referring to this line which was introduced in v0.11.6. (note: this line was introduced later along the same pattern.)

@maparent maparent mentioned this pull request Oct 13, 2019
2 tasks
@Aashna-Agrawal
Copy link

Aashna-Agrawal commented Oct 13, 2019

I checked the versions of XCode on my system

On running the following commands, I got the responses as mentioned below:
$ which g++
/usr/bin/g++

$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

$ xcode-select -v
xcode-select version 2354

$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

I am guessing here that the XCode is installed for the 10.14 SDK, but the error is seen as mentioned in #2570

@maparent
Copy link
Contributor Author

Interesting. I have clang-1100.0.33.8 with XCode 11.1. Not sure that the version of xcode-select is relevant. So maybe the loss of librdkafka is older than the latest XCode, I had not been using it in some time. I saw it break while using kafkacat in homebrew. I also based my timeline on Blizzard/node-rdkafka#686

@Aashna-Agrawal
Copy link

Changed the version of Xcode to XCode10. The issue still persists.

@maparent
Copy link
Contributor Author

And did you try using my branch? (a usual configure/make/make install should do it. uninstall from homebrew first if needed.)

src/rdtime.h Outdated
@@ -195,7 +195,13 @@ static RD_INLINE void rd_timeout_init_timespec_us (struct timespec *tspec,
tspec->tv_sec = timeout_us;
tspec->tv_nsec = 0;
} else {
#if __APPLE__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unindent #... to the leftmost column

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Also changed the if to ifdef for consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also rebased.

@edenhill edenhill merged commit d12c4b1 into confluentinc:master Oct 16, 2019
@edenhill
Copy link
Contributor

Thank you!

@Aashna-Agrawal
Copy link

And did you try using my branch? (a usual configure/make/make install should do it. uninstall from homebrew first if needed.)

@maparent Yes, I did. It worked. Thanks!

@sweco-seponr
Copy link

Any ideas on when to expect a homebrew upgrade will installed this bugfixed master?

@maparent
Copy link
Contributor Author

maparent commented Oct 17, 2019

Not for me to say, but meanwhile you can brew install librdkafka --HEAD.
Edit: Note that it's unlikely brew will update until a new point release is done.

@edenhill
Copy link
Contributor

The brew package is either updated automatically or by community members, I haven't touched it in a long time.

thijsc added a commit to karafka/rdkafka-ruby that referenced this pull request Oct 30, 2019
Use 1.2.2 RC1 because the gem fails on Mac otherwise. We'll wait for
1.2.2 final before the next gem release happens.

confluentinc/librdkafka#2569
@mgunter-pivotal
Copy link

brew uninstall kafkacat
brew uninstall librdkafka
brew install librdkafka --HEAD
brew install kafkacat
#...and test to confirm it works... :-D
$kafkacat -b localhost:9094 -L
Metadata for all topics (from broker 0: localhost:9094/0):
1 brokers:
broker 0 at localhost:9094 (controller)
0 topics:

@maparent
Copy link
Contributor Author

New version with fix now in homebrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants