Re: Is set-environment-variable needed after all?
Duy Nguyen 09 Dec 2019 03:51 UTC
On Sun, Dec 8, 2019 at 3:15 AM Lassi Kortela <xxxxxx@lassi.io> wrote:
>
> Would you recommend we drop `set-environment-variable!` and
> `delete-environment-variable!` and simply provide an :environment
> argument in the subprocess SRFI? That may be the best call.
There's one case where setenv call may be more appropriate than
:environment, although I'm not sure if it's enough to justify
set-environment-variable!
For programs like Git, it takes $GIT_DIR and needs to pass it down to
all subprocess. The thing is this variable can contain relative path,
so if you "cd" somewhere in the current process, then you need to
adjust $GIT_DIR too or subprocess will fail to find the right ".git"
directory. And it's less error prone to adjust the variable with
setenv whenever you chdir instead of waiting until you spawn a new
subprocess.
--
Duy