Bug 222679 - devel/py-libzfs: Build fails on FreeBSD 12-CURRENT after r323355
Summary: devel/py-libzfs: Build fails on FreeBSD 12-CURRENT after r323355
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ben Woods
URL:
Keywords: patch, patch-ready
Depends on:
Blocks:
 
Reported: 2017-09-29 09:58 UTC by Ben Woods
Modified: 2017-10-09 17:36 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (wg)


Attachments
Patch to fix py-libzfs on FreeBSD 12-CURRENT after r323355 (3.98 KB, patch)
2017-09-29 10:13 UTC, Ben Woods
woodsb02: maintainer-approval? (wg)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Woods freebsd_committer freebsd_triage 2017-09-29 09:58:05 UTC
Building the port devel/py-libzfs on FreeBSD 12-CURRENT after r323355 fails with the following errors:

===>  Building for py36-libzfs-1.0.20170814
WARNING: '' not a valid package name; please use only .-separated package names in setup.py
running build
running build_py
running build_ext
cythoning libzfs.pyx to libzfs.c
building 'libzfs' extension
creating build
creating build/temp.freebsd-12.0-CURRENT-amd64-3.6
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/python3.6m -c libzfs.c -o build/temp.freebsd-12.0-CURRENT-amd64-3.6/libzfs.o -DNEED_SOLARIS_BOOLEAN -D_XPG6 -g -O0
libzfs.c:20069:73: warning: incompatible pointer to integer conversion passing 'PyObject *' (aka 'struct _object *') to parameter of type 'zfs_type_t' [-Wint-conversion]
  __pyx_v_handle = zfs_path_to_zhandle(__pyx_v_self->handle, __pyx_t_1, __pyx_t_2);
                                                                        ^~~~~~~~~
/usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:706:79: note: passing argument to parameter here
extern zfs_handle_t *zfs_path_to_zhandle(libzfs_handle_t *, char *, zfs_type_t);
                                                                              ^
libzfs.c:44866:71: error: too few arguments to function call, expected 3, have 2
        __pyx_v_ret = zpool_scan(__pyx_v_self->handle, POOL_SCAN_SCRUB);
                      ~~~~~~~~~~                                      ^
/usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:246:1: note: 'zpool_scan' declared here
extern int zpool_scan(zpool_handle_t *, pool_scan_func_t, pool_scrub_cmd_t);
^
libzfs.c:45061:70: error: too few arguments to function call, expected 3, have 2
        __pyx_v_ret = zpool_scan(__pyx_v_self->handle, POOL_SCAN_NONE);
                      ~~~~~~~~~~                                     ^
/usr/src/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h:246:1: note: 'zpool_scan' declared here
extern int zpool_scan(zpool_handle_t *, pool_scan_func_t, pool_scrub_cmd_t);
^


This is because the ability to pause a zpool scrub was added in r323355 which changed the libzfs API, as can be seen here:
https://svnweb.freebsd.org/base/head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h?r1=323355&r2=323354&pathrev=323355
https://svnweb.freebsd.org/base/head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h?r1=323355&r2=323354&pathrev=323355
Comment 1 Ben Woods freebsd_committer freebsd_triage 2017-09-29 10:13:11 UTC
Created attachment 186795 [details]
Patch to fix py-libzfs on FreeBSD 12-CURRENT after r323355
Comment 2 Ben Woods freebsd_committer freebsd_triage 2017-09-29 10:21:55 UTC
Note that this has been fixed upstream with a similar, but slightly different set of patches:
https://github.com/freenas/py-libzfs/commit/a7f9ad497dbcb5fda49e8434a34c0f143c560080
https://github.com/freenas/py-libzfs/commit/f2a11abf23791c9ea813d05024c5669975f0f590

Perhaps a better approach would be to update the port to the latest upstream github commit, and ensure the EXPERIMENTAL parameter is set correctly for FreeBSD 12-CURRENT systems after r323355.
Comment 3 William Grzybowski freebsd_committer freebsd_triage 2017-10-09 17:35:30 UTC
Hello,

Thanks for the patch however I have fixed it upstream and update the port version.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-10-09 17:36:01 UTC
A commit references this bug:

Author: wg
Date: Mon Oct  9 17:35:04 UTC 2017
New revision: 451627
URL: https://svnweb.freebsd.org/changeset/ports/451627

Log:
  devel/py-libzfs: fix build on HEAD

  PR:		222679

Changes:
  head/devel/py-libzfs/Makefile
  head/devel/py-libzfs/distinfo