Test various header files to ensure they can be included by themselves.

A number of header files in sys/* have, going back to 7th Edition Unix
in 1979, reqiured other files (like sys/types.h) to compile. Likewise
the 4BSD networking code has had prerequisites. However, going back to
around the turn of the 21st century, other systems have made them be
independently include-able (wide-spread header include protection
post-dates 7th edition Unix by maybe 3 or so years judging from USENET
source postings). Start down the path of making them all independently
include-able by creating this test that fails buildworld when they are
not.

The file 'badfiles.inc' contains a list of the currently broken files
that cannot be included w/o any prerequisites. As files are fixed, 'make
badfiles.inc' should be re-run to remove them from the list. Note: All
files that start with an underscore are considered internal and not
tested.

Please note: once a file is removed from badfiles.inc, it must pass on
all architectures. Buildworld through at least the _includes target is
needed to ensure its working (though a buildkernel should also be done
on all architectures as well).

Sponsored by:		Netflix
Reviewed by:		brooks, markj
Differential Revision:	https://reviews.freebsd.org/D32498
This commit is contained in:
Warner Losh
2021-12-14 16:55:20 -07:00
parent 56e4bee1da
commit dd55767b86
5 changed files with 409 additions and 3 deletions
+4 -3
View File
@@ -164,7 +164,8 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \
stage-packages stage-packages-kernel stage-packages-world \
create-packages-world create-packages-kernel create-packages \
update-packages packages installconfig real-packages real-update-packages \
sign-packages package-pkg print-dir test-system-compiler test-system-linker
sign-packages package-pkg print-dir test-system-compiler test-system-linker \
test-includes
# These targets require a TARGET and TARGET_ARCH be defined.
XTGTS= native-xtools native-xtools-install xdev xdev-build xdev-install \
@@ -188,8 +189,8 @@ TGTS+= ${BITGTS}
META_TGT_WHITELIST+= \
_* build32 buildfiles buildincludes buildkernel buildsoft \
buildworld everything kernel-toolchain kernel-toolchains kernel \
kernels libraries native-xtools showconfig test-system-compiler \
test-system-linker tinderbox toolchain \
kernels libraries native-xtools showconfig test-includes \
test-system-compiler test-system-linker tinderbox toolchain \
toolchains universe universe-toolchain world worlds xdev xdev-build
.ORDER: buildworld installworld