-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Fix OAuthBearer OIDC preprocessor directive when using CMake without CURL #5136
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
Open
emasab
wants to merge
3
commits into
master
Choose a base branch
from
dev_fix_oauthbearer_oidc_check
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,57 @@ | ||
#!/bin/bash | ||
#!/bin/sh | ||
set -e | ||
|
||
build_tool="$1" | ||
docker_image="$2" | ||
|
||
if [ -n "$docker_image" ]; then | ||
echo "Running in docker image: $docker_image" | ||
# Running on the host, spin up the docker builder. | ||
exec docker run -v "$PWD:/v" -w /v $docker_image ./packaging/tools/build-configurations-checks.sh $build_tool | ||
# Only reached on exec error | ||
exit $? | ||
fi | ||
|
||
if [ -z "$build_tool" ]; then | ||
# Default to using make if no build tool is specified. | ||
build_tool="make" | ||
fi | ||
|
||
if grep -q alpine /etc/os-release 2>/dev/null ; then | ||
# Alpine | ||
apk add \ | ||
bash gcc g++ make $build_tool git bsd-compat-headers | ||
fi | ||
|
||
# Clone the repo so other builds are unaffected of what we're doing | ||
# and we get a pristine build tree. | ||
git config --system --add safe.directory '/v/.git' | ||
git config --system --add safe.directory '/librdkafka/.git' | ||
git clone /v /librdkafka | ||
|
||
cd /librdkafka | ||
|
||
# Disable all flags to make sure it | ||
# compiles correctly in all cases | ||
./configure --install-deps --disable-ssl --disable-gssapi \ | ||
if [ "$build_tool" = "make" ]; then | ||
./configure --disable-ssl --disable-gssapi \ | ||
--disable-curl --disable-zlib \ | ||
--disable-zstd --disable-lz4-ext --disable-regex-ext \ | ||
--disable-c11threads --disable-syslog \ | ||
--enable-werror --enable-devel | ||
cat ./config.h | ||
else | ||
cmake -DWITH_SSL=OFF -DWITH_SASL_CYRUS=OFF \ | ||
-DWITH_CURL=OFF -DWITH_ZLIB=OFF \ | ||
-DWITH_ZSTD=OFF -DHAVE_REGEX=OFF -DWITH_C11THREADS=OFF \ | ||
-DWITH_LIBDL=OFF | ||
cat ./generated/config.h | ||
fi | ||
make -j | ||
|
||
export CI=true | ||
if [ "$build_tool" = "make" ]; then | ||
make -j -C tests run_local_quick | ||
else | ||
ctest -VV -R RdKafkaTestBrokerLessQuick --output-on-failure | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -69,6 +69,20 @@ static void do_test_plugin() { | |||||||||||||||||||||
NULL, | ||||||||||||||||||||||
}; | ||||||||||||||||||||||
|
||||||||||||||||||||||
RdKafka::Conf *conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); | ||||||||||||||||||||||
if (conf->set("plugin.library.paths", | ||||||||||||||||||||||
"interceptor_test/interceptor_test_dummy", errstr) && | ||||||||||||||||||||||
errstr.find( | ||||||||||||||||||||||
"Configuration property \"plugin.library.paths\" not supported") != | ||||||||||||||||||||||
std::string::npos) { | ||||||||||||||||||||||
delete conf; | ||||||||||||||||||||||
Test::Skip( | ||||||||||||||||||||||
"Configuration property \"plugin.library.paths\" not supported in this " | ||||||||||||||||||||||
"build\n"); | ||||||||||||||||||||||
Comment on lines
+75
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] The same error message literal is repeated twice; consider extracting it into a named constant to avoid duplication and simplify future updates.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||||
return; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
delete conf; | ||||||||||||||||||||||
|
||||||||||||||||||||||
char cwd[512], *pcwd; | ||||||||||||||||||||||
#ifdef _WIN32 | ||||||||||||||||||||||
pcwd = _getcwd(cwd, sizeof(cwd) - 1); | ||||||||||||||||||||||
|
@@ -84,7 +98,7 @@ static void do_test_plugin() { | |||||||||||||||||||||
ictest_cnt_init(&ictest.on_new, 1, 1); | ||||||||||||||||||||||
|
||||||||||||||||||||||
/* Config for intercepted client */ | ||||||||||||||||||||||
RdKafka::Conf *conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); | ||||||||||||||||||||||
conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL); | ||||||||||||||||||||||
|
||||||||||||||||||||||
for (int i = 0; config[i]; i += 2) { | ||||||||||||||||||||||
Test::Say(tostr() << "set(" << config[i] << ", " << config[i + 1] << ")\n"); | ||||||||||||||||||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than relying on the enum-to-bool conversion in
if (conf->set(...))
, explicitly compare the result toRdKafka::Conf::CONF_OK
(or the appropriate error code) to make the intent clear.Copilot uses AI. Check for mistakes.