Add missing header wrappers under include/
Commit Message
With a complete set of wrapper headers, it will be possible to check
for automatically for new installed headers which lack such wrappers.
2019-02-08 Florian Weimer <fweimer@redhat.com>
Add missing header wrappers under include/.
* include/ar.h: New file.
* include/bits/mqueue2.h: Likewise.
* include/bits/stdio.h: Likewise.
* include/bits/stdio2.h: Likewise.
* include/fstab.h: Likewise.
* include/fts.h: Likewise.
* include/lastlog.h: Likewise.
* include/netinet/icmp6.h: Likewise.
* include/netinet/igmp.h: Likewise.
* include/netinet/ip6.h: Likewise.
* include/re_comp.h: Likewise.
* include/regexp.h: Likewise.
* include/sys/random.h: Likewise.
* include/sys/stropts.h: Likewise.
* include/sys/ttychars.h: Likewise.
* include/sys/vfs.h: Likewise.
* include/wait.h: Likewise.
Comments
* Florian Weimer:
> With a complete set of wrapper headers, it will be possible to check
> for automatically for new installed headers which lack such wrappers.
We also need include/rpcsvc/bootparam.h and include/rpcsvc/yp_prot.h if
we want to go into this direction.
I think we have to whitelist the .x non-headers which are installed as
if they were real C/C++ headers. Obviously, we do not need a wrapper
for them.
Are missing wrapper headers something we should test for in a generic
fashion at all?
Thanks,
Florian
On Mon, 11 Feb 2019, Florian Weimer wrote:
> Are missing wrapper headers something we should test for in a generic
> fashion at all?
There are at least three separate potential problems (where people can
make a mistake that doesn't immediately produce an obvious build or test
failure) relating to the current handling of installed headers:
(a) Missing wrappers meaning code can quietly end up using an installed
header instead of one from the build tree.
(b) Attempted sysdeps overrides in the presence of such wrappers that do
not actually work properly (the issue with overridden bits/ headers
needing to go in top-level bits/ rather than in some other directory with
a wrapper, though of course this applies to anything with a wrapper
including a particular path to an overridden file).
(c) Failing to add a new header (that's included from an installed header)
to the relevant Makefile, so it doesn't get installed and builds (possibly
only under certain conditions) with installed headers fail, though
everything works fine when building and testing glibc.
I think requiring and testing for wrapper headers is a reasonable way to
address (a) - if you test for such headers in all cases, you avoid the
fragility of the present approach where a wrapper is only needed when a
header is used outside the directory that contains it.
It would also be worth thinking separately about how to implement tests to
avoid issues (b) and (c). For example, now that testing installs glibc
into a container, that container directory could be used to examine the
full set of installed headers together to see if they have any #includes
of headers not present there (other than kernel headers, other-ABI
gnu/stubs-*.h and gnu/lib-names-*.h, etc.). (This is awkward to test for
on a per-directory basis because one installed header can include a header
that itself is installed by another directory.)
scripts/check-local-headers.sh attempts to test for something related to
(a). However, issues with it include (i) it runs before the rest of the
testsuite (it would be a more thorough test if it ran after the rest of
the testsuite so it checked for problem uses of installed headers in
testcases; it ought to be possible to fix the ordering so it does run
after the other tests again); and (ii) of course it only detects issues
that show up with the current glibc configuration, whereas your proposed
check that every installed header has a wrapper would mean more
system-specific issues get detected in a single glibc testsuite run rather
than only in a build-many-glibcs.py run.
new file mode 100644
@@ -0,0 +1 @@
+#include <misc/ar.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <rt/bits/mqueue2.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <libio/bits/stdio.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <libio/bits/stdio2.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <misc/fstab.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <io/fts.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <login/lastlog.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <inet/netinet/icmp6.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <inet/netinet/igmp.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <inet/netinet/ip6.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <posix/re_comp.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <misc/regexp.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <stdlib/sys/random.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <streams/sys/stropts.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <termios/sys/ttychars.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <io/sys/vfs.h>
new file mode 100644
@@ -0,0 +1 @@
+#include <posix/wait.h>