GithubHelp home page GithubHelp logo

Comments (9)

fede1024 avatar fede1024 commented on August 12, 2024 1

I made a new branch, dyn_lib, that will check whether the right version of librdkafka is installed and if that's the case will link it dynamically. I've tested on my ubuntu machine and it seems to work.

Please let me know if it works on yours as well.

from rust-rdkafka.

fede1024 avatar fede1024 commented on August 12, 2024

It bundles librdkafka 0.9.5, as stated in the readme. The git commands are actually fairly common in other libraries as well (see libgit2-sys for example), and the SHA is defined by the git submodule, currently pinned to 0d540ab4e78a3e36.

It's common for other Rust wrappers to check if the C library is installed on the system first, and compile from sources if that's not the case. However in case of librdkafka is unlikely to be already installed on the system, and to have the latest version (the one we normally target).

I can give it a try on Arch and see if there are ways to make it work. Suggestions are welcome! :)

from rust-rdkafka.

lilydjwg avatar lilydjwg commented on August 12, 2024

I'll appreciate if you check my system first, or use a feature. It's likely to be there where people develop kafka tools.

I dug a little further, and found that it's the build script of rdkafka that requires static lz4 no matter what. (Fortunately it doesn't require static openssl things as I though previously.) It's strange that the AUR package builds fine for me (and link to dynamic lz4).

FYI, replacing lz4 with a custom build is dangerous for Arch users because systemd stuff (among a lot others) depends on it, and it's known to break compatibility without bumping soname version (so when it breaks you won't know by checking statically).

from rust-rdkafka.

lilydjwg avatar lilydjwg commented on August 12, 2024

The branch works well on my Arch.

from rust-rdkafka.

fbernier avatar fbernier commented on August 12, 2024

I also use Arch and was experiencing the same issue. I tried the dyn_lib branch with success.

Unfortunately, when specifying rust-rdkafka as a dependency in a project pointing to the git repo and using the dyn_lib branch, it still tried to compile and fails.

I'm still trying to figure out why.

from rust-rdkafka.

fbernier avatar fbernier commented on August 12, 2024

The error I was getting was this one, and using the env variable described here fixed it: https://github.com/alexcrichton/pkg-config-rs/blob/3cf9b12d06b2991cb3af2218d413539b0f62b2a7/src/lib.rs#L144

from rust-rdkafka.

fede1024 avatar fede1024 commented on August 12, 2024

Thanks! Do you think there is anything we can add to the documentation for the next person that will run into the same issue? Or maybe in the build code?

from rust-rdkafka.

fede1024 avatar fede1024 commented on August 12, 2024

The dyn_lib branch has been merged to master.

from rust-rdkafka.

fbernier avatar fbernier commented on August 12, 2024

@fede1024 I don't think anything more should be changed in the code, but I don't fully understand this pkg-config cross compilation thing so I can't recommend something yet.

Thanks for the work on this PR.

from rust-rdkafka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.