From patchwork Thu Mar 16 11:21:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 48049 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7F77C16DED; Thu, 16 Mar 2023 11:23:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A683216DC2 for ; Thu, 16 Mar 2023 11:23:22 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pclhK-0001Ek-EJ; Thu, 16 Mar 2023 07:23:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pclhH-0001AT-Rw for guix-patches@gnu.org; Thu, 16 Mar 2023 07:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pclhG-0007hT-Mr for guix-patches@gnu.org; Thu, 16 Mar 2023 07:23:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pclhG-0002EF-6w for guix-patches@gnu.org; Thu, 16 Mar 2023 07:23:02 -0400 Subject: bug#61094: [PATCH] doc: Document 'shebang' for 'guix shell'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Thu, 16 Mar 2023 11:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 61094 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Simon Tournier Cc: 61094-done@debbugs.gnu.org Mail-Followup-To: 61094@debbugs.gnu.org, ludo@gnu.org, zimon.toutoune@gmail.com Received: via spool by 61094-done@debbugs.gnu.org id=D61094.16789657338493 (code D ref 61094); Thu, 16 Mar 2023 11:23:01 +0000 Received: (at 61094-done) by debbugs.gnu.org; 16 Mar 2023 11:22:13 +0000 Received: from localhost ([127.0.0.1]:41371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pclgT-0002Cv-AN for submit@debbugs.gnu.org; Thu, 16 Mar 2023 07:22:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pclgO-0002Cc-2Q for 61094-done@debbugs.gnu.org; Thu, 16 Mar 2023 07:22:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pclgI-0007ao-PW; Thu, 16 Mar 2023 07:22:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=mWX1RbfGd5d8tUXV5jzkDo0S+JjU0NyY+KILlPXDQTw=; b=AEePgdH1incquDCAllyU 0XaUwUyzlxtXoKTKpG8lj+q0JpQRiBPsNe/8qy33Zi+8gF4ITgimlrcLaJrj9/a7lvZRIdsjSMgZ0 HUJPodTNy75LvbPuYT0S6vihGH2ziWF1M5gYPj9WrWfob2zXB3allAzX0233kXm214xWy3Oa7a5Dd rbIwjYcnSj112lkR0wB++jZyGK70GX2lVGMzH4czmea4NRdH9i2EexK4YqJ0xV/DFcmcHCJD0T/PN q9TacBrlHqsNxQa61w25IvQBjLyfrVX7l7Edl0iWGWHyj8mW0VCrmNMRdOFVdVKIZz1GvaSgHVaIS Q0h+ViepkfsFvw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pclgH-0000mM-2E; Thu, 16 Mar 2023 07:22:02 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <20230127111237.2910126-1-zimon.toutoune@gmail.com> Date: Thu, 16 Mar 2023 12:21:59 +0100 In-Reply-To: <20230127111237.2910126-1-zimon.toutoune@gmail.com> (Simon Tournier's message of "Fri, 27 Jan 2023 12:12:37 +0100") Message-ID: <87v8j1eyaw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hi Simon, Simon Tournier skribis: > * doc/guix.texi (Invoking guix shell): Add a note mentioning how to use > 'shebang'. Applied with the changes below. Thanks! Ludo’. diff --git a/doc/guix.texi b/doc/guix.texi index 9c1fc04265..aa98d7df4b 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -5940,16 +5940,19 @@ guix shell python python-numpy -- python3 @end example @quotation Note -@cindex shebang -@command{guix shell} can be used as @emph{shebang}. Consider the -previous example as an executable Python script, the @emph{shebang} -reads, +@cindex shebang, for @command{guix shell} +@command{guix shell} can be also be used as a script interpreter, also +known as @dfn{shebang}. Here is an example self-contained Python script +making use of this feature: @example -#!/usr/bin/env -S guix shell python python-nympy -- python3 +#!/usr/bin/env -S guix shell python python-numpy -- python3 +import numpy +print("This is numpy", numpy.version.version) @end example -All the @var{options} or convenience of @command{guix shell} apply. +You may pass any @command{guix shell} option, but there's one caveat: +the Linux kernel has a limit of 127 bytes on shebang length. @end quotation Development environments can be created as in the example below, which