Giter Club home page Giter Club logo

Comments (4)

connorkuehl avatar connorkuehl commented on August 25, 2024

What version/git SHA of libvirt are you generating against?

I'm not experiencing your specific error, but a different error after upgrading my version of c-for-go.

c-for-go cef5ec7833f3274488b3edd519f46ddfb57d5735 is the last version of c-for-go that works for me:

$ LIBVIRT_SOURCE=/home/ckuehl/src/libvirt go generate ./...
  processing libvirt.yml done.
protocol file processing
  processing src/remote/remote_protocol.x
  processing src/remote/qemu_protocol.x
$ echo $?
0

Starting at c-for-go c95ebd03aba931e7248a6011f86d822ab878d00c, this is the error I get:

$ LIBVIRT_SOURCE=/home/ckuehl/src/libvirt go generate ./...
  processing libvirt.yml ⠋[ERR] lv_source/include/libvirt/libvirt.h:34:11: include file not found: <libvirt/libvirt-common.h>
lv_source/include/libvirt/libvirt.h:35:11: include file not found: <libvirt/libvirt-host.h>
lv_source/include/libvirt/libvirt.h:36:11: include file not found: <libvirt/libvirt-domain.h>
lv_source/include/libvirt/libvirt.h:37:11: include file not found: <libvirt/libvirt-domain-checkpoint.h>
lv_source/include/libvirt/libvirt.h:38:11: include file not found: <libvirt/libvirt-domain-snapshot.h>
lv_source/include/libvirt/libvirt.h:39:11: include file not found: <libvirt/libvirt-event.h>
lv_source/include/libvirt/libvirt.h:40:11: include file not found: <libvirt/libvirt-interface.h>
lv_source/include/libvirt/libvirt.h:41:11: include file not found: <libvirt/libvirt-network.h>
lv_source/include/libvirt/libvirt.h:42:11: include file not found: <libvirt/libvirt-nodedev.h>
lv_source/include/libvirt/libvirt.h:43:11: include file not found: <libvirt/libvirt-nwfilter.h>
lv_source/include/libvirt/libvirt.h:44:11: include file not found: <libvirt/libvirt-secret.h>
lv_source/include/libvirt/libvirt.h:45:11: include file not found: <libvirt/libvirt-storage.h>
lv_source/include/libvirt/libvirt.h:46:11: include file not found: <libvirt/libvirt-stream.h>
c-for-go failed
libvirt.go:19: running "scripts/gen-consts.sh": exit status 1
protocol file processing
  processing src/remote/remote_protocol.x
  processing src/remote/qemu_protocol.x
$ echo $?
1

from go-libvirt.

maybe32 avatar maybe32 commented on August 25, 2024

Hi connorkuehl,
Thank you so much for your reply! c-for-go cef5ec7833f3274488b3edd519f46ddfb57d5735 works for me and version/git SHA of libvirt on my environment is d427102fbd690cb2f43dbf33751cc5194a5b16ce.

My working environment is below:

ubuntu:20.04
go version go1.20.1 linux/amd64
c-for-go@cef5ec7833f3274488b3edd519f46ddfb57d5735
goyacc@c6776771dde7a49828feb54fd8be11695a32b558
libvirt d427102fbd690cb2f43dbf33751cc5194a5b16ce

from go-libvirt.

maybe32 avatar maybe32 commented on August 25, 2024
$ LIBVIRT_SOURCE=/home/ckuehl/src/libvirt go generate ./...
  processing libvirt.yml ⠋[ERR] lv_source/include/libvirt/libvirt.h:34:11: include file not found: <libvirt/libvirt-common.h>
lv_source/include/libvirt/libvirt.h:35:11: include file not found: <libvirt/libvirt-host.h>
lv_source/include/libvirt/libvirt.h:36:11: include file not found: <libvirt/libvirt-domain.h>
lv_source/include/libvirt/libvirt.h:37:11: include file not found: <libvirt/libvirt-domain-checkpoint.h>
lv_source/include/libvirt/libvirt.h:38:11: include file not found: <libvirt/libvirt-domain-snapshot.h>
lv_source/include/libvirt/libvirt.h:39:11: include file not found: <libvirt/libvirt-event.h>
lv_source/include/libvirt/libvirt.h:40:11: include file not found: <libvirt/libvirt-interface.h>
lv_source/include/libvirt/libvirt.h:41:11: include file not found: <libvirt/libvirt-network.h>
lv_source/include/libvirt/libvirt.h:42:11: include file not found: <libvirt/libvirt-nodedev.h>
lv_source/include/libvirt/libvirt.h:43:11: include file not found: <libvirt/libvirt-nwfilter.h>
lv_source/include/libvirt/libvirt.h:44:11: include file not found: <libvirt/libvirt-secret.h>
lv_source/include/libvirt/libvirt.h:45:11: include file not found: <libvirt/libvirt-storage.h>
lv_source/include/libvirt/libvirt.h:46:11: include file not found: <libvirt/libvirt-stream.h>
c-for-go failed
libvirt.go:19: running "scripts/gen-consts.sh": exit status 1
protocol file processing
  processing src/remote/remote_protocol.x
  processing src/remote/qemu_protocol.x
$ echo $?
1

I also meet this error and resolve this by building libvirt and install as following:

meson setup build
ninja -C build install

from go-libvirt.

maybe32 avatar maybe32 commented on August 25, 2024

I run code generators through docker and my steps are below. Hope this can be helpful for others.

sudo docker run -it ubuntu:20.04 bash
apt-get update
apt-get install git python3 python3-pip python3-setuptools python3-wheel ninja-build libxml2-utils xsltproc libglib2.0 libgnutls28-dev libxml2-dev wget -y
pip3 install meson docutils

cd /root
git clone https://github.com/libvirt/libvirt.git
cd /root/libvirt
meson setup build
ninja -C build install

wget https://go.dev/dl/go1.20.1.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.1.linux-amd64.tar.gz
export GOPATH=/root/go
export PATH=$PATH:/root/go/bin:/usr/local/go/bin
export LIBVIRT_SOURCE=/root/libvirt/

cd /root
git clone https://github.com/digitalocean/go-libvirt.git
cd /root/go-libvirt
go install github.com/xlab/c-for-go@cef5ec7833f3274488b3edd519f46ddfb57d5735 
go install golang.org/x/tools/cmd/goyacc@c6776771dde7a49828feb54fd8be11695a32b558
go generate ./...

from go-libvirt.

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.