Blizzard / Blizzard/node-rdkafka
[FEATURE REQUEST] Allow to pass arbitrary compilation options to librdkafka via env variables
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 403
- PR merge metrics
- No merged PRs in 30d
Description
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:
```javascript
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!
Contributor guide
Research direction
Start with util/configure.js around line 23 and inspect how the librdkafka configure process is invoked. Check how an RDKAFKA_OPTS environment variable could be passed to that invocation, then verify that the build accepts the listed options and still installs into the existing release and lib directories.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, kafka, node.js
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100