Skip to content
This repository has been archived by the owner on Jan 7, 2022. It is now read-only.

undefined: Connect,Domain,Interface .. #35

Closed
hexfusion opened this issue Apr 27, 2018 · 8 comments
Closed

undefined: Connect,Domain,Interface .. #35

hexfusion opened this issue Apr 27, 2018 · 8 comments

Comments

@hexfusion
Copy link

ENV

  • distro: 4.16.2-2-ARCH

  • (libvirt) 4.2.0

  • go1.10.1 linux/amd64

Problem

$ go get -u github.com/libvirt/libvirt-go

$ go test -tags api github.com/libvirt/libvirt-go

 github.com/libvirt/libvirt-go
./connect_test.go:35:29: undefined: Connect
./domain_test.go:35:26: undefined: Domain
./domain_test.go:35:35: undefined: Connect
./domain_test.go:50:29: undefined: Domain
./domain_test.go:50:38: undefined: Connect
./domain_test.go:66:35: undefined: Domain
./domain_test.go:66:44: undefined: Connect
./interface_test.go:35:39: undefined: Interface
./interface_test.go:35:51: undefined: Connect
./network_test.go:51:41: undefined: Network
./network_test.go:51:41: too many errors
FAIL	github.com/libvirt/libvirt-go [build failed]

Trying to shed some light on this, andy help would be great.

ref: dmacvicar/terraform-provider-libvirt#280

@berrange
Copy link
Contributor

Those commands complete for me without any error, same go version as you, but on Fedora.

@hexfusion
Copy link
Author

hexfusion commented Apr 27, 2018

hi @berrange what version of libvirt are you running? This feels like an issue with libvirt 4.

@hexfusion
Copy link
Author

Are any automated testing suites run against the libvirt 4 API?

@berrange
Copy link
Contributor

It works with any version of libvirt i try, including 4.2.0. Perhaps suspect some rogue Go related environment variable

@berrange
Copy link
Contributor

The version of libvirt involved has no bearing on whether the interfaces or methods exist - the code is conditionally built so missing methods will simply generate a runtime error when invoked.

@hexfusion
Copy link
Author

It works with any version of libvirt i try, including 4.2.0. Perhaps suspect some rogue Go related environment variable

go env

GOARCH="amd64"
GOBIN=""
GOCACHE="off"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/samb/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build595047437=/tmp/go-build -gno-record-gcc-switches"

@berrange
Copy link
Contributor

This is suspicious:

CGO_ENABLED="0"

The Libvirt bindings use cgo.

@hexfusion
Copy link
Author

@berrange thanks a lot sir for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants