Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@akkornel
Created November 2, 2018 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akkornel/0b2dd3ba3066706146d9c3c8b5a45e82 to your computer and use it in GitHub Desktop.
Save akkornel/0b2dd3ba3066706146d9c3c8b5a45e82 to your computer and use it in GitHub Desktop.
Errors and warnings when trying to build py-libzfs on Linux
$ make clean ; PYTHON=`which python` CFLAGS='-I/usr/include/libzfs -I/usr/src/zfs-0.7.11/include -I/usr/include/libspl' make
rm -rf build libzfs.c
/usr/bin/python setup.py build
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
/home/akkornel/.local/lib/python2.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: ./pxd/libzfs.pxd
tree = Parsing.p_module(s, pxd, full_module_name)
warning: ./pxd/nvpair.pxd:75:2: 'DATA_TYPE_UINT8_ARRAY' redeclared
building 'libzfs' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/usr/include/libzfs -I/usr/src/zfs-0.7.11/include -I/usr/include/libspl -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/include/python2.7 -c libzfs.c -o build/temp.linux-x86_64-2.7/libzfs.o -DNEED_SOLARIS_BOOLEAN -D_XPG6 -g
libzfs.c:807:0: warning: "likely" redefined [enabled by default]
#define likely(x) __builtin_expect(!!(x), 1)
^
In file included from /usr/include/libzfs/sys/dmu.h:44:0,
from /usr/src/zfs-0.7.11/include/sys/zfs_ioctl.h:32,
from libzfs.c:613:
/usr/include/libzfs/sys/zfs_context.h:131:0: note: this is the location of the previous definition
#define likely(x) __builtin_expect((x), 1)
^
libzfs.c: In function ‘__pyx_f_6libzfs_3ZFS___iterate_props’:
libzfs.c:15214:5: error: too few arguments to function ‘zfs_prop_valid_for_type’
__pyx_t_1 = ((!(zfs_prop_valid_for_type(__pyx_v_proptype, __pyx_v_iter->type) != 0)) != 0);
^
In file included from libzfs.c:612:0:
/usr/include/libzfs/sys/fs/zfs.h:292:11: note: declared here
boolean_t zfs_prop_valid_for_type(int, zfs_type_t, boolean_t);
^
libzfs.c: In function ‘__pyx_pf_6libzfs_3ZFS_27get_dataset_by_path’:
libzfs.c:20143:3: error: incompatible type for argument 3 of ‘zfs_path_to_zhandle’
__pyx_v_handle = zfs_path_to_zhandle(__pyx_v_self->handle, __pyx_t_1, __pyx_t_2);
^
In file included from libzfs.c:617:0:
/usr/include/libzfs/libzfs.h:743:22: note: expected ‘zfs_type_t’ but argument is of type ‘struct PyObject *’
extern zfs_handle_t *zfs_path_to_zhandle(libzfs_handle_t *, char *, zfs_type_t);
^
libzfs.c: In function ‘__pyx_pf_6libzfs_7ZFSPool_20start_scrub’:
libzfs.c:45309:9: error: too few arguments to function ‘zpool_scan’
__pyx_v_ret = zpool_scan(__pyx_v_self->handle, POOL_SCAN_SCRUB);
^
In file included from libzfs.c:617:0:
/usr/include/libzfs/libzfs.h:265:12: note: declared here
extern int zpool_scan(zpool_handle_t *, pool_scan_func_t, pool_scrub_cmd_t);
^
libzfs.c: In function ‘__pyx_pf_6libzfs_7ZFSPool_22stop_scrub’:
libzfs.c:45504:9: error: too few arguments to function ‘zpool_scan’
__pyx_v_ret = zpool_scan(__pyx_v_self->handle, POOL_SCAN_NONE);
^
In file included from libzfs.c:617:0:
/usr/include/libzfs/libzfs.h:265:12: note: declared here
extern int zpool_scan(zpool_handle_t *, pool_scan_func_t, pool_scrub_cmd_t);
^
libzfs.c: In function ‘__pyx_pf_6libzfs_9ZFSObject_10rename’:
libzfs.c:50777:3: error: unknown type name ‘renameflags_t’
renameflags_t __pyx_v_flags;
^
libzfs.c:50812:16: error: request for member ‘recurse’ in something not a structure or union
__pyx_v_flags.recurse = __pyx_t_2;
^
libzfs.c:50822:16: error: request for member ‘nounmount’ in something not a structure or union
__pyx_v_flags.nounmount = __pyx_t_2;
^
libzfs.c:50832:16: error: request for member ‘forceunmount’ in something not a structure or union
__pyx_v_flags.forceunmount = __pyx_t_2;
^
libzfs.c:50856:9: error: incompatible type for argument 3 of ‘zfs_rename’
__pyx_v_ret = zfs_rename(__pyx_v_self->handle, NULL, __pyx_v_c_new_name, __pyx_v_flags);
^
In file included from libzfs.c:617:0:
/usr/include/libzfs/libzfs.h:623:12: note: expected ‘boolean_t’ but argument is of type ‘const char *’
extern int zfs_rename(zfs_handle_t *, const char *, boolean_t, boolean_t);
^
libzfs.c: In function ‘__pyx_pf_6libzfs_9ZFSObject_14get_send_space’:
libzfs.c:51429:9: error: incompatible type for argument 3 of ‘lzc_send_space’
__pyx_v_ret = lzc_send_space(__pyx_v_c_name, __pyx_v_cfromname, __pyx_int_0, (&__pyx_v_space));
^
In file included from libzfs.c:616:0:
/usr/include/libzfs/libzfs_core.h:75:5: note: expected ‘enum lzc_send_flags’ but argument is of type ‘struct PyObject *’
int lzc_send_space(const char *, const char *, enum lzc_send_flags, uint64_t *);
^
libzfs.c: In function ‘__pyx_pf_6libzfs_10ZFSDataset_2destroy_snapshot’:
libzfs.c:54514:9: warning: passing argument 2 of ‘zfs_destroy_snaps’ discards ‘const’ qualifier from pointer target type [enabled by default]
__pyx_v_ret = zfs_destroy_snaps(__pyx_v_self->__pyx_base.handle, __pyx_v_c_name, 1);
^
In file included from libzfs.c:617:0:
/usr/include/libzfs/libzfs.h:616:12: note: expected ‘char *’ but argument is of type ‘const char *’
extern int zfs_destroy_snaps(zfs_handle_t *, char *, boolean_t);
^
libzfs.c: In function ‘__pyx_pf_6libzfs_12read_label’:
libzfs.c:62607:3: error: too few arguments to function ‘zpool_read_label’
__pyx_v_ret = zpool_read_label(__pyx_t_5, (&__pyx_v_handle));
^
In file included from libzfs.c:617:0:
/usr/include/libzfs/libzfs.h:842:12: note: declared here
extern int zpool_read_label(int, nvlist_t **, int *);
^
libzfs.c: In function ‘initlibzfs’:
libzfs.c:77067:43: error: ‘VDEV_AUX_ASHIFT_TOO_BIG’ undeclared (first use in this function)
__pyx_t_1 = __Pyx_PyInt_From_vdev_aux_t(VDEV_AUX_ASHIFT_TOO_BIG); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 170, __pyx_L1_error)
^
libzfs.c:77067:43: note: each undeclared identifier is reported only once for each function it appears in
libzfs.c:77598:47: error: ‘ZPOOL_STATUS_NON_NATIVE_ASHIFT’ undeclared (first use in this function)
__pyx_t_1 = __Pyx_PyInt_From_zpool_status_t(ZPOOL_STATUS_NON_NATIVE_ASHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 214, __pyx_L1_error)
^
error: command 'gcc' failed with exit status 1
make: *** [build] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment