mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Vlad Poenaru <vlad.wing@gmail.com>
Cc: "Nicolas Schier" <nsc@kernel.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	regressions@lists.linux.dev,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [PATCH] kbuild: don't delete in-flight filechk temporaries in asm-headers
Date: Wed, 2 Sep 2026 23:45:44 -0700	[thread overview]
Message-ID: <20260903064544.GA1942038@ax162> (raw)
In-Reply-To: <20260902161347.4163577-1-vlad.wing@gmail.com>

On Wed, Sep 02, 2026 at 09:13:47AM -0700, Vlad Poenaru wrote:
> Commit 2d69b891e646 ("kbuild: Support generated asm-headers in
> subdirectories") switched the stale-wrapper sweep in
> scripts/Makefile.asm-headers from $(wildcard $(obj)/*.h) to a find(1)
> invocation, so that generated headers in subdirectories are considered.
> 
> The two do not match the same set of files. Make's $(wildcard) uses glob
> semantics, where a leading '.' has to be matched explicitly, whereas
> find's -name uses fnmatch() without FNM_PERIOD, so '*.h' matches
> dotfiles as well. filechk writes its output to $(dir $@).tmp_$(notdir $@)
> before renaming it into place, so such a scratch file, if it happens to
> exist in $(obj) when the sub-make is parsed, is now picked up in
> old-headers. It appears in neither generic-y, generated-y nor syscall-y,
> is therefore classified as unwanted, and cmd_remove deletes it.
> 
> On x86 this races with archprepare, which lists both asm-generic and
> arch/x86/include/generated/asm/cpufeaturemasks.h as prerequisites. Under
> -j they run concurrently against the same directory, and the build fails
> intermittently:
> 
>   mv: cannot stat 'arch/x86/include/generated/asm/.tmp_cpufeaturemasks.h': No such file or directory
>   make[1]: *** [arch/x86/Makefile:269: arch/x86/include/generated/asm/cpufeaturemasks.h] Error 1
> 
> The same commit also converted the generic wrapper rule to filechk, so
> those wrappers now create .tmp_*.h in $(obj) too and can race among
> themselves.
> 
> Restore the previous behaviour by excluding dotfiles from the sweep.
> Subdirectories, which is what the find(1) conversion was for, keep being
> descended into. While at it, quote the -name argument: it is currently
> expanded by the shell against the build directory before find sees it.
> 
> Fixes: 2d69b891e646 ("kbuild: Support generated asm-headers in subdirectories")
> Signed-off-by: Vlad Poenaru <vlad.wing@gmail.com>

Oof :( that's unfortunate, thanks a lot for tracking this down!

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

Nicolas, I assume you will pick this up for 7.3.

-- 
Cheers,
Nathan

  reply	other threads:[~2026-09-03  6:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 16:13 Vlad Poenaru
2026-09-03  6:45 ` Nathan Chancellor [this message]
2026-09-04 17:47   ` Nicolas Schier
2026-09-03  7:09 ` Thomas Weißschuh
2026-09-04 18:19 ` Nicolas Schier

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=20260903064544.GA1942038@ax162 \
    --to=nathan@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nsc@kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=vlad.wing@gmail.com \
    /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

all inboxes | Powered by JetHome®