All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "HONG Yifan" <elsk@google.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nsc@kernel.org>
Cc: "Masahiro Yamada" <masahiroy@kernel.org>,
	linux-kbuild@vger.kernel.org, kernel-team@android.com
Subject: Re: [PATCH] kbuild: serialize scripts after scripts_unifdef
Date: Fri, 04 Dec 2026 19:18:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-250519@kernel.org> (raw)
In-Reply-To: <20261203191820.2576904-1-elsk@google.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] kbuild: scripts and recursive scripts_unifdef still race on
  ARCH=um
--

commit 4bf37da0ae8b1fb30389763a88c140890a30608d
Author: HONG Yifan <elsk@google.com>

kbuild: serialize scripts after scripts_unifdef

This commit adds scripts_unifdef as a prerequisite of scripts under
CONFIG_HEADERS_INSTALL to serialize the two targets during parallel builds.

> diff --git a/Makefile b/Makefile
> index 5aac6f1b011e1..787e041b5d7e3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1518,6 +1518,7 @@ endif
>  
>  ifdef CONFIG_HEADERS_INSTALL
>  prepare: headers
> +scripts: scripts_unifdef
>  endif
>  
>  PHONY += scripts_gen_init_cpio

[Severity: Medium]
Can scripts still race with scripts_unifdef on ARCH=um?

Adding scripts: scripts_unifdef orders scripts after the outer
scripts_unifdef, but not after headers.  On ARCH=um with
CONFIG_HEADERS_INSTALL=y, arch/um/Makefile defines HEADER_ARCH, so headers
spawns a recursive make headers that runs scripts_unifdef again:

scripts                       headers
$(MAKE) $(build)=scripts      $(MAKE) ... SRCARCH=$(HEADER_ARCH) headers
                                scripts_unifdef
                                  $(MAKE) $(build)=scripts scripts/unifdef
  cmd_and_fixdep writes         -include scripts/.*.cmd
    scripts/.*.cmd                <-- missing separator

Both $(build)=scripts invocations include .cmd files for all existing
hostprogs in scripts/ via scripts/Makefile.build, while cmd_and_fixdep
writes them non-atomically via shell redirection.  The recursive
scripts_unifdef can read a partial .cmd file and fail with missing separator.

With CONFIG_WERROR=y (such as ARCH=um allmodconfig), the recursive headers
sub-make skips auto.conf and drops -Werror and -Wl,--fatal-warnings, so
recursive scripts_unifdef also recompiles scripts/unifdef and rewrites
scripts/.unifdef.cmd concurrently with scripts.

Ordering scripts after headers under CONFIG_HEADERS_INSTALL would serialize
both invocations.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203191820.2576904-1-elsk@google.com?part=1

  parent reply	other threads:[~2026-12-04 19:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 19:18 [PATCH] kbuild: serialize scripts after scripts_unifdef HONG Yifan
2026-12-04 18:39 ` Nicolas Schier
2026-12-04 19:18 ` sashiko-bot [this message]
2026-12-04 23:07   ` Hong, Yifan

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=sashiko-outbox-250519@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=elsk@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.