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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,19 @@ clean-target-dir:

.venv/bin/python: Makefile
rm -rf .venv

@# --copies is necessary because OS X make checks the mtime of the symlink
@# target (/usr/local/bin/python), which is always much older than the
@# Makefile, and then proceeds to unconditionally rebuild the venv.
$$RELAY_PYTHON_VERSION -m venv --copies .venv
.venv/bin/pip install -U pip wheel

@# Work around https://github.com/confluentinc/confluent-kafka-python/issues/1190
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.

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)

fi; \
.venv/bin/pip install -U -r requirements-dev.txt

.git/hooks/pre-commit:
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ workspace with multiple features, so when running building or running tests
always make sure to pass the `--all` and `--all-features` flags.
The `processing` feature additionally requires a C compiler and CMake.

To install the development environment, librdkafka must be installed and on the
path. On macOS, we require to install it with `brew install librdkafka`, as the installation script uses `brew --prefix` to determine the correct location.

We use VSCode for development. This repository contains settings files
configuring code style, linters, and useful features. When opening the project
for the first time, make sure to _install the Recommended Extensions_, as they
Expand All @@ -55,9 +58,10 @@ development:
also performed in CI.
- `make clean`: Removes all build artifacts, the virtualenv and cached files.

For a lot of tests you will need Redis and Kafka running in their respective
default configuration. `sentry devservices` from
[sentry](https://github.com/getsentry/sentry) does this for you.
Integration tests require Redis and Kafka running in their default
configuration. The most convenient way to get all required services is via
[`sentry devservices`](https://develop.sentry.dev/services/devservices/), which
requires an up-to-date Sentry development environment.

### Building and Running

Expand Down