Skip to content

Commit 2fa88f4

Browse files
sionsmithclaude
andcommitted
Remove cyrus-sasl runtime dependency by dropping gssapi feature
The gssapi feature on rdkafka pulled in cyrus-sasl as a dynamic library dependency, causing dyld errors on macOS when cyrus-sasl wasn't installed via Homebrew. Since gssapi is only needed for Kerberos authentication, and SASL/SCRAM and SASL/PLAIN are built into librdkafka natively, this removes it from the default build. Kerberos users can opt in by building from source with the gssapi feature re-enabled — documented in docs/configuration.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7ecdd49 commit 2fa88f4

11 files changed

Lines changed: 67 additions & 82 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Install system dependencies
2222
run: |
2323
sudo apt-get update
24-
sudo apt-get install -y cmake libssl-dev libsasl2-dev pkg-config
24+
sudo apt-get install -y cmake libssl-dev pkg-config
2525
2626
- name: Install Rust toolchain
2727
uses: dtolnay/rust-toolchain@stable

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
- name: Install system dependencies
6363
run: |
6464
sudo apt-get update
65-
sudo apt-get install -y cmake libssl-dev libsasl2-dev pkg-config
65+
sudo apt-get install -y cmake libssl-dev pkg-config
6666
6767
- name: Install Rust toolchain
6868
uses: dtolnay/rust-toolchain@stable

.github/workflows/semver-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install system dependencies
1919
run: |
2020
sudo apt-get update
21-
sudo apt-get install -y cmake libssl-dev libsasl2-dev pkg-config
21+
sudo apt-get install -y cmake libssl-dev pkg-config
2222
2323
- name: Install Rust toolchain
2424
uses: dtolnay/rust-toolchain@stable

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install system dependencies
3232
run: |
3333
sudo apt-get update
34-
sudo apt-get install -y cmake libssl-dev libsasl2-dev pkg-config
34+
sudo apt-get install -y cmake libssl-dev pkg-config
3535
3636
- name: Install Rust toolchain
3737
uses: dtolnay/rust-toolchain@stable
@@ -69,7 +69,7 @@ jobs:
6969
- name: Install system dependencies
7070
run: |
7171
sudo apt-get update
72-
sudo apt-get install -y cmake libssl-dev libsasl2-dev pkg-config
72+
sudo apt-get install -y cmake libssl-dev pkg-config
7373
7474
- name: Install Rust toolchain
7575
uses: dtolnay/rust-toolchain@stable
@@ -107,7 +107,7 @@ jobs:
107107
- name: Install system dependencies
108108
run: |
109109
sudo apt-get update
110-
sudo apt-get install -y cmake libssl-dev libsasl2-dev pkg-config
110+
sudo apt-get install -y cmake libssl-dev pkg-config
111111
112112
- name: Install Rust toolchain
113113
uses: dtolnay/rust-toolchain@stable

Cargo.lock

Lines changed: 0 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rust-version = "1.75"
1616

1717
[workspace.dependencies]
1818
# Kafka
19-
rdkafka = { version = "0.38", features = ["cmake-build", "ssl", "gssapi"] }
19+
rdkafka = { version = "0.38", features = ["cmake-build", "ssl"] }
2020

2121
# Arrow ecosystem
2222
arrow = { version = "54", features = ["csv", "json", "prettyprint"] }

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ WORKDIR /build
88
RUN apt-get update && apt-get install -y \
99
cmake \
1010
libssl-dev \
11-
libsasl2-dev \
1211
pkg-config \
1312
&& rm -rf /var/lib/apt/lists/*
1413

@@ -25,7 +24,6 @@ FROM debian:bookworm-slim
2524
RUN apt-get update && apt-get install -y \
2625
ca-certificates \
2726
libssl3 \
28-
libsasl2-2 \
2927
curl \
3028
&& rm -rf /var/lib/apt/lists/*
3129

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ K2I supports multiple Iceberg catalog backends:
265265
- Rust 1.85+ (for edition 2024)
266266
- CMake
267267
- OpenSSL development libraries
268-
- SASL development libraries
268+
269+
> **Kerberos support:** If you need Kerberos (GSSAPI) authentication, add `"gssapi"` to the rdkafka features in `Cargo.toml` and install `cyrus-sasl` (`brew install cyrus-sasl` on macOS, `libsasl2-dev` on Debian/Ubuntu). See [Building with Kerberos Support](docs/configuration.md#building-with-kerberos-support) for details.
269270
270271
```bash
271272
# Clone the repository

dist-workspace.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ci = "github"
1313
installers = ["shell", "homebrew"]
1414
# Target platforms to build apps for (Rust target-triple syntax)
1515
# Note: aarch64-unknown-linux-gnu removed - requires ARM runners not available for private repos
16-
# Note: x86_64-pc-windows-msvc removed - OpenSSL and SASL dependencies are complex on Windows
16+
# Note: x86_64-pc-windows-msvc removed - OpenSSL dependencies are complex on Windows
1717
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]
1818
# Path that installers should place binaries in
1919
install-path = "CARGO_HOME"
@@ -32,11 +32,9 @@ publish-jobs = ["homebrew"]
3232
[dist.dependencies.apt]
3333
cmake = { version = "*", targets = ["x86_64-unknown-linux-gnu"] }
3434
libssl-dev = { version = "*", targets = ["x86_64-unknown-linux-gnu"] }
35-
libsasl2-dev = { version = "*", targets = ["x86_64-unknown-linux-gnu"] }
3635
pkg-config = { version = "*", targets = ["x86_64-unknown-linux-gnu"] }
3736

3837
[dist.dependencies.homebrew]
3938
cmake = { version = "*", targets = ["x86_64-apple-darwin", "aarch64-apple-darwin"] }
4039
openssl = { version = "*", targets = ["x86_64-apple-darwin", "aarch64-apple-darwin"] }
41-
cyrus-sasl = { version = "*", targets = ["x86_64-apple-darwin", "aarch64-apple-darwin"] }
4240
pkg-config = { version = "*", targets = ["x86_64-apple-darwin", "aarch64-apple-darwin"] }

docs/configuration.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ Optional section for authenticated Kafka clusters.
135135
| `SCRAM-SHA-256` | Salted challenge-response (recommended) |
136136
| `SCRAM-SHA-512` | Stronger variant of SCRAM |
137137

138+
> **Kerberos (GSSAPI):** Kerberos authentication is not included in the default build. To enable it, you must build k2i from source with the `gssapi` feature. See [Building with Kerberos Support](#building-with-kerberos-support) below.
139+
138140
---
139141

140142
## Iceberg Configuration
@@ -521,3 +523,58 @@ health_port = 8080
521523
log_level = "debug"
522524
log_format = "text"
523525
```
526+
527+
---
528+
529+
## Building with Kerberos Support
530+
531+
The default k2i binary supports SASL mechanisms `PLAIN`, `SCRAM-SHA-256`, and `SCRAM-SHA-512`. If your Kafka cluster requires **Kerberos (GSSAPI)** authentication, you need to build from source with the `gssapi` feature enabled.
532+
533+
### Prerequisites
534+
535+
Install the SASL development libraries:
536+
537+
**macOS:**
538+
```bash
539+
brew install cyrus-sasl
540+
```
541+
542+
**Debian/Ubuntu:**
543+
```bash
544+
sudo apt-get install libsasl2-dev
545+
```
546+
547+
**RHEL/Fedora:**
548+
```bash
549+
sudo dnf install cyrus-sasl-devel
550+
```
551+
552+
### Build
553+
554+
Override the rdkafka features when building:
555+
556+
```bash
557+
git clone https://github.com/osodevops/k2i.git
558+
cd k2i
559+
560+
# Edit Cargo.toml to add "gssapi" to the rdkafka features:
561+
# rdkafka = { version = "0.38", features = ["cmake-build", "ssl", "gssapi"] }
562+
563+
cargo build --release -p k2i-cli
564+
```
565+
566+
### Docker
567+
568+
To build a Docker image with Kerberos support, add `libsasl2-dev` to the builder stage and `libsasl2-2` to the runtime stage in the Dockerfile, and add `"gssapi"` to the rdkafka features in `Cargo.toml` before building.
569+
570+
### Configuration
571+
572+
Once built with Kerberos support, configure GSSAPI authentication:
573+
574+
```toml
575+
[kafka.security]
576+
protocol = "SASL_SSL"
577+
sasl_mechanism = "GSSAPI"
578+
```
579+
580+
Ensure your Kerberos keytab and `krb5.conf` are properly configured on the host.

0 commit comments

Comments
 (0)