Created attachment 251134 [details] 1st patch
Created attachment 251135 [details] 2nd patch
should'n this change be conditionnal to openzfs version >= 2.2.4 only (or it may break current stable releases) ?
seems this is included upstream: https://github.com/truenas/py-libzfs/commit/b5ffe1f1d6097df6e2f5cc6dd3c968872ec60804
(In reply to geoffroy desvernay from comment #2) No idea which version introduced this change, or how to handle it in cpython.
Created attachment 251292 [details] patch-to-upgrade see attachment, updates the upstream -- at least it builds.
(In reply to Kurt Jaeger from comment #5) ok, only on 15, not on 14.1. So not a suitable patch 8-(
Comment on attachment 251292 [details] patch-to-upgrade does not build on other than current.
On main (-current), the API change was introduced by the commmit 783d3ff6d7fae619db8a7990b8a6387de0c677b5 dated 2024-03-30. The nearest __FreeBSD_version bump is dated on 2024-04-06 to 1500018. https://cgit.freebsd.org/src/commit/sys/contrib/openzfs/include/libzfs.h?id=783d3ff6d7fae619db8a7990b8a6387de0c677b5 https://cgit.freebsd.org/src/commit/sys/sys/param.h?id=0192eda105b367d4670205547e8e830e3716bea3 On stable/14, this change was introduced the commit 9a5f0cb5b639f8e0435103d44b17eb8a352af990 dated on 2024-05-03. The nearest __FreeBSD_version bump is dated on 2024-06-04 to 1401501. (Or, on 2024-04-20 to 1401500.) https://cgit.freebsd.org/src/commit/sys/contrib/openzfs/lib/libzfs?h=stable/14&id=9a5f0cb5b639f8e0435103d44b17eb8a352af990 So, there should be such lines in the port's Makefile: .include <bsd.port.options.mk> .if ${OPSYS} == FreeBSD && (${OSVERSION} >= 1500018 || (${OSVERSION} >= 1401501 && ${OSVERSION} < 1500000)) EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-libzfs.pyx ¥ ${PATCHDIR}/extra-patch-libzfs.h # the patch file should be generated appropriately .endif There remains a short window that the port does not build, but I do not know other methods.
(In reply to Hiroo Ono from comment #8) > There remains a short window that the port does not build, but I do not know other methods. ${GREP} ... /usr/include/libzfs.h && ${REINPLACE_CMD} ... ${WRKSRC}/.../libzfs.pyx && {REINPLACE_CMD} ... ${WRKSRC}/.../libzfs.pxd may work, but it may be overkill.
Created attachment 251549 [details] check libzfs.h using grep Check /usr/include/libzfs.h if zpool_add has the newer prototype and patch. Tested on 13.3-STABLE 1303500 77814c9599 and 14.1-STABLE 1401500 a7abf88b47.
(In reply to Hiroo Ono from comment #10) I have applied this patch locally and can confirm it works on my machine (where I had issues without this patch). I'm on FreeBSD 14.1.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=26eecc68d56b64a3299a565569809ec387fa4b19 commit 26eecc68d56b64a3299a565569809ec387fa4b19 Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2024-07-08 14:03:01 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2024-07-08 14:03:44 +0000 devel/py-libzfs: Unbreak on FreeBSD 15 by pulling a patch from upstream PR: 279450 devel/py-libzfs/Makefile | 4 +++ devel/py-libzfs/files/extra-zpool-add.patch (new) | 44 +++++++++++++++++++++++ 2 files changed, 48 insertions(+)
Missed the Approved by: freqlabs (maintainer timeout) line in the commit message.
.if ${OSVERSION} >= 1500000 is wrong. please see comment No.8.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=38cc769ee806e95985981189cd7987fd3f41db99 commit 38cc769ee806e95985981189cd7987fd3f41db99 Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2024-07-09 17:40:13 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2024-07-09 17:41:08 +0000 devel/py-libzfs: Make the OSVERSION check more accurate PR: 279450 Reported by: Hiroo Ono <hiroo.ono+freebsd@gmail.com> devel/py-libzfs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Yes, thank you. I had to adjust the 1401 case a bit, though.