Open sathishcaffeine opened 3 years ago
Facing the same issue. Any update on how to fix it?
What OS are you running the GOOS=linux go build
command on?
Cross-compilation is not supported, if you are building on OSX for Linux you will need to build it in a Linux docker container.
Actually, I am facing two different errors. OSX Environment
/Users/sreevani/go/pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.5.2/kafka/kafka.go:257:2: cannot find package
make: *** [build] Error 1
this is related to librdkafka package is not found.
CircleCI Env:
Docker Engine Version: 18.09.6
Kernel Version: Linux d626114d7ea9 4.15.0-1077-aws #81-Ubuntu SMP Wed Jun 24 16:48:15 UTC 2020 x86_64 Linux
golang:1.15
Error:
go test ./... GOARCH 386 in ./instrumentation/github.com/confluentinc/confluent-kafka-go/kafka/otelkafka
# go.opentelemetry.io/contrib/instrumentation/github.com/confluentinc/confluent-kafka-go/kafka/otelkafka
./consumer.go:28:24: undefined: kafka.ConfigMap
./consumer.go:38:2: undefined: kafka.Consumer
./consumer.go:40:14: undefined: kafka.Event
./consumer.go:45:22: undefined: kafka.Consumer
./consumer.go:54:47: undefined: kafka.Event
./consumer.go:88:35: undefined: kafka.Message
./consumer.go:128:34: undefined: kafka.Event
./consumer.go:134:47: undefined: kafka.Event
./message.go:25:7: undefined: kafka.Message
./message.go:31:29: undefined: kafka.Message
./message.go:31:29: too many errors
make: *** [Makefile:123: test-386] Error 2
The latter error looks like a cross-compilation thing, guessing that any setting of GOARCH or GOOS that doesnt match the current platform will disable CGO_ENABLED, and that's what prevents the definition of kafka.XXXX.
The former is weird, try removing the confluent-kafka-go from go/pkg/mod/github.. and try again.
The latter error looks like a cross-compilation thing, guessing that any setting of GOARCH or GOOS that doesnt match the current platform will disable CGO_ENABLED, and that's what prevents the definition of kafka.XXXX.
Thanks @edenhill
I face the same issue. I use an Alpine docker image to build on my Mac. I've tried to follow the instruction on README file but still no luck.
facing the same issue so I did a temporary solution by writing dockerfiles for kafka related images
switched do debian - it helped
Hi! We use alpine image for build, have a same problem: "undefined: kafka.****" Did you resolve it? We want use this lib, but we will be forced to use a different library, like sarama
Description
When we are trying to build our go application we are getting the below error.
Run this command
env GOOS=linux go build <path to main package file>
to see the error.1.15
currently.GOOS=linux
is causing this issue. Without setting that value everything works fine.GOOS=linux
in order to run the integration tests in docker compose without having to rebuild the whole docker container each time.How to reproduce
Checklist
Please provide the following information:
LibraryVersion()
):ConfigMap{...}
"debug": ".."
as necessary)