From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: Re: wrap-program =?utf-8?Q?=E2=80=93=3E?= wrap-script Date: Sat, 14 Dec 2019 00:07:22 +0900 Message-ID: <8736donu1h.fsf@gmail.com> References: <87h8263le2.fsf@elephly.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:45917) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifmXQ-0000BW-Jp for guix-devel@gnu.org; Fri, 13 Dec 2019 10:07:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifmXP-0005La-Dl for guix-devel@gnu.org; Fri, 13 Dec 2019 10:07:28 -0500 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]:38071) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifmXP-0005KA-9g for guix-devel@gnu.org; Fri, 13 Dec 2019 10:07:27 -0500 Received: by mail-qv1-xf2f.google.com with SMTP id t5so942583qvs.5 for ; Fri, 13 Dec 2019 07:07:27 -0800 (PST) In-Reply-To: <87h8263le2.fsf@elephly.net> (Ricardo Wurmus's message of "Wed, 11 Dec 2019 16:57:41 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org Hello Ricardo, Ricardo Wurmus writes: > Hi Guix, > > I=E2=80=99ve just pushed a change to use wrap-script in one package. The > purpose of wrap-script is to wrap an executable without having to create > a separate wrapper shell script. It does this by prepending a Guile > script to the top of the file, which sets the environment variables and > then re-executes itself with the target interpreter (e.g. Python). That's smart! > I noticed two things: > > 1) wrap-script does not automatically pull in Guile as a dependency, so > if Guile isn=E2=80=99t among the inputs it will create a bad shebang. Th= is > should be fixed on core- Since as you mention below, the wrap-script isn't much used at all, I guess the reason to make the change to core-updates rather than master is because the host module of wrap-script (guix build utils) is used as a whole when computing the hash of derivations? > 2) we aren=E2=80=99t using wrap-script anywhere. I think a good use case= would > be the Python build system=E2=80=99s =E2=80=9Cwrap=E2=80=9D phase where w= e currently use > wrap-program. Most of the time we=E2=80=99d be dealing with Python scrip= ts, so > using wrap-script would be more appropriate here. > > What do you think? Are you considering "testing" for the type of file (e.g., script? binary?) before wrapping it? Something else? I like the idea in general. IIUC this would remove the need to have those ugly .real-script-name lying around. Maxim