lxc / go-lxc

Go bindings for liblxc
https://linuxcontainers.org/lxc
Other
430 stars 76 forks source link

Fix compilation with lxc >= 4.0.9 #154

Closed r10r closed 3 years ago

r10r commented 3 years ago

Hi @stgraber

I noticed that the groups option to keep additional group ID was merged into lxc 4.0.9 which is awesome! This updates the version check or compilation will fail.

# gopkg.in/lxc/go-lxc.v2
In file included from /go/pkg/mod/gopkg.in/lxc/go-lxc.v2@v2.0.0-20210205143421-c4b883be4881/container.go:11:
./lxc-binding.h:50:16: error: redefinition of 'struct lxc_groups_t'
 typedef struct lxc_groups_t {
                ^~~~~~~~~~~~
In file included from /usr/local/include/lxc/lxccontainer.h:12,
                 from /go/pkg/mod/gopkg.in/lxc/go-lxc.v2@v2.0.0-20210205143421-c4b883be4881/container.go:9:
/usr/local/include/lxc/attach_options.h:80:16: note: originally defined here
 typedef struct lxc_groups_t {
                ^~~~~~~~~~~~
In file included from /go/pkg/mod/gopkg.in/lxc/go-lxc.v2@v2.0.0-20210205143421-c4b883be4881/container.go:11:
./lxc-binding.h:53:3: error: conflicting types for 'lxc_groups_t'
 } lxc_groups_t;
   ^~~~~~~~~~~~
In file included from /usr/local/include/lxc/lxccontainer.h:12,
                 from /go/pkg/mod/gopkg.in/lxc/go-lxc.v2@v2.0.0-20210205143421-c4b883be4881/container.go:9:
/usr/local/include/lxc/attach_options.h:83:3: note: previous declaration of 'lxc_groups_t' was here
 } lxc_groups_t;
   ^~~~~~~~~~~~