From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Prikler Subject: bug#38243: Zsh does not load /etc/profile values by default Date: Sun, 08 Dec 2019 10:01:12 +0100 Message-ID: <59bddacf16b64ab6f5409958704608b1280b7819.camel@student.tugraz.at> References: <02c4cef07e9f519697b9bbe9c6ab116fa2e2a404.camel@student.tugraz.at> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51230) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idsS4-0007GP-Kc for bug-guix@gnu.org; Sun, 08 Dec 2019 04:02:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idsS2-0001Fo-Ja for bug-guix@gnu.org; Sun, 08 Dec 2019 04:02:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44505) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idsS2-0001Fc-6I for bug-guix@gnu.org; Sun, 08 Dec 2019 04:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1idsS2-0002Wd-5h for bug-guix@gnu.org; Sun, 08 Dec 2019 04:02:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Danny O'Brien Cc: 38243@debbugs.gnu.org Am Samstag, den 07.12.2019, 22:15 -0800 schrieb Danny O'Brien: > I took a closer look at this, and currently Zsh users have > /etc/profile included in their environment by virtue of a default > $HOME/.zprofile, which is created in their home directory when they > are created (via `useradd` and /etc/skel ). It appears, though, that some Guix users lack this skeleton, perhaps those who used it before the change. > I'm a little stuck to know what to do here -- if we source > /etc/profile in /etc/zprofile, then we risk sourcing it twice for > users who have the current default ~/.zprofile already in their home > directories`. OTOH, if users come to Guix System with their own pre- > existing home directory, then they may well struggle --- as I did -- > because important environment variables aren't set by their > established ~/.zshrc, ~/.zprofile or ~/.zlogin setups. I don't think the problem is as bad as you make it out to be. If we write channel news describing the move of .zprofile to /etc/zprofile, people ought to see it and be able to prevent the double-sourcing. > I *think* the right thing to do is to drop the current > /etc/skel/.zprofile and establish that /etc/zprofile (and other > shells) should source /etc/profile . Guix System does a lot of setup > in /etc/profile including including $GUIX_PROFILE/etc/profile. It > would be best if this automatically happened, whatever is going on in > individual home directories. I'm a Guix newbie though, so I'm happy > to take advice! Archlinux has a one-line /etc/zprofile which sources > /etc/profile ; Debian does not; I have not checked other > distributions, but I could. The real problem with $GUIX_PROFILE/etc/profile is its shell-specific behaviour. The weird syntax used there *happens* to be supported by zsh, but other shells (most notably fish, but e.g. also Eshell[1]) do not like it. To solve this problem not just for one shell, but for all of them, we should write a portable $GUIX_PROFILE/etc/profile. Same for /etc/profile. Then we can source it from other shells. Again, sourcing it from /etc/zprofile is fine even without that change, as zsh happens to eat this syntax without complaints, but other shells do not like it. Regards, Leo [1] Eshell is a weird one. Sourceing the file directly appears to work, but does nothing. Setting $GUIX_PROFILE instead causes the user to be prompted for an alias.