===> lib/ofed/libibnetdisc (all)
===> lib/ofed/libopensm (all)
===> lib/libpcap (all)
/usr/local/libexec/ccache/world/cc -O2 -pipe -DHAVE_CONFIG_H -I/usr/src/lib/libpcap -I/usr/obj/usr/src/amd64.amd64/lib/libpcap -D_U_="__attribute__((unused))" -DHAVE_SNPRINTF -DHAVE_VSNPRINTF -DBUILDING_PCAP -DHAVE_NET_PFVAR_H -DPCAP_SUPPORT_NETMAP -DPCAP_SUPPORT_RDMASNIFF -I/usr/src/contrib/libpcap -DNDEBUG -MD -MF.depend.gencode.o -MTgencode.o -std=gnu99 -fstack-protector-strong -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Wno-parentheses -Qunused-arguments -c /usr/src/contrib/libpcap/gencode.c -o gencode.o
In file included from /usr/src/contrib/libpcap/gencode.c:77:
/usr/include/net/pfvar.h:52:10: fatal error: 'netpfil/pf/pf.h' file not found
1 error generated.
*** Error code 1
make: stopped in /usr/src/lib/libpcap
root@betsy:/usr/src # find . -name pf.h
Can you include your build command?
It was a simple 'make buildworld'
Are you building on 12.0?
Yes, it is a 12.0-RELEASE system.
This is the src.conf:
WITHOUT_CAPSICUM=YES # includes WITHOUT_CASPER
WITHOUT_CDDL=YES # includes WITHOUT_CTF WITHOUT_ZFS
WITHOUT_SOURCELESS=YES # no sourceless code in kernel, includes WITHOUT_SOURCELESS_HOST WITHOUT_SOURCELESS_UCODE
WITHOUT_TESTS=YES # includes WITHOUT_DTRACE_TESTS WITHOUT_TESTS_SUPPORT
WITHOUT_WIRELESS=YES # includes WITHOUT_WIRELESS_SUPPORT=YES
Have you previously done buildworld/installworld with these or other flags?
I can't seem to reproduce this, and I see no obvious reason why it'd happen. You're not disabling pf, so the header should be installed. And I've tested WITHOUT_PF, and that builds fine for me too.
This only happens when /usr/include/netpfil/pf/pf.h (and other *.h files) do not exist.
On 11.0-RELEASE, this is not necessary. It finds and includes /usr/src/sys/netpfil/pf/pf.h
When I change the Makefile line PCAPINCS to a modified 11.0-RELEASE version
PCAPINCS= pcap/pcap.h pcap/namedb.h pcap/bpf.h pcap/dlt.h
then building does not fail. So the bug seems to exist in Makefile.
(In reply to oz42 from comment #6)
I would not expect the build to use the installed pf.h header file, so that's odd.
Also, why would the header file not be installed?
I can't tell what you changed. Can you post a diff instead?
Sorry, my last comment is invalid, please ignore it. On another 12.0-RELEASE machine, libpcap builds just fine.
I will investigate both machines.
Up to now, I have found that a 'make delete-old'  removes all unneccesary *.h files from /usr/include. That's okay. The problem is that files in /usr/src include files from /usr/include that no longer exist.
I am no developer, but I assume the solution would be to include all *.h files from /usr/src only. E.g. /usr/src/lib/libcasper/libcasper/libcasper.h instead of the deleted /usr/include/libcasper.h
Right now, it is possible to remove some stuff from your system by putting lines like WITHOUT_ATM=YES into /etc/src.conf, the result is a more 'lightweight' system. But it is not possible to get those features back once they have been removed from the system.
 a suggestion from /usr/src/Makefile
(In reply to oz42 from comment #9)
> I assume the solution would be to include all *.h files from /usr/src only
Yes, but that's what the build already does.
I can't reproduce this build failure, even after 'make delete-old' with WITHOUT_PF=yes set.
I have proven that make buildworld includes *.h files from /usr/include.
Long story short: please install a fresh 12.0-RELEASE system and add attached src.conf and make.conf, then:
- make buildworld && make kernel (add your KERNCONF here)
- nextboot -o "-s" && reboot
- mergemaster -p
- cd /usr/src && make installworld
- yes|make delete-old
- yes|make delete-old-libs
Now you have a stripped down and happy system. But when you delete /etc/src.conf and run "make buildworld" to get back a "generic" system, building will fail.
I have tried once more. Result: another *.h file, same story:
===> bin/chio (all)
===> bin/chmod (all)
===> bin/cp (all)
===> bin/date (all)
===> bin/dd (all)
/usr/local/libexec/ccache/world/cc -O2 -pipe -DNDEBUG -MD -MF.depend.dd.o -MTdd.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Qunused-arguments -c /usr/src/bin/dd/dd.c -o dd.o
In file included from /usr/src/bin/dd/dd.c:60:
/usr/include/capsicum_helpers.h:42:10: fatal error: 'libcasper.h' file not found
1 error generated.
root@fb:~ # find /usr -name libcasper.h
=> header files from /usr/src are not included, but from /usr/include
Created attachment 201581 [details]
src.conf and make.conf
I seem to be running into different build problems then.
I honestly don't understand the use case for this, and it's not a pf-related bug, so I'm not going to investigate it any further.
You are saying: building and installing a reduced system does not install all files necessary to build a full system again -- because make buildworld
expects files from outside /usr/src when it builds and the stripped-down
system does not have all the files required ? This can be seen as a valid problem, but only if one understands *why* one would do this ?
Can you describe why you need such a process (build-install-striped-down,
use it to build-full-system) ?
I could perhaps want to enable a disabled feature again. But this is not the problem.
The point is that 'make buildworld' even bootstraps its own compiler when necessary, but still depends on files outside of /usr/src that exist in /usr/src. *.h and lib* files for example.