jceel / py-libzfs

Python libzfs bindings
16 stars 8 forks source link

py27-libzfs-1.0_3 from FreeBSD ports fails to build on recent -CURRENT #8

Closed mexicarne closed 8 years ago

mexicarne commented 8 years ago

Hi,

looks like something changed in FreeBSD ZFS so libzfs cannot be built on 11-CURRENT anymore:

creating build/temp.freebsd-11.0-CURRENT-amd64-2.7
cc -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -I/usr/src/cddl/lib/libumem -I/usr/src/sys/cddl/compat/opensolaris/ -I/usr/src/sys/cddl/compat/opensolaris -I/usr/src/cddl/compat/opensolaris/include -I/usr/src/cddl/compat/opensolaris/lib/libumem -I/usr/src/cddl/contrib/opensolaris/lib/libzpool/common -I/usr/src/sys/cddl/contrib/opensolaris/common/zfs -I/usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs -I/usr/src/sys/cddl/contrib/opensolaris/uts/common/sys -I/usr/src/cddl/contrib/opensolaris/head -I/usr/src/sys/cddl/contrib/opensolaris/uts/common -I/usr/src/cddl/contrib/opensolaris/lib/libnvpair -I/usr/src/cddl/contrib/opensolaris/lib/libuutil/common -I/usr/src/cddl/contrib/opensolaris/lib/libzfs/common -I/usr/src/cddl/contrib/opensolaris/lib/libzfs_core/common -I/usr/local/include/python2.7 -c libzfs.c -o build/temp.freebsd-11.0-CURRENT-amd64-2.7/libzfs.o -DNEED_SOLARIS_BOOLEAN -D_XPG6 -g -O0
libzfs.c:27394:89: error: too few arguments to function call, expected 6, have 5
  __pyx_t_2 = ((zfs_receive(__pyx_v_handle, __pyx_t_4, (&__pyx_v_flags), __pyx_t_5, NULL) != 0) != 0);
                ~~~~~~~~~~~                                                             ^
/usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:682:1: note: 'zfs_receive' declared here
extern int zfs_receive(libzfs_handle_t *, const char *, nvlist_t *,
^
1 error generated.
error: command 'cc' failed with exit status 1

It's 100% reproducible on svn revision 289655 of FreeBSD source. Would you please add some workaround for this error? Thanks.

mexicarne commented 8 years ago

Hmm. Looks like this may be resolved in d55ce40f5e098ac1fa9564623bfe28afa5c9045b. This commit changing the number of arguments to zfs_receive. So, any plans to update FreeBSD port to freshier github revision?

bapt commented 8 years ago

@williambr can you update the port?

william-gr commented 8 years ago

If I do that it will break for 10, no?

Maybe we first need a better plan to support multiple versions?

mexicarne commented 8 years ago

Not sure, I'll test on 10.2 and let you know.

bapt commented 8 years ago

No it should still work on 10 @jceel do you confirm?

mexicarne commented 8 years ago

Sadly, it doesn't work at least in 10.1 for the same zfs_receive call. So it should be called with variable arguments number conditionally.

libzfs.c:35856:96: error: too many arguments to function call, expected 5, have 6
  __pyx_t_2 = ((zfs_receive(__pyx_v_handle, __pyx_t_5, __pyx_t_6, (&__pyx_v_flags), __pyx_t_7, NULL) != 0) != 0);
                ~~~~~~~~~~~                                                                    ^~~~
/usr/include/sys/_null.h:32:14: note: expanded from macro 'NULL'
#define NULL    ((void *)0)
                ^~~~~~~~~~~
/usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:668:1: note: 'zfs_receive' declared here
extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t *,
jceel commented 8 years ago

Hmm, it works on 10.2 for me. Any ideas what value of uname -K needs to be put in conditional check? :)

william-gr commented 8 years ago

It doesn't work on 10.2 for me, same errors as @mexicarne

william-gr commented 8 years ago

Committed a fix to 10.2 and then the newer version port to freebsd.