From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6BwUNwigEWXiSAAA9RJhRA:P1 (envelope-from ) for ; Mon, 25 Sep 2023 16:58:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6BwUNwigEWXiSAAA9RJhRA (envelope-from ) for ; Mon, 25 Sep 2023 16:58:16 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9E6CB50198 for ; Mon, 25 Sep 2023 16:58:15 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=bg2b7LHG; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695653895; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=QkXMsoUxbmK45Tzex6cQOe8Dte13iBtB26unUx0suJ4=; b=DRL0knjY95BRxVhKthrodcUCDeoi1GVPjWF0wQa3EiUn0i1yH2tdXGV7AonVZOfryJYYhT 7uGb0c2fM73x0EfYFkXZKKI0pUrjJr4Me/WKfk9PY4B//a206ENeF7VE90iuMppJhJwqPb asT1RkYNB7Y50yqmNiRYheCfaxrqJ9qXc0m1sGLY++MkQ9xxmVEN+w8BqF8cPsRcXfnUfP jOAVrjvHEY8bGycVTEKhJy47Ifnm5R5dtESzgCHZNzR3FzDVx3DVomNqeXMtn8dJLocTDr ltqf0833myseyfTUNBHWtjnXBiJaEwxzWwMYEvJykBnJ809zf1otKVRe6KewaQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695653895; a=rsa-sha256; cv=none; b=UkQdJk9SigSlPi5obZMIY5MUiiIHi9plgPClxUKX/sqYtdJ+ENfxgUFfisAXYJrvGEHnZf 5l8qgA3t67PM2XsS4rAs+W1sel6Sqcfadthqm9hJwEtjlQYhcxRJoyAMDbc565xbYEqJZF kJByDLg8Fz8ZQ7Y3HPvVR+n/bDY0rtSjlhNKGX0jZ0gZJdiO/23hqducHC79KOH1FTbs/s D6BEzbvp/RzpPI0fSM1iUwwq3IvlvMS6m0ywwgPe3vo98p6BUXGVpsB7JsbqwfEVp72DrW yYCUi8aG5Y62/eHwpqf/g+kTckaezk2TkuKFvBfsGVWDnpDTgp6RVVnJM3T2xQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=laesvuori.fi header.s=mail header.b=bg2b7LHG; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkn28-00083v-CK; Mon, 25 Sep 2023 10:58:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkn1y-00083V-Pn for bug-guix@gnu.org; Mon, 25 Sep 2023 10:57:50 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkn1y-0001vQ-5h for bug-guix@gnu.org; Mon, 25 Sep 2023 10:57:50 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkn2A-0006bO-5q for bug-guix@gnu.org; Mon, 25 Sep 2023 10:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#66168: zsh home service breaks guix shell via ssh Resent-From: Saku Laesvuori Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 25 Sep 2023 14:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66168 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Malte Frank Gerdes Cc: 66168@debbugs.gnu.org Received: via spool by 66168-submit@debbugs.gnu.org id=B66168.169565382325274 (code B ref 66168); Mon, 25 Sep 2023 14:58:02 +0000 Received: (at 66168) by debbugs.gnu.org; 25 Sep 2023 14:57:03 +0000 Received: from localhost ([127.0.0.1]:46415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkn1D-0006ZZ-6E for submit@debbugs.gnu.org; Mon, 25 Sep 2023 10:57:03 -0400 Received: from vmi571514.contaboserver.net ([75.119.130.101]:51650 helo=mail.laesvuori.fi) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkn18-0006Z1-93 for 66168@debbugs.gnu.org; Mon, 25 Sep 2023 10:57:01 -0400 Received: from X-kone (88-113-24-127.elisa-laajakaista.fi [88.113.24.127]) by mail.laesvuori.fi (Postfix) with ESMTPSA id D77A034017C; Mon, 25 Sep 2023 16:57:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1695653840; bh=ZTSoCXzBFWYFwmVvqy/FuTqH7NK+hRRUccCM5IwvHaU=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=bg2b7LHGs3SplunTW+g3Qivhq3DIcSu2G1JOmiFpYgSm7wd2KW4W5HfkxIkg86cuk fJzc6qCbIlT9sLFZHBSbhyDj1c+5TMuGymq80DAvnRhOVo7FZPsPHeUDbTkewzLne8 sPSxt0viYEd4Ldh5/UJ5Yheo5bBj530igR76XcQc= Date: Mon, 25 Sep 2023 17:56:34 +0300 Message-ID: References: <868r8xrxu4.fsf@gmail.com> <86cyy75rg1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tekwydgt547zzxm5" Content-Disposition: inline In-Reply-To: <86cyy75rg1.fsf@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Saku Laesvuori From: Saku Laesvuori via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -6.83 X-Spam-Score: -6.83 X-Migadu-Queue-Id: 9E6CB50198 X-TUID: SaXac+PDoCQy --tekwydgt547zzxm5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > ``` > > $ ssh localhost > > $ guix shell gnuplot > > $ gnuplot > > zsh: command not found: gnuplot > > ``` > > > > However (still within the ssh session) > > > > ``` > > $ guix shell gnuplot -- gnuplot > > [gnuplot opens as expected] > > ``` > > > > and weirdly enough > > > > ``` > > $ guix shell --check gnuplot > > guix shell: checking the environment variables visible from shell '/gnu= /store/i4rj0banq044423if5xwb3df723g14r9-zsh-5.9/bin/zsh'... > > guix shell: All is good! The shell gets correct environment variables. > > $ gnuplot > > zsh: command not found: gnuplot > > ``` > > > > I don't really know what is happening here. Why does it work when > > running the command directly and why does `guix shell --check` claim > > that everything is correct when clearly something is wrong? If I > > understand correctly `.zshenv` should be sourced in all these cases but > > for some reason the problems only occur in some of them. > > > > Any ideas? > > My guess would be that sourcing /etc/profile should only happen once, > but the SSH_CLIENT variable is inherited to the child shell which > evaluates zshenv which in turn sources /etc/profile because SSH_CLIENT > has non-zero length. So /etc/profile is sourced twice. >=20 > This is just a wild guess though. Seems to be about right. I had just assumed that guix shell would run the command in a new shell (causing .zshenv to be sourced in all those cases) but apparently it just calls the command directly. I haven't seen any problems with sourcing /etc/profile multiple times because it reloads both system and user profiles, but obviously it doesn't know about guix shell profiles. It seems that the default bash configuration only sources /etc/profile if $SSH_CLIENT is non-empty and bash is used non-interactively. Something similar could probably be done with zsh, but I would expect it to still have this issue in certain situation. For example, I think running a script like this ``` $ ssh host -- guix shell gnuplot <