From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mPH0MK1mWGGtBgEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 16:03:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2BCQLK1mWGFdPQAAB5/wlQ (envelope-from ) for ; Sat, 02 Oct 2021 14:03:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 548F1307D8 for ; Sat, 2 Oct 2021 16:03:25 +0200 (CEST) Received: from localhost ([::1]:43882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWfbo-0005Qx-Hd for larch@yhetil.org; Sat, 02 Oct 2021 10:03:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfaU-0003dQ-NB for guix-patches@gnu.org; Sat, 02 Oct 2021 10:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWfaU-00025v-Fu for guix-patches@gnu.org; Sat, 02 Oct 2021 10:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mWfaU-0003n9-9m for guix-patches@gnu.org; Sat, 02 Oct 2021 10:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50960] =?UTF-8?Q?=E2=80=98guix_?= =?UTF-8?Q?shell=E2=80=99?= shebangs Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Oct 2021 14:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50960 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50960@debbugs.gnu.org Received: via spool by 50960-submit@debbugs.gnu.org id=B50960.163318326514503 (code B ref 50960); Sat, 02 Oct 2021 14:02:02 +0000 Received: (at 50960) by debbugs.gnu.org; 2 Oct 2021 14:01:05 +0000 Received: from localhost ([127.0.0.1]:60112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfZY-0003lp-Tz for submit@debbugs.gnu.org; Sat, 02 Oct 2021 10:01:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mWfZW-0003l9-Ai for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 10:01:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53404) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWfZQ-0001Mw-UQ for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 10:00:56 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36472 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWfYn-0007Zg-Nx for 50960@debbugs.gnu.org; Sat, 02 Oct 2021 10:00:29 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20211002102116.27726-1-ludo@gnu.org> Date: Sat, 02 Oct 2021 16:00:10 +0200 In-Reply-To: <20211002102116.27726-1-ludo@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 2 Oct 2021 12:21:16 +0200") Message-ID: <87zgrry1at.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633183405; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=E3mqAb5WpXp8tD2goom2X2O/tSEpRewJ7zMI9ceEb+Q=; b=PzBHsFKtMy3/lG3pMLNUsTk73MG31grlzbz5dsws54s5ltPl2c7vu7LYA6dCd3+riX7A9j 5So4a9lT1vUPupVbwRXrSY4hzwOc34+N0H3JgH2FiWiM4D4QKfrD7n2c+I0AyMVlO5V902 vI706Ft30OIClB/tF5/8WAw6WFVMruJuRksXZkPe5wlkAwRAOaSL1FGtHuKJ0rhb0fexGh 1wn0UJ5eY9/UzQ7naKLtSvxJ+Ej7ZlBjt9C/W/hUive0rcASpFbqlHyviZnD2Fvg/v+Adt INfhgEE369sBT+uhvwA9eyUDZgh/wha2s3jy0ssPRCaKqUd/hMwEqAUsdXyduw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633183405; a=rsa-sha256; cv=none; b=bnV9hsxCa7Z3DWxafJ3ySy39uyq9nq8O+rpd/e31WSPd1l3BZ7wfiu0QQpW4LbhVqWAbnC abvqxKK9bVpZTjDrcxTzpjI4B3yI3ZJIVkhPpt9duVrCybRA9PcMGK/UHWmdbqLFZm5Ba6 LFCx0WMEXvnNL3og/YwIQqfaGy3DvhUiHzkcvS0zTCc1zQzNVgPtajyfiy0LNrNLS+eZPX kcH1QqjzzTSLkTBo33eBYD6zo4Tk97L07M7ofVF2ENHnjCMhny1DmWvE7Vtz5YO2ejwbK6 +LmMZc8lWR3vsJy46FycQVZlr4rLDZ8f8OBg96QFiSG98sMH7bcr5dkj2woKow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.70 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 548F1307D8 X-Spam-Score: -3.70 X-Migadu-Scanner: scn1.migadu.com X-TUID: +w/bFbM/uxha Ludovic Court=C3=A8s skribis: > The differences to =E2=80=98guix environment=E2=80=99 are: > > 1. =E2=80=98--ad-hoc=E2=80=99 is the default. > > =E2=80=98guix shell hello=E2=80=99 =E2=89=8D =E2=80=98guix environ= ment --ad-hoc hello=E2=80=99 > =E2=80=98guix shell -D hello git=E2=80=99 =E2=89=8D =E2=80=98guix = environment hello --ad-hoc git=E2=80=99 > > 2. =E2=80=98guix shell=E2=80=99, without arguments, loads =E2=80=98guix= .scm=E2=80=99 or =E2=80=98manifest.scm=E2=80=99 > from the current directory or one of its ancestors. > > 3. =E2=80=98--load=E2=80=99/=E2=80=98-l=E2=80=99 is not =E2=80=98-f=E2= =80=99/=E2=80=98--install-from-file=E2=80=99 for consistency with > =E2=80=98guix package=E2=80=99. > > 4. =E2=80=98guix shell=E2=80=99 without arguments maintains a cache, su= ch that, the > second time you run it, it runs in ~0.1s (it does not even need to > connect to the daemon). > > If you run =E2=80=98guix pull=E2=80=99 and run again =E2=80=98guix s= hell=E2=80=99, it recomputes > the environment, as is currently the case with =E2=80=98guix environ= ment=E2=80=99. Oh, I had another goal in mind, which was to make it easy to use =E2=80=98g= uix shell=E2=80=99 in shebangs. Problem is, since it=E2=80=99s called =E2=80=98guix shell=E2=80=99 and not = =E2=80=98guix-shell=E2=80=99, we have to use =E2=80=98/usr/bin/env -S=E2=80=99 anyway as the shebang so it splits= arguments. And with =E2=80=98-S=E2=80=99, we can already do pretty much everything we = want. Here=E2=80=99s a shell script: --8<---------------cut here---------------start------------->8--- $ cat t.sh #!/usr/bin/env -S guix shell hello bash -- sh type -P hello hello --8<---------------cut here---------------end--------------->8--- Should we simply document it or should we do something more? For the record, =E2=80=98nix-shell=E2=80=99 has shebang support where it ca= n interpret =E2=80=9Cspecial=E2=80=9D lines as arguments: https://nixos.org/manual/nix/stable/#sec-nix-shell Ludo=E2=80=99.