On 10/20/23 8:23 PM, Peter Zijlstra wrote: > On Fri, Oct 20, 2023 at 07:24:03PM +0500, Muhammad Usama Anjum wrote: > >> Please remove these. These macros would be picked up from the kernel >> headers automatically. > > As per the previous discussions, how does that work if you have O= build > directories? Then headers should be prepared in that O= directory first. make headers O=abc && make -C tools/testing/selftests O=abc > > I find this push to force people to do 'make headers' in order to use > simple selftests quite misguided. You're making it *harder* to use, > leading to less use. I'm just following what we have been doing over selftests mailing list to fix build issues in different use cases and kselfest.rst. Let me share the history: Around 2 years ago, selftest Makefile used to prepare kernel headers from source automatically and include them to build selftests. It had several bugs. So they separated the header preparation from selftest build. After a while people started getting build failures because they weren't building headers which were previously built automatically. So someone had written a patch (already in v6.6-rc6) to show informative error if headers aren't present. So now selftests can't be built until headers are built. The understanding here is that selftests come with kernel source and they should be built using in-source kernel headers as people don't always have updated headers. I think, if someone want to build just one selftest without doing make headers, he should install kernel headers from source before doing so instead of adding duplicate defines in the test itself. It helps while development to not to keep the duplicate copy of these macros in selftest as well. -- BR, Muhammad Usama Anjum