先说结论:
是mac M1 M2芯片 是基于arm架构,当安装https://github.com/confluentinc/confluent-kafka-go
时会有如下报错。
go
1 | warning: ignoring file /opt/homebrew/lib/librdkafka.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64 |
网上搜了一下相关问题,发现有一个仍在open状态的issue,里面有解决方法,详细讨论过程可完整阅读issue
处理办法
brew install openssl zstd pkg-config librdkafka
export PKG_CONFIG_PATH="/opt/homebrew/opt/librdkafka/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig"
go build -tags dynamic
e``