From: Masahiro Yamada <masahiroy@kernel.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org, David Airlie <airlied@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>,
linux-kbuild@vger.kernel.org, dri-devel@lists.freedesktop.org,
intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/5] kbuild: hdrtest: place header test files in .hdrtest subdirectories
Date: Wed, 2 Apr 2025 02:49:35 +0900 [thread overview]
Message-ID: <CAK7LNATBy2NwnZ73ihzuD+LMg44abo0JOz6RrU2saH7+Ofnz7Q@mail.gmail.com> (raw)
In-Reply-To: <20250401121830.21696-5-jani.nikula@intel.com>
On Tue, Apr 1, 2025 at 9:19 PM Jani Nikula <jani.nikula@intel.com> wrote:
>
> The header tests track whether headers have been checked using empty
> *.hdrtest files in the build tree. This pollutes the build directories,
> as the files live in the same "name space" as the real output files,
> messing with TAB completion among other things.
>
> Hide the disgusting turds by placing them in .hdrtest subdirectories.
>
> Note that it would be somewhat nicer to have the basename of the
> .hdrtest files be dot-prefixed instead of using subdirectories. However,
> it's challenging to come up with a pattern rule for that, as we can list
> headers to test in the subdirectories of $(src) too, without requiring
> Makefiles and kbuild to descend to each of them.
>
> Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
> Closes: https://lore.kernel.org/r/CAHk-=wjMrqzuUmH-mFbR_46EWEFS=bB=J7h9ABMVy56Vi81PKQ@mail.gmail.com
> Fixes: fcbb8461fd23 ("kbuild: remove header compile test")
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> ---
Linus did not mention anything bad for usr/include/.
This crap is unneeded.
NACK.
>
> Cc: linux-kbuild@vger.kernel.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: intel-xe@lists.freedesktop.org
> Cc: intel-gfx@lists.freedesktop.org
> ---
> usr/include/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/usr/include/Makefile b/usr/include/Makefile
> index e3d6b03527fe..4fb574fd3fec 100644
> --- a/usr/include/Makefile
> +++ b/usr/include/Makefile
> @@ -71,7 +71,7 @@ endif
> # asm-generic/*.h is used by asm/*.h, and should not be included directly
> no-header-test += asm-generic/%
>
> -always-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null))
> +always-y := $(patsubst $(obj)/%.h,.hdrtest/%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null))
>
> # Include the header twice to detect missing include guard.
> quiet_cmd_hdrtest = HDRTEST $<
> @@ -81,7 +81,7 @@ quiet_cmd_hdrtest = HDRTEST $<
> $(PERL) $(src)/headers_check.pl $(obj) $<; \
> touch $@
>
> -$(obj)/%.hdrtest: $(obj)/%.h FORCE
> +$(obj)/.hdrtest/%.hdrtest: $(obj)/%.h FORCE
> $(call if_changed_dep,hdrtest)
>
> # Since GNU Make 4.3, $(patsubst $(obj)/%/,%,$(wildcard $(obj)/*/)) works.
> --
> 2.39.5
>
--
Best Regards
Masahiro Yamada
next prev parent reply other threads:[~2025-04-01 17:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 12:18 [PATCH 0/5] hdrtest: hide the disgusting turds Jani Nikula
2025-04-01 12:18 ` [PATCH 1/5] drm: place header test files in .hdrtest subdirectories Jani Nikula
2025-04-01 12:18 ` [PATCH 2/5] drm/xe: " Jani Nikula
2025-04-01 12:18 ` [PATCH 3/5] drm/i915: " Jani Nikula
2025-04-01 12:18 ` [PATCH 4/5] kbuild: hdrtest: " Jani Nikula
2025-04-01 17:49 ` Masahiro Yamada [this message]
2025-04-01 12:18 ` [PATCH 5/5] drm: add config option for extra build-time checks Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK7LNATBy2NwnZ73ihzuD+LMg44abo0JOz6RrU2saH7+Ofnz7Q@mail.gmail.com \
--to=masahiroy@kernel.org \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).