confluentinc / confluent-kafka-go

Confluent's Apache Kafka Golang client
Apache License 2.0
4.66k stars 658 forks source link

building for linux and macos targets #523

Open shivakumarss opened 4 years ago

shivakumarss commented 4 years ago

Description

I am facing an issue while building the binaries for mac and linux os.

How to reproduce

Go Version : go version go1.14.1 darwin/amd64 Kafka Go client : Latest as of 2nd Sept 2020 go get -u gopkg.in/confluentinc/confluent-kafka-go.v1/kafka

brew install pkg-config
    Updating Homebrew...
    Warning: pkg-config 0.29.2_3 is already installed and up-to-date
    To reinstall 0.29.2_3, run `brew reinstall pkg-config`
brew install librdkafka
    Updating Homebrew...
    Warning: librdkafka 1.5.0 is already installed and up-to-date
    To reinstall 1.5.0, run `brew reinstall librdkafka`
brew list librdkafka
    /usr/local/Cellar/librdkafka/1.5.0/include/librdkafka/ (3 files)
    /usr/local/Cellar/librdkafka/1.5.0/lib/librdkafka++.1.dylib
    /usr/local/Cellar/librdkafka/1.5.0/lib/librdkafka.1.dylib
    /usr/local/Cellar/librdkafka/1.5.0/lib/pkgconfig/ (4 files)
    /usr/local/Cellar/librdkafka/1.5.0/lib/ (4 other files)
    /usr/local/Cellar/librdkafka/1.5.0/share/doc/ (6 files)

Command uses to build :

  1. Tried to build for Mac env GOOS=darwin GOARCH=amd64 go build

    No errors it was fine.

  2. env GOOS=linux GOARCH=amd64 go build

    undefined: kafka.Producer
    undefined: kafka.Message
    undefined: kafka.NewProducer
    undefined: kafka.ConfigMap

Help me on this to build for linux targets.

Thanks.

Checklist

Please provide the following information:

mapx commented 4 years ago

It's a known issue: https://github.com/confluentinc/confluent-kafka-go/issues/119 .