From: Jesse Gibbons <jgibbons2357@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: 01/01: services: Add ‘/usr/bin/env’ special file.
Date: Sun, 08 Sep 2019 17:53:02 -0600 [thread overview]
Message-ID: <9e1dcc180080285cf826b88bb14fb1f1f70435f0.camel@gmail.com> (raw)
In-Reply-To: <875zm231do.fsf@gnu.org>
Hello,
On Sun, 2019-09-08 at 23:48 +0200, Ludovic Courtès wrote:
> Hi,
>
> Jesse Gibbons <jgibbons2357@gmail.com> skribis:
>
> > If I might chip in here to try to make this discussion a little
> > more
> > productive, a user suggested /usr/bin/env should be added by
> > default[0]
> > to solve a problem[1]. In summary, the user wanted to have a
> > standard
> > for scripting in guile and other common GNU distros. If including
> > /usr/bin/env by default is not the best solution to the problem,
> > perhaps we can find a better solution.
> >
> > I suggest we add the "guix shebang" command, which takes a script
> > and
> > returns a script with a shebang pointing to the proper source, like
> > what 'patch-shebangs build phase does to all the scripts in the
> > build
> > source. It could replace the input script (perhaps when given the
> > --
> > replace option) or it could put the resulting script in the store
> > and
> > accept the --root= option.
>
> Would “guix shebang” modify the script, or would it be used as the
> shebang?
I suppose it could work either way. Since the scripts are intended to
be modified by the audience[1], it would be easier to have a command to
run as little as possible. On GuixSD, that would be as often as "guix
pull && guix upgrade" updates the program that runs the script; on
other systems it would be unnecessary. So modifying the script itself
would make the process simpler.
[1]https://lists.gnu.org/archive/html/help-guix/2019-09/msg00001.html
>
> Either way, I’m not sure it’d really solve the initial use case very
> well (the initial request was to be able to run scripts unmodified,
> AIUI.)
I see two solutions to the problem:
1. Run the scripts unmodified (ideal). This can only be accomplished if
the shebang can rely on a program in a standard location (i.e.
/usr/bin/env). Adding /usr/bin/env by default currently is up for
debate in this thread.
2. Patch the shebang with a command that can be run as rarely as
possible, ideally only once. If we keep /usr/bin/env out of %standard-
services or %de then this is the last solution I can think of. It could
be an inline awk or sed script (like the scripts throughout LFS), which
would have to be pulled out every time a user has new script, or a guix
command which would always be available to all users with this
particular problem. Guix package is an immediate choice, but was
rejected because it would make things more commplicated[1], not to
mention simpler scripts are probably shorter than a package definition.
The simplest solution here would be something like "guix shebang".
[1] https://lists.gnu.org/archive/html/help-guix/2019-09/msg00001.html
I have no preference which solution is used, but if /usr/bin/env is not
available in a build environment, and we can find a way to detect calls
to programs in standard locations and patch them when we build them, I
know of no reason not to include /usr/bin/env by default.
If anyone has a fourth solution, I would love to see it.
> Thanks,
> Ludo’.
--
-Jesse
next prev parent reply other threads:[~2019-09-08 23:53 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190906102509.28951.2772@vcs0.savannah.gnu.org>
[not found] ` <20190906102510.002BE21324@vcs0.savannah.gnu.org>
2019-09-06 10:36 ` 01/01: services: Add ‘/usr/bin/env’ special file Christopher Baines
2019-09-06 10:44 ` pelzflorian (Florian Pelz)
2019-09-06 10:47 ` pelzflorian (Florian Pelz)
2019-09-06 15:54 ` Tobias Geerinckx-Rice
2019-09-06 23:21 ` Mark H Weaver
2019-09-07 5:05 ` Jesse Gibbons
2019-09-07 7:52 ` Tobias Geerinckx-Rice via Development of GNU Guix and the GNU System distribution.
2019-09-07 15:33 ` Jesse Gibbons
2019-09-07 10:06 ` Tobias Geerinckx-Rice
2019-09-07 15:03 ` Jesse Gibbons
2019-09-08 21:48 ` Ludovic Courtès
2019-09-08 23:53 ` Jesse Gibbons [this message]
2019-09-08 22:19 ` Tobias Geerinckx-Rice
2019-09-06 23:47 ` Mark H Weaver
2019-09-07 8:54 ` Tobias Geerinckx-Rice
2019-09-07 14:41 ` Marius Bakke
2019-09-07 17:56 ` Ricardo Wurmus
2019-09-08 11:55 ` Konrad Hinsen
2019-09-08 18:31 ` Hartmut Goebel
2019-09-08 22:07 ` Ludovic Courtès
2019-09-09 7:01 ` Bengt Richter
2019-09-09 8:13 ` Ludovic Courtès
2019-09-09 1:37 ` Chris Marusich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e1dcc180080285cf826b88bb14fb1f1f70435f0.camel@gmail.com \
--to=jgibbons2357@gmail.com \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.