all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* SBCL's run-program and environment variables
@ 2021-08-31 19:14 André A. Gomes
  2021-09-01  7:32 ` Guillaume Le Vaillant
  0 siblings, 1 reply; 3+ messages in thread
From: André A. Gomes @ 2021-08-31 19:14 UTC (permalink / raw)
  To: help-guix; +Cc: mail

Hi Guix,

Today I had the following issue and I'm wondering if other Guix users
have this problem too.

Start a SBCL REPL and run:

--8<---------------cut here---------------start------------->8---
(run-program "ls" '("-la")
             :search "/run/current-system/profile/bin"
             :environment '("TIME_STYLE=full-iso")
             :output *standard-output*)
--8<---------------cut here---------------end--------------->8---

This fails on my side, but I was told it works on other GNU/Linux
distros.  Can you reproduce it?

I find this quite strange since the following Bash works for me:

--8<---------------cut here---------------start------------->8---
TIME_STYLE=full-iso /run/current-system/profile/bin/ls -la
--8<---------------cut here---------------end--------------->8---

Thank you.


--
André A. Gomes
"Free Thought, Free World"


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

* Re: SBCL's run-program and environment variables
  2021-08-31 19:14 SBCL's run-program and environment variables André A. Gomes
@ 2021-09-01  7:32 ` Guillaume Le Vaillant
  2021-09-01 11:39   ` André A. Gomes
  0 siblings, 1 reply; 3+ messages in thread
From: Guillaume Le Vaillant @ 2021-09-01  7:32 UTC (permalink / raw)
  To: André A. Gomes; +Cc: mail, help-guix

[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]

André A. Gomes <andremegafone@gmail.com> skribis:

> Hi Guix,
>
> Today I had the following issue and I'm wondering if other Guix users
> have this problem too.
>
> Start a SBCL REPL and run:
>
> --8<---------------cut here---------------start------------->8---
> (run-program "ls" '("-la")
>              :search "/run/current-system/profile/bin"
>              :environment '("TIME_STYLE=full-iso")
>              :output *standard-output*)
> --8<---------------cut here---------------end--------------->8---
>
>
> This fails on my side, but I was told it works on other GNU/Linux
> distros.  Can you reproduce it?
>
> I find this quite strange since the following Bash works for me:
>
> --8<---------------cut here---------------start------------->8---
> TIME_STYLE=full-iso /run/current-system/profile/bin/ls -la
> --8<---------------cut here---------------end--------------->8---
>
> Thank you.

Hi,

The documentation of the 'run-program' function indicates:

--8<---------------cut here---------------start------------->8---
:SEARCH
   Look for PROGRAM in each of the directories in the child's $PATH
   environment variable.  Otherwise an absolute pathname is required.
--8<---------------cut here---------------end--------------->8---

which means that it should be used either like this:

--8<---------------cut here---------------start------------->8---
(run-program "ls" '("-la")
             :search t
             :environment '("TIME_STYLE=full-iso"
                            "PATH=/run/current-system/profile/bin")
             :output *standard-output*)
--8<---------------cut here---------------end--------------->8---

or like this:

--8<---------------cut here---------------start------------->8---
(run-program "/run/current-system/profile/bin/ls" '("-la")
             :environment '("TIME_STYLE=full-iso")
             :output *standard-output*)
--8<---------------cut here---------------end--------------->8---

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

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

* Re: SBCL's run-program and environment variables
  2021-09-01  7:32 ` Guillaume Le Vaillant
@ 2021-09-01 11:39   ` André A. Gomes
  0 siblings, 0 replies; 3+ messages in thread
From: André A. Gomes @ 2021-09-01 11:39 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: mail, help-guix

Guillaume Le Vaillant <glv@posteo.net> writes:

> :SEARCH
>    Look for PROGRAM in each of the directories in the child's $PATH
>    environment variable.  Otherwise an absolute pathname is required.

All clear.  Thank you.


-- 
André A. Gomes
"Free Thought, Free World"


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

end of thread, other threads:[~2021-09-01 11:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-31 19:14 SBCL's run-program and environment variables André A. Gomes
2021-09-01  7:32 ` Guillaume Le Vaillant
2021-09-01 11:39   ` André A. Gomes

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.