public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: "Gary Guo" <gary@garyguo.net>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Eduard Zingerman" <eddyz87@gmail.com>,
	"Song Liu" <song@kernel.org>,
	"Yonghong Song" <yonghong.song@linux.dev>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"KP Singh" <kpsingh@kernel.org>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Hao Luo" <haoluo@google.com>, "Jiri Olsa" <jolsa@kernel.org>,
	bpf <bpf@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] scripts/gen-btf.sh: fix shebang for NixOS
Date: Tue, 20 Jan 2026 21:04:08 -0800	[thread overview]
Message-ID: <c8eb9347-b23c-4ad5-9555-b2a55b788dce@linux.dev> (raw)
In-Reply-To: <CAADnVQKLtnfbaJCbbe=JY+85kBKfiUv9hjW+bumO_Y_YovuFow@mail.gmail.com>



On 1/20/26 8:52 PM, Alexei Starovoitov wrote:
> On Tue, Jan 20, 2026 at 8:50 PM Ihor Solodrai <ihor.solodrai@linux.dev> wrote:
>>
>>
>>
>> On 1/20/26 3:54 PM, Gary Guo wrote:
>>>> [...]
>>>>
>>>> So it's trivial to put $(CONFIG_SHELL) in front of it. But then it
>>>> must be migrated to #!/bin/sh, right?
>>>
>>> Documentation/kbuild/makefiles.rst says:
>>>
>>> Make rules may invoke scripts to build the kernel. The rules shall
>>> always provide the appropriate interpreter to execute the script. They
>>> shall not rely on the execute bits being set, and shall not invoke the
>>> script directly. For the convenience of manual script invocation, such
>>> as invoking ./scripts/checkpatch.pl, it is recommended to set execute
>>> bits on the scripts nonetheless.
>>>
>>> Kbuild provides variables $(CONFIG_SHELL), $(AWK), $(PERL),
>>> and $(PYTHON3) to refer to interpreters for the respective
>>> scripts.
>>>
>>> So I suppose it would need to migate to POSIX shell...
>>
>> That's my blunder then.
>>
>> I'll send a patch tomorrow to make gen-btf.sh runnable with /bin/sh
> 
> Isn't the current patch enough?
> -#!/bin/bash
> +#!/usr/bin/env bash
> 
> I don't think all kernel build scripts are pure 'sh'.

Well, if we want to follow the makefiles.rst (and Thomas')
recommendation, which is executing the script via $(CONFIG_SHELL),
then we have to migrate to #!/bin/sh, because that's the default.

This concerns only scripts in the kernel build pipeline AFAIU.

But you may be right that this is not a strict rule, idk.
It did come up quite late on the list.


  reply	other threads:[~2026-01-21  5:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 18:20 [PATCH] scripts/gen-btf.sh: fix shebang for NixOS Gary Guo
2026-01-20 18:59 ` Ihor Solodrai
2026-01-20 19:15   ` Gary Guo
2026-01-20 19:38     ` Thomas Weißschuh
2026-01-20 19:53       ` Ihor Solodrai
2026-01-20 23:54         ` Gary Guo
2026-01-21  4:49           ` Ihor Solodrai
2026-01-21  4:52             ` Alexei Starovoitov
2026-01-21  5:04               ` Ihor Solodrai [this message]
2026-01-21 16:09                 ` Alexei Starovoitov

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=c8eb9347-b23c-4ad5-9555-b2a55b788dce@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=gary@garyguo.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox