From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikael Djurfeldt Subject: bug#40125: Problem with guix offload: Remote channel closed Date: Mon, 23 Mar 2020 00:12:47 +0100 Message-ID: References: <87eetl1zce.fsf@gnu.org> <87pnd5wdyq.fsf@gnu.org> <8736a0uni2.fsf@gnu.org> <87d0943tuy.fsf@devup.no> <87a7483sk0.fsf@devup.no> Reply-To: mikael@djurfeldt.com Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000cfd22005a179a85e" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59324) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jG9n9-00032r-8f for bug-guix@gnu.org; Sun, 22 Mar 2020 19:14:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jG9n7-0000vU-Ur for bug-guix@gnu.org; Sun, 22 Mar 2020 19:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45167) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jG9n7-0000vQ-SQ for bug-guix@gnu.org; Sun, 22 Mar 2020 19:14:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jG9n7-0001Uh-NT for bug-guix@gnu.org; Sun, 22 Mar 2020 19:14:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87a7483sk0.fsf@devup.no> 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-mx.org@gnu.org Sender: "bug-Guix" To: Marius Bakke Cc: 40125@debbugs.gnu.org --000000000000cfd22005a179a85e Content-Type: text/plain; charset="UTF-8" On Sun, Mar 22, 2020 at 11:59 PM Marius Bakke wrote: > Mikael Djurfeldt writes: > > >> It might be .bashrc is configured not to source the relevant scripts > >> when being invoked non-interactively, and/or through an SSH session. > >> > > > > You're right. It doesn't source the scripts. The PATH only becomes > > /usr/local/bin:/usr/bin:/bin:/usr/games in this case. > > On Guix System, the default .bashrc does this: > > if [[ $- != *i* ]] > then > # We are being invoked from a non-interactive shell. If this > # is an SSH session (as in "ssh host command"), source > # /etc/profile so we get PATH and other essential variables. > [[ -n "$SSH_CLIENT" ]] && source /etc/profile > > # Don't do anything else. > return > fi > > IIRC Debian does something similar to detect if being invoked > non-interactively, but then just returns instead of sourcing anything. > > Adding a line that sources ~/.guix-profile/etc/profile before the check > for an interactive shell might be enough in that case. > I examined this a bit. You're right about .bashrc. But sourcing that profile is not sufficient. Just as a test, I enabled user specified environments in sshd_config (such that ssh reads .ssh/environment) and added the following there: PATH=/gnu/store/0awhym5h0m890n0wq87y0dxznh14rk88-guile-next-3.0.1/bin:/home/guix/.guix-profile/bin:/usr/local/bin:/usr/bin:/bin:/usr/games GUILE_LOAD_COMPILED_PATH=/gnu/store/nkh7c4ygaivfxdq3zhccl4a5qxrn6s88-guix-module-union/lib/guile/3.0/site-ccache:/gnu/store/0awhym5h0m890n0wq87y0dxznh14rk88-guile-next-3.0.1/lib/guile/3.0/ccache GUILE_LOAD_PATH=/gnu/store/nkh7c4ygaivfxdq3zhccl4a5qxrn6s88-guix-module-union/share/guile/site/3.0:/gnu/store/0awhym5h0m890n0wq87y0dxznh14rk88-guile-next-3.0.1/share/guile/3.0 GUIX_PROFILE=/home/guix/.guix-profile GUIX_LOCPATH=/home/guix/.guix-profile/lib/locale This made the offload test work. Crucial here is the PATH to guile 3.0.1 as well as the GUILE_LOAD_* paths. But how are these *supposed* to be setup on the build host??? --000000000000cfd22005a179a85e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Mar 22, 2020 at 11:59 PM Marius B= akke <mbakke@fastmail.com>= wrote:
Mikael Djurfeldt <mikael@djurfeldt.com> writes:

>> It might be .bashrc is configured not to source the relevant scrip= ts
>> when being invoked non-interactively, and/or through an SSH sessio= n.
>>
>
> You're right. It doesn't source the scripts. The PATH only bec= omes
> /usr/local/bin:/usr/bin:/bin:/usr/games in this case.

On Guix System, the default .bashrc does this:

if [[ $- !=3D *i* ]]
then
=C2=A0 =C2=A0 # We are being invoked from a non-interactive shell.=C2=A0 If= this
=C2=A0 =C2=A0 # is an SSH session (as in "ssh host command"), sou= rce
=C2=A0 =C2=A0 # /etc/profile so we get PATH and other essential variables.<= br> =C2=A0 =C2=A0 [[ -n "$SSH_CLIENT" ]] && source /etc/profi= le

=C2=A0 =C2=A0 # Don't do anything else.
=C2=A0 =C2=A0 return
fi

IIRC Debian does something similar to detect if being invoked
non-interactively, but then just returns instead of sourcing anything.

Adding a line that sources ~/.guix-profile/etc/profile before the check
for an interactive shell might be enough in that case.

I examined this a bit. You're right about .bashrc. But = sourcing that profile is not sufficient.

Just as a= test, I enabled user specified environments in sshd_config (such that ssh = reads .ssh/environment) and added the following there:

=
PATH=3D/gnu/store/0awhym5h0m890n0wq87y0dxznh14rk88-guile-next-3.0.1/bi= n:/home/guix/.guix-profile/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
G= UILE_LOAD_COMPILED_PATH=3D/gnu/store/nkh7c4ygaivfxdq3zhccl4a5qxrn6s88-guix-= module-union/lib/guile/3.0/site-ccache:/gnu/store/0awhym5h0m890n0wq87y0dxzn= h14rk88-guile-next-3.0.1/lib/guile/3.0/ccache
GUILE_LOAD_PATH=3D/gnu/sto= re/nkh7c4ygaivfxdq3zhccl4a5qxrn6s88-guix-module-union/share/guile/site/3.0:= /gnu/store/0awhym5h0m890n0wq87y0dxznh14rk88-guile-next-3.0.1/share/guile/3.= 0
GUIX_PROFILE=3D/home/guix/.guix-profile
GUIX_LOCPATH=3D/home/guix/.= guix-profile/lib/locale

This made the offload test= work.

Crucial here is the PATH to guile 3.0.1 as = well as the GUILE_LOAD_* paths.

But how are these = *supposed* to be setup on the build host???
--000000000000cfd22005a179a85e--