On Wed, Dec 13, 2023 at 08:58:06AM +0500, Muhammad Usama Anjum wrote: > On 12/13/23 7:14 AM, John Hubbard wrote: > > Oh, this sounds like it would work nicely. No more "make headers" > > required (hooray!). Instead, the new approach would be "selftests are > > allowed to include from tools/include", and then we can just start > > copying the files that we need to that location, and gradually fix up > > all the selftests. > No, this wouldn't work. Note that we have a bunch of selftests (at least arm64, hid, kvm, rseq and sgx from a quick grep) which already use and rely on the headers in tools/include. > * The selftests are applications which include default header files. The > application don't care from where the header files are picked up at compile > time. We should be able to build the application on normal system with > latest headers installed without any changes. I think there is much less interest in building out of the kernel than there is in avoiding having to handle random userspace headers... > * The header files cannot be included directly as they need to be processed > first which is done by `make headers`. Here is a diff between kernel fs.h > and processed header file to be used by applications: I guess that's another reason why the sync is done manually. There are also a bunch of files in tools/include that are just completely different implementations of things (not just uapi).