In #32764 (moved), we need to make sure that some headers include their dependencies (or remove those dependencies), so that clang-format can re-order headers.
We should compile every header by itself, to check that it lists all its dependencies. Some headers contain conditional code, so we also need to compile with and without:
HAVE_MODULE_* (already in CI, as long as we use the defined from configure)
{INTERNAL,PRIVATE,EXPOSE} (not sure how to do this in CI, I guess we could script it using grep)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
This is a really good idea! It might be biting off more than I can chew this week, however: when I did a quick-and-dirty test here, I found that only 57% of our headers currently build on their own, even after the fixes in #32764 (moved). That leaves 177 headers to fix, which is a lot to tackle.
I think that maybe we could do this without special handling for HAVE_MODULE_*; since our CI runs with the full matrix of disable-module-foo, then we should learn about any headers where we've broken with a module turned off.
I'm going to hack on my quick-and-dirty test script a bit more, then upload it so we can iterate and improve it.
You can have a look at my script in test_headers, with PR at https://github.com/torproject/tor/pull/1616 . It probably needs significant work before it could be used in production, and (as noted) we'd need to clean up a lot of headers before we could make it a part of make check.
I think I have this script in a reviewable, production-ready state. It checks the header failures against an exceptions file, and only fails when a header unexpectedly fails.
I've left a couple of short questions on the PR. Also, CI is now failing because we don't have a declaration for ucontext_t in backtrace.c.
I'll try to think about the CFLAGS issue; at first glance I think it needs to be an environment variable. Same with CC, etc. I don't know if I'll get to actual implementation on those before I go on break, though.
Also we should stick our license statement at the head of the file.
Trac: Actualpoints: 1 to 1.3 Status: needs_review to needs_revision
I've left a couple of short questions on the PR. Also, CI is now failing because we don't have a declaration for ucontext_t in backtrace.c.
Hmm, so the ucontext header doesn't define struct ucontext_t? I don't know how to work around that?
Should we be doing a forward type declaration instead?
I'll try to think about the CFLAGS issue; at first glance I think it needs to be an environment variable. Same with CC, etc. I don't know if I'll get to actual implementation on those before I go on break, though.
I wonder if we should actually be running this test via automake? Then we'd get a lot of these things for free.
Also we should stick our license statement at the head of the file.
Ok, I pushed some fixes dealing with most of these issues. Still need to check CI across all platforms :-)
Here's the remaining work:
I'll try to think about the CFLAGS issue; at first glance I think it needs to be an environment variable. Same with CC, etc. I don't know if I'll get to actual implementation on those before I go on break, though.
I wonder if we should actually be running this test via automake? Then we'd get a lot of these things for free.