app-emulation/raft fails at src_configure on ZFS systems
Summary
Attempting to install LXD on a system with ZFS and Raft will fail with a sandbox error about being unable to call "zfs version"(Known zfs bug to do with delegation)
Steps to reproduce
Install LXD on a system with ZFS and Raft will fail at src_configure
What is the current bug behavior?
When attempting to install you will trigger this block from Raft's configure.ac file:
Check if zfs >= 0.8.0 is available (for direct I/O support).
AC_CHECK_PROG(have_zfs, zfs, yes) AS_IF([test x"have_zfs" = x"yes"], [AX_COMPARE_VERSION((zfs version 2>/dev/null | cut -f 2 -d - | head -1), [ge], [0.8.0], [AC_DEFINE(RAFT_HAVE_ZFS_WITH_DIRECT_IO)], []) ], [])
"zfs version" is protected and won't work with sandboxing. Error still occurs even with sandbox and userpriv being restricted
What is the expected correct behavior?
Expected behaviour is that the AX_COMPARE_VERSION will get output like this: ~ # zfs version zfs-0.8.2-r1-gentoo zfs-kmod-0.8.2-r0-gentoo
and turn "zfs-0.8.2-r1-gentoo" in "0.8.2" and see if its >= "0.8.0"
Possible fixes
Confirmed fix is to add the attached "zfs-version-fix.patch" file to the src_config function in the ebuild, this will use /sys/modules/zfs/version instead of calling "zfs version" and bypass the error completely.
This should also work if zfs is kernel-builtin as that sys key is still exported when built-in