mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Jan Stancek <jstancek@redhat.com>,
	Justin Forbes <jforbes@fedoraproject.org>
Cc: maddy@linux.ibm.com, mpe@ellerman.id.au,
	linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com,
	linux-kernel@vger.kernel.org, joe.lawrence@redhat.com
Subject: Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
Date: Mon, 10 Nov 2025 12:33:22 +0100	[thread overview]
Message-ID: <d2e51443-49dd-445a-88aa-f29d7b777bce@csgroup.eu> (raw)
In-Reply-To: <CAASaF6zvFa-mPaPfKnBcerfVBkDt5B3TEn7P9jjAfentqSNmxQ@mail.gmail.com>



Le 30/10/2025 à 19:09, Jan Stancek a écrit :
> On Mon, Oct 6, 2025 at 10:19 PM Justin Forbes <jforbes@fedoraproject.org> wrote:
>>
>> On Tue, Sep 23, 2025 at 9:31 AM Jan Stancek <jstancek@redhat.com> wrote:
>>>
>>> We've been observing rare non-deterministic kconfig failures during
>>> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
>>> disabled and with it number of other config options that depend on it.
>>>
>>> The reason is that gcc-check-fpatchable-function-entry.sh can fail
>>> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
>>> there is still someone writing on other side of pipe. `pipefail`
>>> propagates that error up to kconfig.
>>>
>>> This can be seen for example with:
>>>    # (set -e; set -o pipefail; yes | grep -q y); echo $?
>>>    141
>>>
>>> or by running the actual check script in loop extensively:
>>>    ----------------------------- 8< -------------------------------
>>>    function kconfig()
>>>    {
>>>      for i in `seq 1 100`; do
>>>        arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
>>>          ./scripts/dummy-tools/gcc -mlittle-endian \
>>>          || { echo "Oops"; exit 1; }
>>>      done
>>>    }
>>>
>>>    for ((i=0; i<$(nproc); i++)); do kconfig & done
>>>    wait; echo "Done"
>>>    ----------------------------- >8 -------------------------------
>>>
>>> Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
>>> Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
>>> Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
>>> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
>>> Signed-off-by: Jan Stancek <jstancek@redhat.com>
>>> ---
>>>   arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh | 1 -
>>>   arch/powerpc/tools/gcc-check-mprofile-kernel.sh           | 1 -
>>>   2 files changed, 2 deletions(-)
>>>
>>> diff --git a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
>>> index 06706903503b..baed467a016b 100755
>>> --- a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
>>> +++ b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
>>> @@ -2,7 +2,6 @@
>>>   # SPDX-License-Identifier: GPL-2.0
>>>
>>>   set -e
>>> -set -o pipefail
>>>
>>>   # To debug, uncomment the following line
>>>   # set -x
>>> diff --git a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
>>> index 73e331e7660e..6193b0ed0c77 100755
>>> --- a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
>>> +++ b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
>>> @@ -2,7 +2,6 @@
>>>   # SPDX-License-Identifier: GPL-2.0
>>>
>>>   set -e
>>> -set -o pipefail
>>>
>>>   # To debug, uncomment the following line
>>>   # set -x
>>> --
>>> 2.47.1
>>
>> Would love to see this picked up, it fixes a problem we have run into
>> with our CI.
>>
>> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
> 
> Thanks Justin.
> 
> Would any maintainers also care to review? Ty.
> 

Is the problem only with those scripts ? I see other scripts using 
pipefail in the kernel:

arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh:set -o pipefail
arch/powerpc/tools/gcc-check-mprofile-kernel.sh:set -o pipefail
drivers/gpu/drm/ci/dt-binding-check.sh:set -euxo pipefail
drivers/gpu/drm/ci/dtbs-check.sh:set -euxo pipefail
drivers/gpu/drm/ci/kunit.sh:set -euxo pipefail
drivers/gpu/drm/ci/setup-llvm-links.sh:set -euo pipefail
scripts/check-uapi.sh:set -o pipefail

Christophe


  reply	other threads:[~2025-11-10 11:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 15:32 Jan Stancek
2025-10-06 20:19 ` Justin Forbes
2025-10-30 18:09   ` Jan Stancek
2025-11-10 11:33     ` Christophe Leroy [this message]
2025-11-11  7:13       ` Jan Stancek
2025-10-31 20:28 ` Josh Poimboeuf
2025-11-12 22:56 ` Josh Poimboeuf
2025-11-20 20:15   ` Josh Poimboeuf
2025-12-02 18:25     ` Josh Poimboeuf
2025-12-03  3:59 ` Naveen N Rao
2025-12-09  4:01   ` Madhavan Srinivasan
2025-12-27  4:23 ` Madhavan Srinivasan

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=d2e51443-49dd-445a-88aa-f29d7b777bce@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=jforbes@fedoraproject.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jstancek@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@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®