Giter Club home page Giter Club logo

Comments (11)

edenhill avatar edenhill commented on May 12, 2024 4

Are you attempting to cross-compile it on osx?
That's not currently supported, I suggest you build it on a linux machine.

from confluent-kafka-go.

mcandre avatar mcandre commented on May 12, 2024

Poop, debian jesse only has librdkafka-dev 0.8.5-2, but we need 0.9.2+.

from confluent-kafka-go.

edenhill avatar edenhill commented on May 12, 2024

You sure do!

from confluent-kafka-go.

mcandre avatar mcandre commented on May 12, 2024

Hmm, with librdkafka-0.9.3 and a Docker environment, go build says:

# export GOOS=linux
# export GOARCH=amd64
# go build
# github.datapipe.net/platform/brushpass/vendor/github.com/confluentinc/confluent-kafka-go/kafka
../../vendor/github.com/confluentinc/confluent-kafka-go/kafka/producer.go: In function 'do_produce':
../../vendor/github.com/confluentinc/confluent-kafka-go/kafka/producer.go:46:9: error: 'RD_KAFKA_V_END' undeclared (first use in this function)
         RD_KAFKA_V_END);
         ^
../../vendor/github.com/confluentinc/confluent-kafka-go/kafka/producer.go:46:9: note: each undeclared identifier is reported only once for each function it appears in

# dpkg --list librdkafka-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                    Version                  Architecture             Description
+++-=======================================-========================-========================-===================================================================================
ii  librdkafka-dev:amd64                    0.9.3-1                  amd64                    library implementing the Apache Kafka protocol (development headers)

Is there a possibility that librdkafka 0.9.3 breaks kafka-go?

from confluent-kafka-go.

edenhill avatar edenhill commented on May 12, 2024

That was an error in the Go client that was fixed recently:
80d7f30

Upgrade the client to latest master and it should work

from confluent-kafka-go.

mcandre avatar mcandre commented on May 12, 2024

Cheers, that patch is helpful.

Which git ref should we use to obtain librdkafka source, since v0.9.4 isn't tagged yet?

from confluent-kafka-go.

edenhill avatar edenhill commented on May 12, 2024

If you want a stable release you'll need to wait for 0.9.4 (probably within a month), otherwise be brave and use master (for development, PoC)

from confluent-kafka-go.

mcandre avatar mcandre commented on May 12, 2024

Note: Docker users can cross-compile to Linux by mounting source directory into a container, installing librdkafka-dev and Go, and compiling with go build --ldflags '-extldflags "-static"'. This produces a Linux binary in the host directory, like ./cmd/<app>/<app>. Or simply go build, if dynamic linking is okay for some project.

Mac cGo binaries could theoretically be cross-compiled from non-Mac hosts by a Darwin virtual machine, though no idea what installing gcc / Xcode is like for Darwin.

If someone could produce a minimal Windows Vagrant box, that would help to make build bots.

Finally, if one day confluent-kafka-go replaced librdkafka with pure Go code, then cross-compilation would be as easy as tweaking the GOOS, GOARCH environment variables.

from confluent-kafka-go.

edenhill avatar edenhill commented on May 12, 2024

@mcandre Does this mean that go build -tags static didn't work for you?

from confluent-kafka-go.

mcandre avatar mcandre commented on May 12, 2024

@edenhill go build can't target GOOS=linux from a Mac host when C dependencies are involved.

from confluent-kafka-go.

surendrabaid avatar surendrabaid commented on May 12, 2024

I'm facing same problem now.

skbaid$ make release OS=linux ARCH=amd64 VERSION=2.00.18
GOPATH=/Users/skbaid/GoglandProjects/abc-service-adapter GOARCH="amd64" GOOS="linux"
go build -ldflags "-w -s -X main.Version=2.00.18 -X main.Name=abc-service-adapter" -o bin/abc-service-adapter src/abc/main.go
go build github.com/confluentinc/confluent-kafka-go/kafka: build constraints exclude all Go files in /Users/skbaid/GoglandProjects/abc-service-adapter/src/github.com/confluentinc/confluent-kafka-go/kafka
make: *** [release] Error 1

has anyone found solution for this ?

from confluent-kafka-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.