Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Charlie Jenkins <charlie@rivosinc.com>
Cc: buildroot@buildroot.org, "Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: Re: [Buildroot] [PATCH] package/linux-tools: Fix parallel compilation
Date: Sat, 19 Apr 2025 23:33:40 +0200	[thread overview]
Message-ID: <20250419233340.06021dab@windsurf> (raw)
In-Reply-To: <20250409-fix_linux_tools_parallel-v1-1-14135d77acf1@rivosinc.com>

Hello,

I'm adding Yann in Cc, as he wrote a good chunk of the linux-tools
stuff.

On Wed, 09 Apr 2025 01:51:00 -0700
Charlie Jenkins <charlie@rivosinc.com> wrote:

> linux-tools opportunistically set linux as only a patch dependency. This
> unfortunately introduces a race condition in the shared linux scripts
> when using PER_PACKAGE_DIRECTORIES and using top level parallelism.  The
> race manifests as the error "/bin/sh: 1: scripts/basic/fixdep:
> Permission denied". This happens when the linux package and the
> linux-tools package are being compiled in parallel. During the setup,
> each of these tools ends up compiling scripts/basic/fixdep. When the
> timing is correct, one of these packages will try to use fixdep while
> the other is compiling it, resulting in fixdep being briefly not
> available.
> 
> To fix this, set linux as a hard dependency instead of a patch
> dependency.
> 
> Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
> ---
> While the timing of this seems like it should very rarely be triggered,
> on my build server I hit this issue nearly 100% of the time.
> ---
>  package/linux-tools/linux-tools.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/linux-tools/linux-tools.mk b/package/linux-tools/linux-tools.mk
> index 81b1fbc17605d6f003558d113143b64b5af6714d..a5d4a66f761fc44b156a92edaaf21774529f52d5 100644
> --- a/package/linux-tools/linux-tools.mk
> +++ b/package/linux-tools/linux-tools.mk
> @@ -20,7 +20,7 @@
>  include $(sort $(wildcard package/linux-tools/*.mk.in))
>  
>  # We only need the kernel to be extracted, not actually built

This comment then needs to be updated. Maybe it can be kept, but
extended with why we're using a normal dependency, despite the fact
that we only need the kernel to be extracted.

> -LINUX_TOOLS_PATCH_DEPENDENCIES = linux
> +LINUX_TOOLS_DEPENDENCIES = linux

But otherwise, unless I'm missing something, it looks like a reasonably
solution to the problem.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2025-04-19 21:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  8:51 [Buildroot] [PATCH] package/linux-tools: Fix parallel compilation Charlie Jenkins
2025-04-19 21:33 ` Thomas Petazzoni via buildroot [this message]
2025-04-20  7:11   ` Yann E. MORIN
2025-04-21 18:22     ` Charlie Jenkins

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=20250419233340.06021dab@windsurf \
    --to=buildroot@buildroot.org \
    --cc=charlie@rivosinc.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /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