https://pantsbuild.org/ logo
#general
Title
# general
a

aloof-appointment-30987

01/16/2023, 4:50 PM
Go error when including
confluent-kafka-go
I'm having trouble building a go module that requires
<http://github.com/confluentinc/confluent-kafka-go|github.com/confluentinc/confluent-kafka-go>
I'm using
pants_version = "2.15.0rc1"
I have a single
go.mod
file defined at the repos root. When I attempt to run the go app
Copy code
./pants run apps/go/greeter_en:greeter_en
I get the following error:
Copy code
Engine traceback:
  in `run` goal
  in Package Go binary - apps/go/greeter_en:greeter_en
  in Compile with Go - apps/go/greeter_en:go-package
  in Compile with Go - <http://optios.com/pantsbuild/example-golang/libraries/go/greeter|optios.com/pantsbuild/example-golang/libraries/go/greeter>
  in Compile with Go - <http://github.com/confluentinc/confluent-kafka-go/kafka|github.com/confluentinc/confluent-kafka-go/kafka>

ProcessExecutionFailure: Process 'Generate Go and C files from CGo files.' failed with exit code 1.
stdout:

stderr:
In file included from /private/var/folders/_d/zt8y2x055597l63bhdztp82c0000gn/T/pants-sandbox-Pjctus/gopath/pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.9.2/kafka/00version.go:24:
gopath/pkg/mod/github.com/confluentinc/confluent-kafka-go@v1.9.2/kafka/select_rdkafka.h:26:10: fatal error: 'librdkafka_vendor/rdkafka.h' file not found
#include "librdkafka_vendor/rdkafka.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I can build and run the app using go tools. from the repos root:
Copy code
go mod tidy
cd apps/go/greeter_en
go build .
./greeter_en
The attached project demonstrates the above behavior.
f

fast-nail-55400

01/16/2023, 5:22 PM
You need to be using latest 2.16 dev version.
At least dev3
a

aloof-appointment-30987

01/16/2023, 5:39 PM
thankyou. I'll try that!
That worked! Thank you @fast-nail-55400
8 Views