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

Remove curl dependency and disable OAuth Bearer SASL mechanism #155

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

FranzBusch
Copy link
Contributor

Motivation

The curl dependency is just necessary for the OAuth Bearer SASL mechanism. Let's remove that configuration option for now.

Modification

Removes the curl dependency.

@@ -309,7 +309,7 @@ extension KafkaConfiguration {
}
}

public struct OAuthBearerMethod: Sendable, Hashable {
struct OAuthBearerMethod: Sendable, Hashable {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it be (formally) a breaking change if anyone uses that one for auth?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would but we haven't released a major yet so removing APIs is still possible. I would love to get the package into a state where we don't require system dependencies at all.

FranzBusch and others added 2 commits November 15, 2024 21:02
The curl dependency is just necessary for the OAuth Bearer SASL mechanism. Let's remove that configuration option for now.

Removes the curl dependency.
There's a couple more duplicated definitions.
@mimischi mimischi added the ⚠️ semver/major Breaks existing public API. label Nov 16, 2024
@mimischi
Copy link
Member

I can see that there's lots of duplicated #define statements in config.h. I don't think that's expected, is it?

These

#define ENABLE_ZLIB 1
#define ENABLE_ZSTD 1
#define ENABLE_SSL 1
#define ENABLE_GSSAPI 1
#define ENABLE_CURL 0
#define ENABLE_DEVEL 0
#define ENABLE_VALGRIND 0
#define ENABLE_REFCNT_DEBUG 0
#define ENABLE_LZ4_EXT 1
#define ENABLE_LZ4_EXT 1

are duplicated just a few lines below

#define ENABLE_ZLIB 1
#define ENABLE_ZSTD 1
#define ENABLE_SSL 1
#define ENABLE_GSSAPI 1
#define ENABLE_LZ4_EXT 1

ENABLE_LZ4_EXT is even defined three times in the above two segments. There's some more duplication further down in the file.

This took me a while. `ENABLE_CURL` and `WITH_CURL` are two different
definitions.
@mimischi
Copy link
Member

mimischi commented Nov 16, 2024

This was confusing as heck, but I've got things to build locally at least. Turns out config.h defines both ENABLE_CURL and WITH_CURL—not something my brain was willing to differentiate right now. The former is only referenced in configure.libcurl, while WITH_CURL is all over the place and appears to control the inclusion of rdkafka_sasl_oauthbearer.c?

@mimischi
Copy link
Member

Oh fun, the build is still broken on Linux

Can't get things to compile without doing this. I'm either missing some
glaringly obvious flag I need to disable, or there's an issue with the
`librdkafka` version we are using when one tries to build without
`curl`.
@@ -72,7 +78,6 @@ let package = Package(
.define("_GNU_SOURCE", to: "1"), // Fix build error for Swift 5.9 onwards
],
linkerSettings: [
.linkedLibrary("curl"),
.linkedLibrary("sasl2"),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove this here as well then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't get rid of sasl2, as that would disable the more generic SASL authentication mechanisms, like SASL/PLAIN.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay we should look into building libsassl with SwiftPM then to avoid the system dependency.

@FranzBusch FranzBusch merged commit ebfa094 into main Nov 18, 2024
23 checks passed
@FranzBusch FranzBusch deleted the fb-curl-optional branch November 18, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️ semver/major Breaks existing public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants