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

fix(test): Find librdkafka on Apple M1 #1204

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

jan-auer
Copy link
Member

@jan-auer jan-auer commented Mar 7, 2022

Uses brew --prefix to locate librdkafka on macOS ARM builds. The homebrew
location differs on ARM and puts libraries in a non-standard location. There is
a similar workaround in the sentry development environment, except that it
writes exports to the zshrc / bashrc files.

See confluentinc/confluent-kafka-python#1190

As part of this change, I've also updated the README to list librdkafka as
development dependency and upgrade pip and wheel during the venv setup
process.

#skip-changelog

@jan-auer jan-auer requested a review from a team March 7, 2022 08:39
@jan-auer jan-auer merged commit 96efab3 into master Mar 7, 2022
@jan-auer jan-auer deleted the fix/apple-m1-confluent-kafka branch March 7, 2022 09:36
if [ "$$(uname -sm)" = "Darwin arm64" ]; then \
echo "Using 'librdkafka' from homebrew to build confluent-kafka"; \
export C_INCLUDE_PATH="$$(brew --prefix librdkafka)/include"; \
export LIBRARY_PATH="$$(brew --prefix librdkafka)/lib"; \
Copy link
Member

Choose a reason for hiding this comment

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

In my original PR I only needed CPATH.

It seems you used this solution:
confluentinc/confluent-kafka-python#1190 (comment)

Did you happen to find out why CPATH was not good enough? (Just out of curiosity; no need to research it if it's unknown)

if [ "$$(uname -sm)" = "Darwin arm64" ]; then \
echo "Using 'librdkafka' from homebrew to build confluent-kafka"; \
export C_INCLUDE_PATH="$$(brew --prefix librdkafka)/include"; \
export LIBRARY_PATH="$$(brew --prefix librdkafka)/lib"; \
Copy link
Member

Choose a reason for hiding this comment

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

In my original PR I only needed CPATH.

It seems you used this solution:
confluentinc/confluent-kafka-python#1190 (comment)

Did you happen to find out why CPATH was not good enough? (Just out of curiosity; no need to research it if it's unknown)

Copy link
Member Author

Choose a reason for hiding this comment

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

I never tried without, and you're right, it works with just the include path. Simplified in #1206.

jan-auer added a commit that referenced this pull request Mar 9, 2022
* master:
  ref(make): Simplify M1 exports in Makefile (#1206)
  fix(metrics): Wait for project states during aggregator shutdown (#1205)
  fix(test): Find librdkafka on Apple M1 (#1204)
  build: Bump sentry-relay in dev dependencies to 0.8.9 (#1202)
  ref(metrics): Tag backdated bucket creations in statsd (#1200)
  feat(metrics): Extract user satisfaction as tag (#1197)
  fix(statsd): Add new metric_type tag to existing metrics (#1199)
  fix: Apply clippy 1.59 suggestions (#1198)
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

Successfully merging this pull request may close these issues.

3 participants