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

Automatically generate bindings + upgrade to v1.0.0 #119

Merged
merged 4 commits into from
Apr 25, 2019

Conversation

benesch
Copy link
Collaborator

@benesch benesch commented Apr 23, 2019

This is a slimmed-down version of #117 that doesn't included unmerged librdkafka patches. Should be ready for review! 🎉

@benesch
Copy link
Collaborator Author

benesch commented Apr 23, 2019

Ok, I think I tracked down the source of the Linux failures. The problem was the --enable-static flag, which actively hinders static compilation. The tl;dr is that --enable-static is meant for when you want a shared librdkafka.so that statically links libz/liblz, but that's a very unusual thing to do, and requires a libz.a that's been compiled with -fPIC, which is not true of the libz.a that ships with Ubuntu/CentOS/probably most Linux distributions. If you just want a plan ol' static librdkafka.a, like we do, the correct thing to do is to omit --enable-static.

@benesch benesch mentioned this pull request Apr 23, 2019
benesch added 4 commits April 23, 2019 14:08
Automatically generate bindings at build time for the target.  This
means the maintainers do not need to be regenerated on three separate
platforms whenever librdkafka is bumped, which is particularly nice
considering that FreeBSD machines are not easily available to the
maintainers.

The downside is that users are required to have libclang installed at
build time in order to run bindgen.
The --enable-static flag is a bit of a misnomer. It doesn't tell
librdkafka to build static libraries; rather, it tells librdkafka to
attempt to statically link liblz4, libz, et al. into the *shared*
librdkafka. This, unsurprisingly, often goes wrong.

Just drop the --enable-static flag. We'll still get a librdkafka.a that
we can link against, and we'll let cargo link in liblz4, libz, et al.
v1.0.2 is old enough that it's no longer available from the standard
Apache mirrors.
This was referenced Apr 23, 2019
@flavray
Copy link
Collaborator

flavray commented Apr 25, 2019

Great investigation on the linux build failure :)

@flavray flavray merged commit d9321f2 into fede1024:master Apr 25, 2019
@benesch benesch deleted the auto-bindgen branch April 25, 2019 17:30
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.

2 participants