jceel / py-libzfs

Python libzfs bindings
16 stars 8 forks source link

failing to compile #16

Closed Licenser closed 7 years ago

Licenser commented 7 years ago

Bit off a odd system but I'm trying to compile libzfs on a ARM64 (RPI3) and it fails with:

cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -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-arm64-3.6/libzfs.o -DNEED_SOLARIS_BOOLEAN -D_XPG6 -g -O0
libzfs.c:705:42: error: use of undeclared identifier 'ZFS_MAX_DATASET_NAME_LEN'
  __pyx_e_6libzfs_MAX_DATASET_NAME_LEN = ZFS_MAX_DATASET_NAME_LEN
jceel commented 7 years ago

What is the exact FreeBSD version you're using? Please paste output of the following commands: uname -a and uname -K

Licenser commented 7 years ago

Hi!

root@rpi3:/usr/src # uname -a
FreeBSD rpi3 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r313109M: Thu Feb  2 16:16:39 MST 2017     raspberry@hive.raspbsd.org:/usr/home/brd/rpi3/crochet/work/obj/arm64.aarch64/usr/src/sys/GENERIC  arm64
root@rpi3:/usr/src # uname -K
1200020

is the exact one, I tried just adding a (and False) to the related IF statement but the 2nd branch doesn't seem to work either.

jceel commented 7 years ago

Can you update to the very latest CURRENT tree and see what happens? The error you're getting is due to API incompatibility - for CURRENT builds we support only latest ZFS API/ABI.

Licenser commented 7 years ago

As in compiling a new kernel? Honestly no, even fetching the /usr/src takes about 12 hours on that slow bugger I'll rather live with a hand patched version for the time being :)

jceel commented 7 years ago

Can't you cross-compile? :) Potentially, if you switch all the IF (FREEBSD_VERSION ... statements (there are 3 IIRC) to use the other branch, it should work.

jceel commented 7 years ago

Alternatively, you can patch setup.py to set FREEBSD_VERSION to 1003508

Licenser commented 7 years ago

disclaimer: I've no idea what I'm doing ;)

jceel commented 7 years ago

OK, so please do export UNAME_K=1003508 in shell before running setup.py. That should help and let you compile unmodified sources.

Licenser commented 7 years ago

oh awesome that does the trick :D I have no idea why but cool! Much appriciated ^.^

jceel commented 7 years ago

Cool! When you upgrade your -CURRENT system you will be able to build py-libzfs without that hack.