GNU bug report logs - #64765
[PATCH] gnu: home: zsh: Also load enviroment in non-login shells

Previous Next

Package: guix-patches;

Reported by: Saku Laesvuori <saku <at> laesvuori.fi>

Date: Fri, 21 Jul 2023 10:59:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 64765 <at> debbugs.gnu.org (full text, mbox):

From: Saku Laesvuori <saku <at> laesvuori.fi>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 64765 <at> debbugs.gnu.org, 宋文武 <iyzsong <at> envs.net>
Subject: Re: bug#64765: [PATCH] gnu: home: zsh: Also load enviroment in
 non-login shells
Date: Thu, 17 Aug 2023 10:36:40 +0300
[Message part 1 (text/plain, inline)]
> >> Hello, this looks reasonable to me, only one question:
> >> Will ~/.guix-home/profile/etc/profile be sourced multiple times with
> >> duplicated search-path entries?  (eg: check 'env' in 'zsh' in 'zsh').
> >
> > Yes, but I don't think it causes any problems aside from adding useless
> > data to the environment. This could be prevented by exporting
> > GUIX_PROFILE_SOURCED=1 or something similar and only sourcing profiles
> > if it isn't set.
> 
> I doesn’t sound great though, and I’m sure it could break obscure
> things, like #include_next in C.
> 
> Is there a way this could be avoided?  (I’m not familiar with Zsh so I’m
> not offering to help; just looking for pending patches to apply.  :-))

It could be avoided properly by making guix-generated
profiles ensure that they can't be sourced multiple times
(e.g. [ -z "$GUIX_PROFILE_SOURCED" ] || return ; GUIX_PROFILE_SOURCED=1).
The specific problem I was facing was with running commands with ssh,
which the bash service seems to fix by sourcing /etc/profile from bashrc
when used via ssh. I'll send a patch for this ssh-specific solution but
I'm not sure if it's the best way to fix this.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 305 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.