Created attachment 244968 [details] patch pf removed several outdated ioctls (see https://lists.freebsd.org/archives/freebsd-pf/2023-April/000345.html among others for details), one of which libdnet relies on. The attached patch makes it use libpfctl instead.
Will look into it tomorrow.
Kristof did not note here why he provided the port fix for this specific port. It might be good to note here and not just on the lists: The kyua test suite for FreeBSD uses net/scapy (when installed) and net/scapy in turn depends on net/libnet . This leads to net/libnet being special by its being needed for (full) kyua test suite testing of FreeBSD.
(In reply to Mark Millard from comment #2) Dumb typos of mine that happen to match another port's name, 2 examples of needing the correction: net/libnet -> net/libdnet
(In reply to Kristof Provost from comment #0) I tried the patch after also adding: # git -C /usr/ports/ diff net/libdnet diff --git a/net/libdnet/Makefile b/net/libdnet/Makefile index 63134d9f8b40..8d18411e2729 100644 --- a/net/libdnet/Makefile +++ b/net/libdnet/Makefile @@ -13,6 +13,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE USES?= autoreconf libtool +BUILD_DEPENDS= libpfctl>=0:net/libpfctl + USE_GITHUB= yes GH_ACCOUNT= 5u623l20 The poudriere-devel based build got: --- fw-pf.lo --- fw-pf.c:18:10: fatal error: 'libpfctl.h' file not found #include <libpfctl.h> ^~~~~~~~~~~~
(In reply to Mark Millard from comment #4) Not that it makes the difference, but clearly not one of my better days. Using LIB_DEPENDS for a library instead: # git -C /usr/ports/ diff net/libdnet diff --git a/net/libdnet/Makefile b/net/libdnet/Makefile index 63134d9f8b40..7379b72cd7d7 100644 --- a/net/libdnet/Makefile +++ b/net/libdnet/Makefile @@ -13,6 +13,8 @@ LICENSE_FILE= ${WRKSRC}/LICENSE USES?= autoreconf libtool +LIB_DEPENDS= libpfctl.so:net/libpfctl + USE_GITHUB= yes GH_ACCOUNT= 5u623l20
I think I messed something up with the patch, because the makefile changes (setting libdepends among others) aren’t there. I’ll update it after dinner.
Created attachment 244984 [details] patch Fixed patch.
Patched it locally with some minor changes. Will go into my tonight's build and hopefully I will commit tomorrow.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=a36ac4ec4f06a1d6a14f63972aaa1399035f55a6 commit a36ac4ec4f06a1d6a14f63972aaa1399035f55a6 Author: Kristof Provost <kp@freebsd.org> AuthorDate: 2023-09-18 06:18:57 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2023-09-19 06:24:59 +0000 net/libdnet: Use libpfctl Several old ioctl commands have been removed in 15/main, which broke compilation for this port. Rely on libpfctl instead. There are some breaking pf API changes in 14 which involves regarding the ioctl syscalls. This port is an old outdated port which explicitly used those older syscalls. This port also is dependency of net/scapy which is run in our CI for testing. So fix it with blanket approval. For more information see: https://lists.freebsd.org/archives/freebsd-pf/2023-April/000345.html PR: 273899 Approved by: portmgr (just-fix-it) Sponsored by: Rubicon Communications, LLC ("Netgate") net/libdnet/Makefile | 8 ++- net/libdnet/files/patch-src_fw-pf.c (new) | 83 +++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 2 deletions(-)
(In reply to commit-hook from comment #9) I've a poudriere build that is failing during configure for c++ . The config.log shows: configure:3978: checking whether the C++ compiler works configure:4000: c++ -O2 -pipe -mcpu=cortex-a53 -Wno-error=incompatible-function-pointer-types -g -fstack-protector-strong -fno-strict-aliasing -mcpu=cortex-a53 -mcpu=cortex-a53 -lpfctl -fstack-protector-strong conftest.cpp >&5 ld: error: unable to find library -lpfctl c++: error: linker command failed with exit code 1 (use -v to see invocation) The -mcpu's are from: # more /usr/local/etc/poudriere.d/main-CA53-make.conf CFLAGS+= -mcpu=cortex-a53 CXXFLAGS+= -mcpu=cortex-a53 CPPFLAGS+= -mcpu=cortex-a53 Note: (A) it is using the system-clang (B) the lack of anything indicating where to look for libpfctl.so (C) so the lack of finding it The build log does show: =======================<phase: lib-depends >============================ ===== env: USE_PACKAGE_DEPENDS_ONLY=1 USER=root UID=0 GID=0 ===> py39-libdnet-1.13_4 depends on shared library: libpfctl.so - not found ===> Installing existing package /packages/All/libpfctl-0.3.pkg [CA72_ZFS] Installing libpfctl-0.3... [CA72_ZFS] Extracting libpfctl-0.3: ...... done ===> py39-libdnet-1.13_4 depends on shared library: libpfctl.so - found (/usr/local/lib/libpfctl.so) ===> Returning to build of py39-libdnet-1.13_4 but also shows just: LDFLAGS=" -lpfctl -fstack-protector-strong "
(In reply to Mark Millard from comment #10) With: # git -C /usr/ports diff net/libdnet/ diff --git a/net/libdnet/Makefile b/net/libdnet/Makefile index 2004f32597ea..b979abe0a4a4 100644 --- a/net/libdnet/Makefile +++ b/net/libdnet/Makefile @@ -15,7 +15,8 @@ LIB_DEPENDS= libpfctl.so:net/libpfctl USES?= autoreconf libtool localbase -LDFLAGS+= -lpfctl +CFLAGS+= -I${LOCALBASE}/include/ +LDFLAGS+= -L${LOCALBASE}/lib -lpfctl USE_GITHUB= yes GH_ACCOUNT= 5u623l20 things are back to building net/libdnet and net/scapy . The CFLAGS was also required or the include file was not found, leading to a build failure.
(In reply to Mark Millard from comment #11) Ah damn. I missed the :ldflags while typing localbase. I will fix it shortly.
Gad. I seem to have confused net/libdnet and net/py-libdnet some yesterday and, so, been incomplete in my notes. Being explicit about paths this time for the expanded tar of the failed build in this new test of using the new update to contribute to net/scapy building: /wrkdirs/usr/ports/net/py-libdnet/work-py39/libdnet-1.13/config.log shows (targeting cortex-a72's in this example, not 53's): configure:3978: checking whether the C++ compiler works configure:4000: c++ -O2 -pipe -mcpu=cortex-a72 -Wno-error=incompatible-function-pointer-types -g -fstack-protector-strong -fno-strict-aliasing -mcpu=cortex-a72 -mcpu=cortex-a72 -lpfctl -fstack-prot ector-strong conftest.cpp >&5 ld: error: unable to find library -lpfctl c++: error: linker command failed with exit code 1 (use -v to see invocation) configure:4004: $? = 1 configure:4044: result: no So it is now net/py-libnet that blocks building scapy, again lack of indicating where to find libpfctl.so for the -lpfctl . Trying: # git -C /usr/ports/ diff net/py-libdnet/ diff --git a/net/py-libdnet/Makefile b/net/py-libdnet/Makefile index 58b553c1e3de..b193ceb1a959 100644 --- a/net/py-libdnet/Makefile +++ b/net/py-libdnet/Makefile @@ -6,7 +6,7 @@ COMMENT= Python module for libdnet LIB_DEPENDS= libdnet.so:net/libdnet -USES= autoreconf libtool python +USES= autoreconf libtool python localbase:ldflags MASTERDIR= ${.CURDIR}/../libdnet INSTALL_WRKSRC= ${WRKSRC}/python lead to net/py-libnet and net/scapy building when poudriere was told to build via: poudriere bulk -jmain-CA78C -w -C net/scapy (yet a different example cortex-*) and the builds were successful.
(In reply to Mark Millard from comment #13) Yeap I saw it today morning. I will fix it soon.
(In reply to Muhammad Moinur Rahman from comment #14) Thanks for the fixes: This time around the scapy related builds all worked after updating /usr/ports/ .