Subject: bug#61094: closed (Re: bug#61094: [PATCH] doc: Document 'shebang' for 'guix shell'.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 16 Mar 2023 11:23:02 +0000

Your bug report

#61094: [PATCH] doc: Document 'shebang' for 'guix shell'.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
61094: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61094
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#61094: [PATCH] doc: Document 'shebang' for 'guix shell'.
From: Ludovic Courtès <[email-masked]>
To: Simon Tournier <[email-masked]>
Cc: [email-masked]
Date: Thu, 16 Mar 2023 12:21:59 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Simon,

Simon Tournier <[email-masked]> 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

Subject: [PATCH] doc: Document 'shebang' for 'guix shell'.
From: Simon Tournier <[email-masked]>
To: [email-masked]
Cc: Simon Tournier <[email-masked]>
Date: Fri, 27 Jan 2023 12:12:37 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

* doc/guix.texi (Invoking guix shell): Add a note mentioning how to use
'shebang'.
---
 doc/guix.texi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 2b1ad77ba5..acda01c8e6 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -71,7 +71,7 @@ Copyright @copyright{} 2019 Kyle Andrews@*
 Copyright @copyright{} 2019 Alex Griffin@*
 Copyright @copyright{} 2019, 2020, 2021, 2022 Guillaume Le Vaillant@*
 Copyright @copyright{} 2020 Liliana Marie Prikler@*
-Copyright @copyright{} 2019, 2020, 2021, 2022 Simon Tournier@*
+Copyright @copyright{} 2019, 2020, 2021, 2022, 2023 Simon Tournier@*
 Copyright @copyright{} 2020 Wiktor Żelazny@*
 Copyright @copyright{} 2020 Damien Cassou@*
 Copyright @copyright{} 2020 Jakub Kądziołka@*
@@ -5923,6 +5923,19 @@ building or downloading any missing package, and runs the
 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,
+
+@example
+#!/usr/bin/env -S guix shell python python-nympy -- python3
+@end example
+
+All the @var{options} or convenience of @command{guix shell} apply.
+@end quotation
+
 Development environments can be created as in the example below, which
 spawns an interactive shell containing all the dependencies and
 environment variables needed to work on Inkscape:

base-commit: 8e1cca32b938cef0812ce042c6c2e8bccb326ec7
-- 
2.38.1