Skip to content

Commit cbdc6a7

Browse files
author
Kelsey
authored
fix: Link librdkafka dynamically for M1 (#273)
1 parent 8bc165b commit cbdc6a7

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22

33
export GO111MODULE=on
44

5+
arch = $(shell uname -p)
6+
gotags=
7+
ifeq ($(arch),arm)
8+
gotags = -tags dynamic
9+
endif
10+
511
build:
6-
go build ./...
12+
go build $(gotags) ./...
713

814
deps:
915
go mod verify
1016
go mod tidy
1117

1218
test:
13-
go test -race ./...
19+
go test -race $(gotags) ./...
1420

1521
integration-test:
1622
docker-compose -f Dockercompose.test.yml up --build --abort-on-container-exit --always-recreate-deps

README.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,24 @@
22

33
[![](https://godoc.org/github.com/netlify/netlify-commons?status.svg)](https://godoc.org/github.com/netlify/netlify-commons)
44

5-
This is a core library that will add common features for our services.
5+
This is a core library that will add common features for our services.
66

7-
> The ones that have their own right now will be migrated as needed
7+
> The ones that have their own right now will be migrated as needed
88
9-
Mostly this deals with configuring logging, messaging (rabbit && nats), and loading configuration.
9+
Mostly this deals with configuring logging, messaging (rabbit && nats), and loading configuration.
10+
11+
## Testing
12+
### Prerequisites
13+
14+
If running on Apple silicon, the `librdkafka` library will need to be linked dynamically. We may want to keep an eye on [issues](https://github.com/confluentinc/confluent-kafka-go/issues/696) in the `confluent-kakfa-go` repository for alternative approaches that we could use in the future.
15+
16+
```
17+
brew install openssl
18+
brew install librdkafka
19+
brew install pkg-config
20+
```
21+
22+
And add `PKG_CONFIG_PATH` to your `~/.bashrc` or `~/.zshrc` (as instructed by `brew info openssl`)
23+
```
24+
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@3/lib/pkgconfig"
25+
```

0 commit comments

Comments
 (0)