From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id gHFeIwOHEGWjqwAAauVa8A:P1 (envelope-from ) for ; Sun, 24 Sep 2023 20:59:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gHFeIwOHEGWjqwAAauVa8A (envelope-from ) for ; Sun, 24 Sep 2023 20:59:15 +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 572C24AD68 for ; Sun, 24 Sep 2023 20:59:15 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=YyhbGzFb; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695581955; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=Yu4i9T7FpA1Hj1CrGfDPMGYK9mf1wBchaoJsn61eZl0=; b=pH73iyucwqZEz5uEkyrzttE9zN8GvSx7SukvsLCIIhl7k56xNiAgsGPw1ZPR8Ou6ORjm9M DuhrADhm/lI5Va3CtkejKe9PTk+vUpTfkZlsGyJdEovmnNcK6VkFzhsigR9vABO4XTph5G KVKRsMM2Z9nnZ+iwGJ8VP/AqAAAuGMHyW6a8mwJaL9/DxrJcGbSnvyVd34g0pLgmItE3i1 hdjQQe4a1Xrqkcp55RXrWaWVkJVBkgycqSPiZV88Sm8ElDXJ75eox4tXPHkw/YtbPInL5R U1/lYbj4QJS7IQTVGBZilZBipXEFXM2KSu4oXsSQtsA6/y9sy2ECVdMlkoSXLg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695581955; a=rsa-sha256; cv=none; b=PGoVDQcLUA5ib4RsZWiTuM5Grm+EcXQiLUxawmNUZB9ahrm5dBjT7xv260zdj396XFQphY F749ahmcAWC9QrxE56fBV3KUqpHe5VY4HwxaNFlvzKk/v5Gc63ytBndJNo6pG1f2U/my44 RQVkhnfczNuecYzocI6it/yuy6yiIWIhdq5giPfQ6avlBgmKtuelVgijZEu1lDsQuuHyFx isjE2aQSPboF7XEF/EO+ru5DOu82uQtJEZxfoL+olfJskSSos+3y/jVaac5Hr3PRYD5rDY ak4nx1MAzU6wZAbf78KJH2OHSb1iqb6Vn1+5MLudEteU+4+LhIi3wY59uS2Q1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=YyhbGzFb; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkUJg-0001jy-Ri; Sun, 24 Sep 2023 14:58:52 -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 1qkUJe-0001jL-K6 for bug-guix@gnu.org; Sun, 24 Sep 2023 14:58: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 1qkUJe-0006LB-C3 for bug-guix@gnu.org; Sun, 24 Sep 2023 14:58:50 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkUJq-0007Up-02 for bug-guix@gnu.org; Sun, 24 Sep 2023 14:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#66168: zsh home service breaks guix shell via ssh Resent-From: Malte Frank Gerdes Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 24 Sep 2023 18:59:01 +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: Saku Laesvuori Cc: 66168@debbugs.gnu.org Received: via spool by 66168-submit@debbugs.gnu.org id=B66168.169558193228795 (code B ref 66168); Sun, 24 Sep 2023 18:59:01 +0000 Received: (at 66168) by debbugs.gnu.org; 24 Sep 2023 18:58:52 +0000 Received: from localhost ([127.0.0.1]:43621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkUJf-0007UM-J9 for submit@debbugs.gnu.org; Sun, 24 Sep 2023 14:58:51 -0400 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:56729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkUJc-0007U8-E8 for 66168@debbugs.gnu.org; Sun, 24 Sep 2023 14:58:49 -0400 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2b95d5ee18dso85351211fa.1 for <66168@debbugs.gnu.org>; Sun, 24 Sep 2023 11:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695581910; x=1696186710; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=Yu4i9T7FpA1Hj1CrGfDPMGYK9mf1wBchaoJsn61eZl0=; b=YyhbGzFbRRnq1htUYgI8YscKR4qKKqW/xHbLDvlcnwio0hrHVLvpfa2Zb1HC0GCRs/ vgEH56y6rSkpM6DOIAgCRtJgKfANcdlehnQsD+EiXAV7AqkdluyrGeNI4RI84U5h54jE RzWvzWqMFgwCAkGV3VH5hRWDAcLHbL4XE3VLqCskSZXy5QU8HEKLXH9lz+NvjH/MHQzl HehGCJQxVEmkwkmVDEN4WiUkMxJDTxZl/YRlwmJ5q2hic2lmy6ExT9duVm8WG3MQzQ0x fhskxEY3b6bZU6l74uQyuK1c6S8i3P5098d6jlejAtqwtzZ8RIHH8Tjeq/V6te6nczpp +xyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695581910; x=1696186710; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Yu4i9T7FpA1Hj1CrGfDPMGYK9mf1wBchaoJsn61eZl0=; b=gLYVfVeGiTKBfq9GaEsJLtPRy8IUzSxQEtb6er10E/CVQeyd04nv66z/fu20IQQXPE 5+VHj38bKxGzlDf2vQ45z3QISizQnvqfySeZXpCG1osoRher168MKDMxEm3bb7IUtwRN DGlaiF//Sg7jE+VPsSGoaVBv7L5BVeUhdvqZSquzReqbcDG/y9FFGcsl0jdeeYK4t4Y9 ZAaYWz0CoOfrCGcaZi+Q51ZSyO1NAfEwwqCLFNgjVpSd1/7c7vDJFMPO1KIaGkV3i193 1BbUDHSPg7YuCLSNRj1mbWpiyhNAWLO6V9o3+K+L/ffKwUrpYSdkTEiMZG5lxFe//cCm YCSw== X-Gm-Message-State: AOJu0YxZnVDKhbm0fnYRKSv8ZjUxQweQr4wnvFXQF5L+k7ds6akyUioI 6j4/HMujiy9Jii4S56SgJ+QZ+De7qio= X-Google-Smtp-Source: AGHT+IHvUNeOhaQWw6CCx1EWZHXx3iw6PeB+tS0sxfVQwxdwrrwQoELzEKBJOI1pqZU4qVx1RuRODw== X-Received: by 2002:a2e:8891:0:b0:2bc:b54b:c024 with SMTP id k17-20020a2e8891000000b002bcb54bc024mr3792785lji.29.1695581909944; Sun, 24 Sep 2023 11:58:29 -0700 (PDT) Received: from Methadon ([2a02:908:d13:e3e0:6a54:5aff:fe66:a805]) by smtp.gmail.com with ESMTPSA id va1-20020a17090711c100b00992ea405a79sm5279188ejb.166.2023.09.24.11.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 11:58:29 -0700 (PDT) References: <868r8xrxu4.fsf@gmail.com> User-agent: mu4e 1.10.7; emacs 29.0.92 From: Malte Frank Gerdes Date: Sun, 24 Sep 2023 20:48:44 +0200 In-reply-to: Message-ID: <86cyy75rg1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: 2.77 X-Migadu-Spam-Score: 2.77 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 572C24AD68 X-TUID: Rf3wUomJTK9x Saku Laesvuori writes: > [[PGP Signed Part:Undecided]] > On Sat, Sep 23, 2023 at 12:19:10PM +0200, Malte Frank Gerdes wrote: >> I noticed that after connecting via ssh the profile that gets created >> when doing `guix shell' is not sourced, therefore the environment >> variables are not correct. This seems to be because guix home inserts >> "[ -n \"$SSH_CLIENT\" ] && source /etc/profile" into the zshenv file. I >> assume this is meant to ensure that /etc/profile is sourced because ssh >> does not start a login shell? > > That is correct, it was added in > because commands like `ssh host -- cmd` (and commands depending on ssh > such as `git pull/push`) failed. Ah, i didn't think about this use case. >> Anyway, removing that line makes everything work normally. So am i >> doing it wrong or is this actually unnecessary? > > I can reproduce this: > > ``` > $ 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/s= tore/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. This is just a wild guess though. mfg=C2=B2