From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 294DD33D6E9 for ; Wed, 21 Jan 2026 05:04:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768971860; cv=none; b=Cm+Eh+Jya2VdcyTPqjnFYG5ig5mQ7rbwFRxJ/0AkwgLKEfog2+8ncHL8v2/LyM68F2+6e0A10byK+izi9tPbPXvaWF7R/RQnYGr45Jbv6TqNOmkRHzXHPA3vBKlhFz8XG2AsvoSlfy0lzQj9SxVx2DVxAzIF+GURfADBGP7IjYM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768971860; c=relaxed/simple; bh=v1W9PXHHW8JmGQRKPIGWJNieXs78Z0SYug1ixi5BbXE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eW5vEZqQVKhz/9f1RoOQEx4QNOCYMzRpSsQ7dvtr/3qA8/dI1DeZm0qhTPqfM4D+T7+CY15q3IZfh1Q2R7wc+SJMsAeDuNh7wfMVmTmjb/fAqtyNt3Wr08St2Pchml1bKhR/Dtghr04lKWmiN7Nw2JZfLOcTgMXqhoScEWPbx0I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Ba/Bx5O7; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Ba/Bx5O7" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768971856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mRB8tvxmnI4O2dINRIDuf5YHKQB2kGq3bqQ9+3NoM6I=; b=Ba/Bx5O73wTY0f+vg7jmRB9iXS0gzYLA0w6uA4ZpAFqgCcW8jdL3mB2Wnclfg0eZHToEcx 8U6Ejr6gDNhRi38Ipbyk4qbzHtlNTNXYLrmGA5JYsA8aregObZyVMk8moagJedOnFhamlQ vxQtikjzRCa9ya7ndjhXG/3LfooWXS8= Date: Tue, 20 Jan 2026 21:04:08 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] scripts/gen-btf.sh: fix shebang for NixOS To: Alexei Starovoitov Cc: Gary Guo , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf , LKML References: <20260120182034.3647092-1-gary@kernel.org> <5364d5ec-f30c-40d6-9a99-c251fec3868c@linux.dev> <1897b382-41b7-4d63-815d-ac63f38485ee@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Ihor Solodrai In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 1/20/26 8:52 PM, Alexei Starovoitov wrote: > On Tue, Jan 20, 2026 at 8:50 PM Ihor Solodrai 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.