unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add /usr/bin/env by default in guixsd?
@ 2017-01-30 13:33 Huang, Ying
  2017-02-05 12:09 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Huang, Ying @ 2017-01-30 13:33 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Hi, Ludo,

It is a common practice to use /usr/bin/env in script shabang to use the
interpreter find in PATH.  For example, something as follow,

#!/usr/bin/env python

Although it is not necessary for scripts packaged in guix, if the
scripts are written by a user for his own usage and he don't want to
package it, it is good to have /usr/bin/env available.  In this way, the
interpreters in ~/.guix-profile/bin will be used.

So how about add /usr/bin/env by default in guixsd?

Best Regards,
Huang, Ying

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Add /usr/bin/env by default in guixsd?
  2017-01-30 13:33 Add /usr/bin/env by default in guixsd? Huang, Ying
@ 2017-02-05 12:09 ` Ludovic Courtès
  2017-02-05 13:56   ` huang_ying_caritas
  2017-02-05 19:28   ` Alex Kost
  0 siblings, 2 replies; 7+ messages in thread
From: Ludovic Courtès @ 2017-02-05 12:09 UTC (permalink / raw)
  To: Huang, Ying; +Cc: guix-devel

Hi!

Sorry for the delay.  I secretly hope somebody would answer, but this is
such a hot topic that nobody dared.  ;-)

"Huang, Ying" <huang_ying_caritas@163.com> skribis:

> It is a common practice to use /usr/bin/env in script shabang to use the
> interpreter find in PATH.  For example, something as follow,
>
> #!/usr/bin/env python
>
> Although it is not necessary for scripts packaged in guix, if the
> scripts are written by a user for his own usage and he don't want to
> package it, it is good to have /usr/bin/env available.  In this way, the
> interpreters in ~/.guix-profile/bin will be used.
>
> So how about add /usr/bin/env by default in guixsd?

For the record this has been discussed in the past:

  https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00414.html

There was no clear consensus.

Of course there are simple ways to add it, several of which were given
in the thread.

The subject does come up every once in a while though, so we really need
to address it one way or another.  :-)

First we need a simple ‘special-files’ service or something (for /bin/sh
and /usr/bin/env).

Then the whole battle will be about what the default should be.  I used
to be affiliated with the “no way!” party on this topic, but I
considering changing my mind.  :-)  Especially that it does not matter
that much, after all.

Ricardo, anyone, thoughts?

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Add /usr/bin/env by default in guixsd?
  2017-02-05 12:09 ` Ludovic Courtès
@ 2017-02-05 13:56   ` huang_ying_caritas
  2017-02-08 15:21     ` Ludovic Courtès
  2017-02-05 19:28   ` Alex Kost
  1 sibling, 1 reply; 7+ messages in thread
From: huang_ying_caritas @ 2017-02-05 13:56 UTC (permalink / raw)
  To: ludo; +Cc: guix-devel

Hi, Ludo,

ludo@gnu.org (Ludovic Courtès) writes:

> Hi!
>
> Sorry for the delay.  I secretly hope somebody would answer, but this is
> such a hot topic that nobody dared.  ;-)
>
> "Huang, Ying" <huang_ying_caritas@163.com> skribis:
>
>> It is a common practice to use /usr/bin/env in script shabang to use the
>> interpreter find in PATH.  For example, something as follow,
>>
>> #!/usr/bin/env python
>>
>> Although it is not necessary for scripts packaged in guix, if the
>> scripts are written by a user for his own usage and he don't want to
>> package it, it is good to have /usr/bin/env available.  In this way, the
>> interpreters in ~/.guix-profile/bin will be used.
>>
>> So how about add /usr/bin/env by default in guixsd?
>
> For the record this has been discussed in the past:
>
>   https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00414.html

Thanks a lot for being patient.

> There was no clear consensus.
>
> Of course there are simple ways to add it, several of which were given
> in the thread.
>
> The subject does come up every once in a while though, so we really need
> to address it one way or another.  :-)
>
> First we need a simple ‘special-files’ service or something (for /bin/sh
> and /usr/bin/env).
>
> Then the whole battle will be about what the default should be.  I used
> to be affiliated with the “no way!” party on this topic, but I
> considering changing my mind.  :-)  Especially that it does not matter
> that much, after all.

That sounds great for me!  Thanks!

> Ricardo, anyone, thoughts?
>
> Ludo’.

Best Regards,
Huang, Ying

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Add /usr/bin/env by default in guixsd?
  2017-02-05 12:09 ` Ludovic Courtès
  2017-02-05 13:56   ` huang_ying_caritas
@ 2017-02-05 19:28   ` Alex Kost
  1 sibling, 0 replies; 7+ messages in thread
From: Alex Kost @ 2017-02-05 19:28 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès (2017-02-05 13:09 +0100) wrote:

> Hi!
>
> Sorry for the delay.  I secretly hope somebody would answer, but this is
> such a hot topic that nobody dared.  ;-)
>
> "Huang, Ying" <huang_ying_caritas@163.com> skribis:
>
>> It is a common practice to use /usr/bin/env in script shabang to use the
>> interpreter find in PATH.  For example, something as follow,
>>
>> #!/usr/bin/env python
>>
>> Although it is not necessary for scripts packaged in guix, if the
>> scripts are written by a user for his own usage and he don't want to
>> package it, it is good to have /usr/bin/env available.  In this way, the
>> interpreters in ~/.guix-profile/bin will be used.
>>
>> So how about add /usr/bin/env by default in guixsd?
>
> For the record this has been discussed in the past:
>
>   https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00414.html
>
> There was no clear consensus.
>
> Of course there are simple ways to add it, several of which were given
> in the thread.
>
> The subject does come up every once in a while though, so we really need
> to address it one way or another.  :-)
>
> First we need a simple ‘special-files’ service or something (for /bin/sh
> and /usr/bin/env).
>
> Then the whole battle will be about what the default should be.  I used
> to be affiliated with the “no way!” party on this topic, but I
> considering changing my mind.  :-)  Especially that it does not matter
> that much, after all.
>
> Ricardo, anyone, thoughts?

I personally made "/usr/bin/env" (a symlink to
"/run/current-system/profile/bin/env"), so I think it would be good to
have it on GuixSD by default.

-- 
Alex

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Add /usr/bin/env by default in guixsd?
  2017-02-05 13:56   ` huang_ying_caritas
@ 2017-02-08 15:21     ` Ludovic Courtès
  2017-02-09  0:31       ` Huang, Ying
  2017-02-09 14:22       ` Alex Kost
  0 siblings, 2 replies; 7+ messages in thread
From: Ludovic Courtès @ 2017-02-08 15:21 UTC (permalink / raw)
  To: huang_ying_caritas; +Cc: guix-devel

Hello,

huang_ying_caritas@163.com skribis:

> ludo@gnu.org (Ludovic Courtès) writes:

[...]

>> First we need a simple ‘special-files’ service or something (for /bin/sh
>> and /usr/bin/env).
>>
>> Then the whole battle will be about what the default should be.  I used
>> to be affiliated with the “no way!” party on this topic, but I
>> considering changing my mind.  :-)  Especially that it does not matter
>> that much, after all.
>
> That sounds great for me!  Thanks!

Commit 387e175492f960d7d86f34f3b2e43938fa72dbf3 adds
‘special-files-service-type’.

The default is unchanged (only /bin/sh is created) but the documentation
provides a one-liner for /usr/bin/env (see below).

Thanks,
Ludo’.

 -- Scheme Variable: special-files-service-type
     This is the service that sets up “special files” such as ‘/bin/sh’;
     an instance of it is part of ‘%base-services’.

     The value associated with ‘special-files-service-type’ services
     must be a list of tuples where the first element is the “special
     file” and the second element is its target.  By default it is:

          `(("/bin/sh" ,(file-append BASH "/bin/sh")))

     If you want to add, say, ‘/usr/bin/env’ to your system, you can
     change it to:

          `(("/bin/sh" ,(file-append BASH "/bin/sh"))
            ("/usr/bin/env" ,(file-append COREUTILS "/bin/env")))

     Since this is part of ‘%base-services’, you can use
     ‘modify-services’ to customize the set of special files (*note
     ‘modify-services’: Service Reference.).  But the simple way to add
     a special file is via the ‘extra-special-file’ procedure (see
     below.)

 -- Scheme Procedure: extra-special-file FILE TARGET
     Use TARGET as the “special file” FILE.

     For example, adding the following lines to the ‘services’ field of
     your operating system declaration leads to a ‘/usr/bin/env’
     symlink:

          (extra-special-file "/usr/bin/env"
                              (file-append coreutils "/bin/env"))

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Add /usr/bin/env by default in guixsd?
  2017-02-08 15:21     ` Ludovic Courtès
@ 2017-02-09  0:31       ` Huang, Ying
  2017-02-09 14:22       ` Alex Kost
  1 sibling, 0 replies; 7+ messages in thread
From: Huang, Ying @ 2017-02-09  0:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

ludo@gnu.org (Ludovic Courtès) writes:

> Hello,
>
> huang_ying_caritas@163.com skribis:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>
> [...]
>
>>> First we need a simple ‘special-files’ service or something (for /bin/sh
>>> and /usr/bin/env).
>>>
>>> Then the whole battle will be about what the default should be.  I used
>>> to be affiliated with the “no way!” party on this topic, but I
>>> considering changing my mind.  :-)  Especially that it does not matter
>>> that much, after all.
>>
>> That sounds great for me!  Thanks!
>
> Commit 387e175492f960d7d86f34f3b2e43938fa72dbf3 adds
> ‘special-files-service-type’.
>
> The default is unchanged (only /bin/sh is created) but the documentation
> provides a one-liner for /usr/bin/env (see below).
>
> Thanks,
> Ludo’.
>
>  -- Scheme Variable: special-files-service-type
>      This is the service that sets up “special files” such as ‘/bin/sh’;
>      an instance of it is part of ‘%base-services’.
>
>      The value associated with ‘special-files-service-type’ services
>      must be a list of tuples where the first element is the “special
>      file” and the second element is its target.  By default it is:
>
>           `(("/bin/sh" ,(file-append BASH "/bin/sh")))
>
>      If you want to add, say, ‘/usr/bin/env’ to your system, you can
>      change it to:
>
>           `(("/bin/sh" ,(file-append BASH "/bin/sh"))
>             ("/usr/bin/env" ,(file-append COREUTILS "/bin/env")))
>
>      Since this is part of ‘%base-services’, you can use
>      ‘modify-services’ to customize the set of special files (*note
>      ‘modify-services’: Service Reference.).  But the simple way to add
>      a special file is via the ‘extra-special-file’ procedure (see
>      below.)
>
>  -- Scheme Procedure: extra-special-file FILE TARGET
>      Use TARGET as the “special file” FILE.
>
>      For example, adding the following lines to the ‘services’ field of
>      your operating system declaration leads to a ‘/usr/bin/env’
>      symlink:
>
>           (extra-special-file "/usr/bin/env"
>                               (file-append coreutils "/bin/env"))

Great!  Thanks a lot!

Best Regards,
Huang, Ying

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Add /usr/bin/env by default in guixsd?
  2017-02-08 15:21     ` Ludovic Courtès
  2017-02-09  0:31       ` Huang, Ying
@ 2017-02-09 14:22       ` Alex Kost
  1 sibling, 0 replies; 7+ messages in thread
From: Alex Kost @ 2017-02-09 14:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès (2017-02-08 16:21 +0100) wrote:

> Hello,
>
> huang_ying_caritas@163.com skribis:
>
>> ludo@gnu.org (Ludovic Courtès) writes:
>
> [...]
>
>>> First we need a simple ‘special-files’ service or something (for /bin/sh
>>> and /usr/bin/env).
>>>
>>> Then the whole battle will be about what the default should be.  I used
>>> to be affiliated with the “no way!” party on this topic, but I
>>> considering changing my mind.  :-)  Especially that it does not matter
>>> that much, after all.
>>
>> That sounds great for me!  Thanks!
>
> Commit 387e175492f960d7d86f34f3b2e43938fa72dbf3 adds
> ‘special-files-service-type’.
>
> The default is unchanged (only /bin/sh is created) but the documentation
> provides a one-liner for /usr/bin/env (see below).

Great, I'm using this feature now, thanks a lot!

-- 
Alex

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-09 14:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-30 13:33 Add /usr/bin/env by default in guixsd? Huang, Ying
2017-02-05 12:09 ` Ludovic Courtès
2017-02-05 13:56   ` huang_ying_caritas
2017-02-08 15:21     ` Ludovic Courtès
2017-02-09  0:31       ` Huang, Ying
2017-02-09 14:22       ` Alex Kost
2017-02-05 19:28   ` Alex Kost

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).