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

[FEATURE REQUEST] Allow to pass arbitrary compilation options to librdkafka via env variables #1077

Open
enzo-cappa opened this issue Apr 24, 2024 · 0 comments

Comments

@enzo-cappa
Copy link

Hello! I would like to propose adding support for a new configuration via env variables.

What

Add option to pass configuration options to the build process of librdkafka, so it's possible to pass arbitrary configurations to the build process.

Why

The compiled libraries fail in some scenarios when using the default configuration for librdkafka. In our case it was on Ubuntu FIPS environments. The only method we found to make it work is to add the configurations:

--disable-lz4-ext --enable-static --disable-gssapi

to the configure process call in util/configure.js. It's not easy to apply the change in our build scripts, the options we have right now are:

  • Building librkafka manually
  • Creating a fork of node-rdkafka with the new defaults
  • Patch the library when using it, and rebuild binaries

All of them are quite complex.

What it would look like

I suggest support an env variable, adding something like the following code to util/configure.js around line 23:

  let opts = process.env["RDKAFKA_OPTS"];
  childProcess.execSync(`./configure ${opts} --prefix=${releaseDir} --libdir=${releaseDir}`, {

Which will allow us to pass the options in the RDKAFKA_OPTS env var.

I can create a PR if this is something you would support.

Thanks!

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

No branches or pull requests

1 participant