GNU bug report logs - #36785
'sudo guix pull' failure in the profile migration code

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Julien Lepiller <julien@HIDDEN>; merged with #37148; Done: Ludovic Courtès <ludo@HIDDEN>; Maintainer for guix is bug-guix@HIDDEN.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 27 Sep 2019 15:23:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 27 11:23:50 2019
Received: from localhost ([127.0.0.1]:48427 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iDs61-0002vE-Qf
	for submit <at> debbugs.gnu.org; Fri, 27 Sep 2019 11:23:50 -0400
Received: from mail-pl1-f193.google.com ([209.85.214.193]:35106)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1iDs60-0002ut-IQ
 for 36785 <at> debbugs.gnu.org; Fri, 27 Sep 2019 11:23:49 -0400
Received: by mail-pl1-f193.google.com with SMTP id y10so1239852plp.2
 for <36785 <at> debbugs.gnu.org>; Fri, 27 Sep 2019 08:23:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=0ihRbxNfOUYhxhp7ucfZ7eI00ORQWyEP2t0Gl+0vIZU=;
 b=T1Ba/aNQHfwJtKfoZVXiMkvyogD5706xfLZZvjpWxxUq+dJySY4O4wR3i+nYwygzlv
 pV+WxeeSilegXua2ko7SCCqqe7UkLnTkOJoiMFWEWzH8jfPaHyzxcEn3uriLwNHBpaN0
 QlAfp5BVqs1MpT5mt/wY72R0nQ6qREocE6IhEnS1JKByAUFc75UEIjH07O2x6ero3xOP
 uSe0GMTv7mdYP1AyEyz0b3DgmQFTg1j5l0r9QY/pO6dKiGKn1EJY/CpGLtwdtREq22/m
 qkxplXJb2hkrg0Urg4TNFuM2KiYs+JqzfEUtlAxBP6uUeSwtJWNyJq0zXr2kiy/QXaSf
 6qjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=0ihRbxNfOUYhxhp7ucfZ7eI00ORQWyEP2t0Gl+0vIZU=;
 b=hNA8KLnV9QfxSPGzhNcM2srQkWjmXO7Ije1xwwGuRtyiu0r79sUTPMtkexSOgYMrIB
 mVGZir77ScLK9LQnr+0hxiysMFoxKy1LMpRAzgMoRvR1u3UZ+dtrajFtYl+QjN8jooqj
 ZRF8xnYiBEEVQ/vEoPQcWNWbzUvf1dsagir3Sv+DKXGEpnurEeo6NIqI3MpTX6GnfdEk
 HkM9xtZrM4FX9ZXE2wdu8fKySHgy0pc6/EvRerO8q1ikALu8iuVW27CY6ITVUSs3zgT+
 684atoccbRbiaaSnTaQJJtS4vdznpY1mlhecux3J0XsEdp4pPJFhYuGsFy7L0q+7Xozz
 J8oQ==
X-Gm-Message-State: APjAAAUEDd0zP89KmsSqSFm5lMeTPz1i3xMKjVSZnL1WjbXfx0DaRyEP
 fPkvzQYX2CjNeuF/fLDEo2L94dYArRM=
X-Google-Smtp-Source: APXvYqw//ILSSYMz720/qTqTdbD3pG/U38fKWETOVim2aB2mklarcfFXO9kzRI7+lHJRJZ+Tv0nfSQ==
X-Received: by 2002:a17:902:8ec2:: with SMTP id
 x2mr5088152plo.250.1569597822502; 
 Fri, 27 Sep 2019 08:23:42 -0700 (PDT)
Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6])
 by smtp.gmail.com with ESMTPSA id i10sm2953608pfa.70.2019.09.27.08.23.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 27 Sep 2019 08:23:38 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN>
 <87pnjt6dbf.fsf@HIDDEN> <87d0frl8js.fsf@HIDDEN>
 <871rw7f6j3.fsf@HIDDEN> <87d0fpkgz7.fsf@HIDDEN>
Date: Sat, 28 Sep 2019 00:23:34 +0900
In-Reply-To: <87d0fpkgz7.fsf@HIDDEN> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Tue, 24 Sep 2019 14:37:32 +0200")
Message-ID: <8736ghdaq1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org,
 =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi!

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

[...]

> It=E2=80=99s a paragraph that explains how to upgrade Guix System, so I t=
hink
> foreign distros should be discussed elsewhere.  (I appreciate your
> attempt to add proper documentation about that for foreign distros!)
>
>> what my commits aim to do is make them generally true regardless of
>> In the commit message I wrote:
>>
>>    Although this section is specific to Guix System, it is likely to be
>>    read by users of foreign GNU/Linux distributions as well.  Remove the
>>    note, given that sudo doesn't preserve the user's PATH on foreign
>>    distributions such as Debian.
>
> But users of foreign distros would hopefully realize that =E2=80=98guix s=
ystem
> reconfigure=E2=80=99 (in the same snippet) is not for them.  :-)

I've been guilty myself of using C-s or 'i' in the manual and reading
something that didn't apply to my system but *did* match my
search... :-)=20

>> What about adding a section that we could call =E2=80=9CUpgrading Guix=
=E2=80=9D
> under =E2=80=9CApplication Setup=E2=80=9D, which is where setup on foreig=
n distros is
> discussed?
>
> The section could say:
>
>   1. Run =E2=80=98guix pull=E2=80=99 to upgrade Guix.
>
>   2. When you need to upgrade the build daemon, for instance, which runs
>      as root, run:
>
>        sudo -i guix pull
>
> How does that sound?

This sounds much simpler than attempting to twist some other section
into something it wasn't really meant for ;-).

I've attached a simple patch implementing the idea.

Thanks for your patience!

Maxim


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: attachment;
 filename=0001-doc-Add-a-Upgrading-Guix-section-to-the-Installation.patch
Content-Transfer-Encoding: quoted-printable

From a289eb3fd6239287d4a802fbba69abf21604591f Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Date: Sat, 28 Sep 2019 00:11:28 +0900
Subject: [PATCH] doc: Add a 'Upgrading Guix' section to the 'Installation'
 chapter.
MIME-Version: 1.0
Content-Type: text/plain; charset=3DUTF-8
Content-Transfer-Encoding: 8bit

This follows a discussion regarding issue #36785 (see:
https://bugs.gnu.org/36785).

* doc/guix.texi (Upgrading Guix): New section.

Co-authored-by: Ludovic Court=C3=A8s <ludo@HIDDEN>
---
 doc/guix.texi | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 9fcce27597..45e6dfc442 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -513,6 +513,7 @@ ready to use it.
 * Setting Up the Daemon::       Preparing the build daemon's environment.
 * Invoking guix-daemon::        Running the build daemon.
 * Application Setup::           Application-specific setup.
+* Upgrading Guix::              Upgrading Guix and its build daemon.
 @end menu
=20
 @node Binary Installation
@@ -1777,6 +1778,28 @@ invoke the actual linker with this new set of argume=
nts.  You can instruct the
 wrapper to refuse to link against libraries not in the store by setting the
 @code{GUIX_LD_WRAPPER_ALLOW_IMPURITIES} environment variable to @code{no}.
=20
+@node Upgrading Guix
+@section Upgrading Guix
+
+@cindex Upgrading Guix, on a foreign distro
+
+To upgrade Guix, run:
+
+@example
+guix pull
+@end example
+
+@cindex Upgrading Guix for the root user, on a foreign distro
+@cindex Upgrading the Guix daemon, on a foreign distro
+@cindex @command{guix pull} for the root user, on a foreign distro
+
+When you need to upgrade the build daemon, for instance, which runs as
+root, run:
+
+@example
+sudo -i guix pull
+@end example
+
 @c TODO What else?
=20
 @c *********************************************************************
--=20
2.23.0


--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 24 Sep 2019 12:37:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 24 08:37:42 2019
Received: from localhost ([127.0.0.1]:37870 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iCk4c-0002Fa-IW
	for submit <at> debbugs.gnu.org; Tue, 24 Sep 2019 08:37:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42794)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iCk4b-0002FO-2v
 for 36785 <at> debbugs.gnu.org; Tue, 24 Sep 2019 08:37:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:40452)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iCk4V-0000l4-Tn; Tue, 24 Sep 2019 08:37:35 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=41482 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iCk4U-0002i7-If; Tue, 24 Sep 2019 08:37:35 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN>
 <87pnjt6dbf.fsf@HIDDEN> <87d0frl8js.fsf@HIDDEN>
 <871rw7f6j3.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 3 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Tue, 24 Sep 2019 14:37:32 +0200
In-Reply-To: <871rw7f6j3.fsf@HIDDEN> (Maxim Cournoyer's message of "Mon, 23
 Sep 2019 23:09:52 +0900")
Message-ID: <87d0fpkgz7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org,
 =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:
>
>> Hi Maxim,
>>
>> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:
>>
>>> --- a/doc/guix.texi
>>> +++ b/doc/guix.texi
>>> @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System!  Fro=
m then on, you can update the
>>>  system whenever you want by running, say:
>>>=20=20
>>>  @example
>>> -guix pull
>>> -sudo guix system reconfigure /etc/config.scm
>>> +sudo -i guix pull
>>> +sudo -i guix system reconfigure /etc/config.scm
>>>  @end example
>>>=20=20
>>>  @noindent
>>> @@ -2396,14 +2396,6 @@ This builds a new system generation with the lat=
est packages and services
>>>  (@pxref{Invoking guix system}).  We recommend doing that regularly so =
that
>>>  your system includes the latest security updates (@pxref{Security Upda=
tes}).
>>>=20=20
>>> -@c See <https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268=
.html>.
>>> -@quotation Note
>>> -@cindex sudo vs. @command{guix pull}
>>> -Note that @command{sudo guix} runs your user's @command{guix} command =
and
>>> -@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged=
.  To
>>> -explicitly run root's @command{guix}, type @command{sudo -i guix @dots=
{}}.
>>> -@end quotation
>>
>> I think these bits were correct.
>
> They are correct when applied to a Guix System;

It=E2=80=99s a paragraph that explains how to upgrade Guix System, so I thi=
nk
foreign distros should be discussed elsewhere.  (I appreciate your
attempt to add proper documentation about that for foreign distros!)

> what my commits aim to do is make them generally true regardless of
> In the commit message I wrote:
>
>    Although this section is specific to Guix System, it is likely to be
>    read by users of foreign GNU/Linux distributions as well.  Remove the
>    note, given that sudo doesn't preserve the user's PATH on foreign
>    distributions such as Debian.

But users of foreign distros would hopefully realize that =E2=80=98guix sys=
tem
reconfigure=E2=80=99 (in the same snippet) is not for them.  :-)

What about adding a section that we could call =E2=80=9CUpgrading Guix=E2=
=80=9D
under =E2=80=9CApplication Setup=E2=80=9D, which is where setup on foreign =
distros is
discussed?

The section could say:

  1. Run =E2=80=98guix pull=E2=80=99 to upgrade Guix.

  2. When you need to upgrade the build daemon, for instance, which runs
     as root, run:

       sudo -i guix pull

How does that sound?

Thanks,
Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 14:10:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 23 10:10:06 2019
Received: from localhost ([127.0.0.1]:36692 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iCP2T-00061A-PN
	for submit <at> debbugs.gnu.org; Mon, 23 Sep 2019 10:10:06 -0400
Received: from mail-pg1-f176.google.com ([209.85.215.176]:41628)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1iCP2R-00060Z-TU
 for 36785 <at> debbugs.gnu.org; Mon, 23 Sep 2019 10:10:04 -0400
Received: by mail-pg1-f176.google.com with SMTP id s1so6966601pgv.8
 for <36785 <at> debbugs.gnu.org>; Mon, 23 Sep 2019 07:10:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=Jpm0RPVnSQtv18O7NnlbQ/xDjSgoXqQ5FOw6nhQIjXo=;
 b=n9ja68GZzDJfR1d5O8bRmYmiC44nyN68Qqv5oLKrRYpw4ECVP0mTTXYwUaxBXT6AHb
 yGTg3WGSP5jntaJrB040TCDMkuVjasHzrfdHus/UgjMr6qnrOpjzKA4l7O6kAfwHI9zD
 DFCP4gp2kjiNEbVoxVCS7+DngVJtzDQDCNNrB9zxZVXGu7RlJtaj22Z+/YGrQOkCedwD
 qFW0KdoGMmY33jz9/+O4VvfjcrlNuqIByyc5qow97vU6343nCv8865VGwBkSbUHXVZFW
 WuGxBwCtmSGZWey32CI4DdpuFYCnnjlP4C++qR+6Nxir2QOuwz/7RZotDZj0BMmIgxit
 fMRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=Jpm0RPVnSQtv18O7NnlbQ/xDjSgoXqQ5FOw6nhQIjXo=;
 b=d/xoOKPjM1TDOabClRUY0aTh/D6Iw5qapefi4txARpyIGiGntwq+94POWKNcvTVOdT
 I6eriQ/mJSxyZyBZPnFgHFBxR0PLIVTHmDXmz0M0DtTG8cWukJiYbaeLj6ViQBQgbP2g
 Aei/VzYqYranpy3+nxWcp2CRD7QaILwxB6g7YE3WUfrBWvfW/8Cb43ylc+Q5jUqgaYaH
 CKY3WvHb7DR6rDsvS4QTLuOl9Ofk8Rma/B4CfsntJ24H8HYY1hH9yo8R0+o4hPbrWaHd
 QEdhvUqAmGB4+SjmFfiSM5U8XAzxju4MmMcBXTZPF3BruMkOkoGw1GVPMQWBEdJwq179
 qGUA==
X-Gm-Message-State: APjAAAVBSutRACsYqveqH6L2/IMxVtKIggzH+djWhfpEyB71fj9adPwg
 IxrBQxppdBvHtMBDO5H9RT0seg5y
X-Google-Smtp-Source: APXvYqxOcWmzfTiphVO6Km5AmSyx7+XIiZbLCP2HhVQcAUFZ7q2z28FwlZLNUiMIKP3YNL9DNEVFgA==
X-Received: by 2002:a63:184:: with SMTP id 126mr170599pgb.350.1569247797859;
 Mon, 23 Sep 2019 07:09:57 -0700 (PDT)
Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6])
 by smtp.gmail.com with ESMTPSA id e127sm11260071pfe.37.2019.09.23.07.09.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 23 Sep 2019 07:09:56 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN>
 <87pnjt6dbf.fsf@HIDDEN> <87d0frl8js.fsf@HIDDEN>
Date: Mon, 23 Sep 2019 23:09:52 +0900
In-Reply-To: <87d0frl8js.fsf@HIDDEN> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Mon, 23 Sep 2019 10:29:43 +0200")
Message-ID: <871rw7f6j3.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org,
 =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:
>
>> --- a/doc/guix.texi
>> +++ b/doc/guix.texi
>> @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System!  From=
 then on, you can update the
>>  system whenever you want by running, say:
>>=20=20
>>  @example
>> -guix pull
>> -sudo guix system reconfigure /etc/config.scm
>> +sudo -i guix pull
>> +sudo -i guix system reconfigure /etc/config.scm
>>  @end example
>>=20=20
>>  @noindent
>> @@ -2396,14 +2396,6 @@ This builds a new system generation with the late=
st packages and services
>>  (@pxref{Invoking guix system}).  We recommend doing that regularly so t=
hat
>>  your system includes the latest security updates (@pxref{Security Updat=
es}).
>>=20=20
>> -@c See <https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.=
html>.
>> -@quotation Note
>> -@cindex sudo vs. @command{guix pull}
>> -Note that @command{sudo guix} runs your user's @command{guix} command a=
nd
>> -@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged.=
  To
>> -explicitly run root's @command{guix}, type @command{sudo -i guix @dots{=
}}.
>> -@end quotation
>
> I think these bits were correct.

They are correct when applied to a Guix System; what my commits aim to
do is make them generally true regardless of the Guix System vs foreign
distro situation, in an attempt to negate possible confusion.  It's not
succeeding, obviously :-).

I had modified that bit of the manual because that's apparently the only
place where we mention 'sudo guix pull' in the manual.

In the commit message I wrote:

   Although this section is specific to Guix System, it is likely to be
   read by users of foreign GNU/Linux distributions as well.  Remove the
   note, given that sudo doesn't preserve the user's PATH on foreign
   distributions such as Debian.

> That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D i=
s looked up in the user=E2=80=99s
> $PATH, not in root=E2=80=99s $PATH.  That=E2=80=99s what led to this text=
 in commit
> 796a4491fdaa4a0a3d669457b89356f9fbfc966e.
>
> So this part is fine.
>
> Perhaps we need another section for this?  Or perhaps we can drop the
> ball=E2=80=A6

Agreed, until more real use cases come so that the proper solution can
be more clear (in regards to what needs to be changed in the manual).

Maxim




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 12:48:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 23 08:48:51 2019
Received: from localhost ([127.0.0.1]:35316 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iCNlr-0001MA-Cu
	for submit <at> debbugs.gnu.org; Mon, 23 Sep 2019 08:48:51 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43682)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iCNlp-0001Ly-Nw
 for 36785 <at> debbugs.gnu.org; Mon, 23 Sep 2019 08:48:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49607)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iCNlk-0007kE-I1; Mon, 23 Sep 2019 08:48:44 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43196 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iCNlj-00057T-TT; Mon, 23 Sep 2019 08:48:44 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN>
 <87pnjt6dbf.fsf@HIDDEN> <87d0frl8js.fsf@HIDDEN>
 <CAE4v=ph=CNvo9isFRzrv3GoqHK8njLZHsTrCzsOMCD2HKj2U=A@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 2 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 23 Sep 2019 14:48:40 +0200
In-Reply-To: <CAE4v=ph=CNvo9isFRzrv3GoqHK8njLZHsTrCzsOMCD2HKj2U=A@HIDDEN>
 (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Mon, 23 Sep 2019
 11:00:48 +0200")
Message-ID: <87h853jhzr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi G=C3=A1bor,

G=C3=A1bor Boskovits <boskovits@HIDDEN> skribis:

> I believe sudo -H would work in all distros for doing a root guix pull. C=
an
> someone confirm?

I think so, yes.

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 09:01:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 23 05:01:12 2019
Received: from localhost ([127.0.0.1]:35040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iCKDW-0003wE-B4
	for submit <at> debbugs.gnu.org; Mon, 23 Sep 2019 05:01:12 -0400
Received: from mail-ed1-f45.google.com ([209.85.208.45]:41050)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boskovits@HIDDEN>) id 1iCKDT-0003vm-0j
 for 36785 <at> debbugs.gnu.org; Mon, 23 Sep 2019 05:01:08 -0400
Received: by mail-ed1-f45.google.com with SMTP id f20so12094658edv.8
 for <36785 <at> debbugs.gnu.org>; Mon, 23 Sep 2019 02:01:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=UZiQvYp7FS9rsOY+z9PWW2bM+ocTZ4YI7fvfLpUJPoQ=;
 b=t27FeaTNVzKCdIkH6Rhdb9yLAZNeod6GqTWCMD9WNohW5MvDqwXg3xj9PnnW4JH8z9
 ZqpybQ7olAEZI8iQcHSLAbH9CO8tBqblsY+Dm/HVw4QV2uKLBYMnAjsG+H+mxDEeL1aO
 +vjFpXaa6L/gv72joVtAEsCxoaefJ8U4P2I8eDk5NNJV87UEZX6PISx8zJEvFA/d9FkM
 uuH8fGVVtnNnOr1eHU8dZep/QaSwX+dfRYuH9qqM+0YatYCpqduRhxx7HRK+NOJmMU6k
 mUiQGr2oRvL4TA1gHf351knx19yjAhlYRo8//7ooPzPLi6AodJUrTjS2huMTekd8mlVm
 Ej5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=UZiQvYp7FS9rsOY+z9PWW2bM+ocTZ4YI7fvfLpUJPoQ=;
 b=g6qVAXsWpGhx1g7U3h344KBlReX2socMI/Na9J94093onikDo+ezgAoXPOx7mm/jfV
 i6tazdJD5qSwrMS0g45UsW8et/JZgC6Kcm3kGICbhPrBN9W9ILkALOpRgDdZiSXpgqTL
 r0kecMtV5V6lckF3g2OH0DlRJ0YVj+modXM7QZVjv3L+K4o5tk5iqdml0/kI/uLOw9Vp
 SMXA/Ax9byMGf6CPVPuShxoKlDRu4S4R3+Jq9y4sVQ2wYXFAnDJyF5ovUPoKJAjsoct3
 XrVGGLgnDvkPlOJOE+iFU1s3DI4RYV1NJRDGo1SivTl6CSM1EEOEW6+/brsluQPWP140
 KM5g==
X-Gm-Message-State: APjAAAWVX3LD9zQDZCLJ9Xbk94pfgQGPLukaYyjG21hiLCISqfzP6yY1
 RqiIqVcRD6SKrLbjGeE8dOMqCmdceFKefPUZuA==
X-Google-Smtp-Source: APXvYqz7tMuNcNg0ZhkFis/3EWnaP2sWZR4LwGPDiB0OtZN0B9xYTOhgQb/OmnzZMtbVi2IC9ZX67KnushV2s2HHCuw=
X-Received: by 2002:a17:906:f259:: with SMTP id
 gy25mr29738224ejb.2.1569229261043; 
 Mon, 23 Sep 2019 02:01:01 -0700 (PDT)
MIME-Version: 1.0
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN> <87pnjt6dbf.fsf@HIDDEN>
 <87d0frl8js.fsf@HIDDEN>
In-Reply-To: <87d0frl8js.fsf@HIDDEN>
From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= <boskovits@HIDDEN>
Date: Mon, 23 Sep 2019 11:00:48 +0200
Message-ID: <CAE4v=ph=CNvo9isFRzrv3GoqHK8njLZHsTrCzsOMCD2HKj2U=A@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000ad0be8059334a83c"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000ad0be8059334a83c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ludovic Court=C3=A8s <ludo@HIDDEN> ezt =C3=ADrta (id=C5=91pont: 2019. szep=
t. 23., H=C3=A9t
10:29):

> Hi Maxim,
>
> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:
>
> > --- a/doc/guix.texi
> > +++ b/doc/guix.texi
> > @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System!  Fro=
m
> then on, you can update the
> >  system whenever you want by running, say:
> >
> >  @example
> > -guix pull
> > -sudo guix system reconfigure /etc/config.scm
> > +sudo -i guix pull
> > +sudo -i guix system reconfigure /etc/config.scm
> >  @end example
> >
> >  @noindent
> > @@ -2396,14 +2396,6 @@ This builds a new system generation with the
> latest packages and services
> >  (@pxref{Invoking guix system}).  We recommend doing that regularly so
> that
> >  your system includes the latest security updates (@pxref{Security
> Updates}).
> >
> > -@c See <
> https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.html>.
> > -@quotation Note
> > -@cindex sudo vs. @command{guix pull}
> > -Note that @command{sudo guix} runs your user's @command{guix} command
> and
> > -@emph{not} root's, because @command{sudo} leaves @code{PATH}
> unchanged.  To
> > -explicitly run root's @command{guix}, type @command{sudo -i guix
> @dots{}}.
> > -@end quotation
>
> I think these bits were correct.
>
> That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D i=
s looked up in the user=E2=80=99s
> $PATH, not in root=E2=80=99s $PATH.  That=E2=80=99s what led to this text=
 in commit
> 796a4491fdaa4a0a3d669457b89356f9fbfc966e.
>
> So this part is fine
>
I believe sudo -H would work in all distros for doing a root guix pull. Can
someone confirm?

>
> Perhaps we need another section for this?  Or perhaps we can drop the
> ball=E2=80=A6
>
> Thanks,
> Ludo=E2=80=99.
>
Best regards,
g_bor

>

--000000000000ad0be8059334a83c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">Ludovic Court=C3=A8s &lt;<a href=3D"mailto:ludo@HIDDEN=
g">ludo@HIDDEN</a>&gt; ezt =C3=ADrta (id=C5=91pont: 2019. szept. 23., H=C3=
=A9t 10:29):<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Maxim,<br>
<br>
Maxim Cournoyer &lt;<a href=3D"mailto:maxim.cournoyer@HIDDEN" target=3D"=
_blank" rel=3D"noreferrer">maxim.cournoyer@HIDDEN</a>&gt; skribis:<br>
<br>
&gt; --- a/doc/guix.texi<br>
&gt; +++ b/doc/guix.texi<br>
&gt; @@ -2387,8 +2387,8 @@ Success, you&#39;ve now booted into Guix System!=
=C2=A0 From then on, you can update the<br>
&gt;=C2=A0 system whenever you want by running, say:<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 @example<br>
&gt; -guix pull<br>
&gt; -sudo guix system reconfigure /etc/config.scm<br>
&gt; +sudo -i guix pull<br>
&gt; +sudo -i guix system reconfigure /etc/config.scm<br>
&gt;=C2=A0 @end example<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 @noindent<br>
&gt; @@ -2396,14 +2396,6 @@ This builds a new system generation with the la=
test packages and services<br>
&gt;=C2=A0 (@pxref{Invoking guix system}).=C2=A0 We recommend doing that re=
gularly so that<br>
&gt;=C2=A0 your system includes the latest security updates (@pxref{Securit=
y Updates}).<br>
&gt;=C2=A0 <br>
&gt; -@c See &lt;<a href=3D"https://lists.gnu.org/archive/html/guix-devel/2=
019-01/msg00268.html" rel=3D"noreferrer noreferrer" target=3D"_blank">https=
://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.html</a>&gt;.<br>
&gt; -@quotation Note<br>
&gt; -@cindex sudo vs. @command{guix pull}<br>
&gt; -Note that @command{sudo guix} runs your user&#39;s @command{guix} com=
mand and<br>
&gt; -@emph{not} root&#39;s, because @command{sudo} leaves @code{PATH} unch=
anged.=C2=A0 To<br>
&gt; -explicitly run root&#39;s @command{guix}, type @command{sudo -i guix =
@dots{}}.<br>
&gt; -@end quotation<br>
<br>
I think these bits were correct.<br>
<br>
That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D is =
looked up in the user=E2=80=99s<br>
$PATH, not in root=E2=80=99s $PATH.=C2=A0 That=E2=80=99s what led to this t=
ext in commit<br>
796a4491fdaa4a0a3d669457b89356f9fbfc966e.<br>
<br>
So this part is fine<br></blockquote></div></div><div dir=3D"auto">I believ=
e sudo -H would work in all distros for doing a root guix pull. Can someone=
 confirm?</div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex">
<br>
Perhaps we need another section for this?=C2=A0 Or perhaps we can drop the<=
br>
ball=E2=80=A6<br>
<br>
Thanks,<br>
Ludo=E2=80=99.<br></blockquote></div></div><div dir=3D"auto">Best regards,<=
/div><div dir=3D"auto">g_bor</div><div dir=3D"auto"><div class=3D"gmail_quo=
te"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>

--000000000000ad0be8059334a83c--




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 23 Sep 2019 08:29:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 23 04:29:55 2019
Received: from localhost ([127.0.0.1]:35026 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iCJjH-0003CO-49
	for submit <at> debbugs.gnu.org; Mon, 23 Sep 2019 04:29:55 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38061)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iCJjF-0003CB-Pq
 for 36785 <at> debbugs.gnu.org; Mon, 23 Sep 2019 04:29:54 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46373)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iCJjA-0007gW-4N; Mon, 23 Sep 2019 04:29:48 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=37266 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iCJj8-0003pa-Jx; Mon, 23 Sep 2019 04:29:47 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN>
 <87pnjt6dbf.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 2 =?utf-8?Q?Vend=C3=A9miaire?= an 228 de la
 =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Mon, 23 Sep 2019 10:29:43 +0200
In-Reply-To: <87pnjt6dbf.fsf@HIDDEN> (Maxim Cournoyer's message of "Sat, 21
 Sep 2019 21:31:16 +0900")
Message-ID: <87d0frl8js.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org,
 =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:

> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System!  From =
then on, you can update the
>  system whenever you want by running, say:
>=20=20
>  @example
> -guix pull
> -sudo guix system reconfigure /etc/config.scm
> +sudo -i guix pull
> +sudo -i guix system reconfigure /etc/config.scm
>  @end example
>=20=20
>  @noindent
> @@ -2396,14 +2396,6 @@ This builds a new system generation with the lates=
t packages and services
>  (@pxref{Invoking guix system}).  We recommend doing that regularly so th=
at
>  your system includes the latest security updates (@pxref{Security Update=
s}).
>=20=20
> -@c See <https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.h=
tml>.
> -@quotation Note
> -@cindex sudo vs. @command{guix pull}
> -Note that @command{sudo guix} runs your user's @command{guix} command and
> -@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged. =
 To
> -explicitly run root's @command{guix}, type @command{sudo -i guix @dots{}=
}.
> -@end quotation

I think these bits were correct.

That is, when running =E2=80=9Csudo foo=E2=80=9D, =E2=80=9Cfoo=E2=80=9D is =
looked up in the user=E2=80=99s
$PATH, not in root=E2=80=99s $PATH.  That=E2=80=99s what led to this text i=
n commit
796a4491fdaa4a0a3d669457b89356f9fbfc966e.

So this part is fine.

Perhaps we need another section for this?  Or perhaps we can drop the
ball=E2=80=A6

Thanks,
Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 21 Sep 2019 12:32:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 08:32:27 2019
Received: from localhost ([127.0.0.1]:59313 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iBeYs-0000t3-Oe
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2019 08:32:27 -0400
Received: from mail-pg1-f175.google.com ([209.85.215.175]:42414)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1iBeYq-0000sp-Ve
 for 36785 <at> debbugs.gnu.org; Sat, 21 Sep 2019 08:32:25 -0400
Received: by mail-pg1-f175.google.com with SMTP id z12so5357835pgp.9
 for <36785 <at> debbugs.gnu.org>; Sat, 21 Sep 2019 05:32:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:in-reply-to:references:user-agent:date
 :message-id:mime-version;
 bh=KQmvfzRztBB4rMdQrIPGUHhfrYCoNck4yorFAp0dml8=;
 b=udznSO+qW7URj71dmdF8LdPzMkGUui7NPWattFXodnfAoZprlvva6sjX+xsZ1IL8SY
 kPp1q8HisuzPfCx975L5L70gGu0AQyNqbhN7A9BViweWH6/X+iUrsSQh1knmwNw2Syn3
 hUKZyiKEnnG4TPftCqRVG8HXwcA6073vJyDQD903dycEYwaoqbHHW/kR6lQ/z/myvZUu
 2eaWr7RhMKlYqTvIazfezTKjrxIZvRkREyK3JSQdReqPix5BrcvxcYSxqmUZP5gFifsk
 1jKFJ+oSVwjDvmMjRP9TbXX61JXA13wlvVK/V2uUawbPAW+CKVhoKGYxBjdgiHplUzgr
 aubQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:in-reply-to:references
 :user-agent:date:message-id:mime-version;
 bh=KQmvfzRztBB4rMdQrIPGUHhfrYCoNck4yorFAp0dml8=;
 b=Yq6ggWGHX74H+DiFtYPO9J3RHc5l3wqSnHxtYiYLFDv8g9tDuTkdsoKy31GZnNL8cb
 loeaNPLiMlO2gfwBgtRRUgxTvSO+2AulOotukB1kkadREOPZVeHahK1eX95BFgH7A+zb
 LXQue8b4jKqKUkWE2mEvlvIc58c4tFPsANpDo/qyt/rnl7URMzpEGMywW9qwwnRMlx1W
 Kdt1B3fx5DoEY4A23RW8KD1tt50ST6Ahgl9lqqWOzK7UH2A5E9tEVAxiGRf/UuQWtYR6
 RYCKUD+GPEcqRgu81S4NN/d9u0aB0LOwsxIvyoaSEovunuKLRe/tVGGXD3IcirXgbBBx
 Yqvw==
X-Gm-Message-State: APjAAAX+C+unWpQX9RmjI6TlTFR+ME7I5uMJ+i3Hc+KmTvuIxhTkcYl0
 ISzCHg9HTCRTLOmtqP9hwCu/rIGCj4w=
X-Google-Smtp-Source: APXvYqzWPkTFXZst+Smwz6HbVEN1XSo8Z3JZiMvjWeUiLJkXeVB+t7BV24nzolPhwPBTyUmtyIXpIg==
X-Received: by 2002:a17:90a:8d84:: with SMTP id
 d4mr9958953pjo.139.1569069138786; 
 Sat, 21 Sep 2019 05:32:18 -0700 (PDT)
Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6])
 by smtp.gmail.com with ESMTPSA id b3sm7909252pfp.65.2019.09.21.05.32.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 21 Sep 2019 05:32:18 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
In-Reply-To: <87woe3otut.fsf@HIDDEN> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Fri, 20 Sep 2019 17:44:26 +0200")
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
Date: Sat, 21 Sep 2019 21:32:13 +0900
Message-ID: <87o8zd6d9u.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org,
 =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:
>
>> Indeed, the default recommended invocation to update the root's guix
>> could be changed to be 'sudo -i guix pull', which should work on all
>> systems including Ubuntu.
>
> Oh right.  Could you make this change in the manual?
>
> Thanks,
> Ludo=E2=80=99.

I looked at what was in the manual, and became less sure, thought maybe
'sudo -E' could be better, so I've done the following little experiment
using Docker to test an Ubuntu enviroment:

Here's the Dockerfile, with instructions to reproduce in it:

=2D-8<---------------cut here---------------start------------->8---
FROM ubuntu

RUN apt-get update && apt-get install sudo
RUN useradd -ms /bin/bash user
RUN usermod -aG sudo user
RUN echo user:user | chpasswd

USER user

CMD bash

# To test (in the directory where this file is written as 'Dockerfile'):
# docker build .
# docker run -it --rm <container_id>

# Then run the following commands:
# export PATH=3Dextra-stuff:$PATH
# sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"'
# sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"'
# sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"'
=2D-8<---------------cut here---------------end--------------->8---

And the result:

=2D-8<---------------cut here---------------start------------->8---
echo $PATH
echo $PATH
extra-stuff:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -E sh -c 'echo -e "env w=
hen using -E: \n$(env)\n\n"'
sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"'
=2De env when using -E:
SUDO_GID=3D1000
USER=3Droot
HOSTNAME=3De538556bf337
SHLVL=3D1
HOME=3D/home/user
SUDO_UID=3D1000
LOGNAME=3Droot
_=3D/usr/bin/sudo
TERM=3Dxterm
USERNAME=3Droot
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b=
in
LS_COLORS=3Drs=3D0:di=3D01;34:[...]

SUDO_COMMAND=3D/bin/sh -c echo -e "env when using -E:
$(env)

"
SHELL=3D/bin/bash
SUDO_USER=3Duser
PWD=3D/

0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -i sh -c 'echo -e "env w=
hen using -i: \n$(env)\n\n"'
sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"'
=2De env when using -i:
SUDO_GID=3D1000
MAIL=3D/var/mail/root
USER=3Droot
HOSTNAME=3De538556bf337
SHLVL=3D1
HOME=3D/root
SUDO_UID=3D1000
LOGNAME=3Droot
_=3D/bin/sh
USERNAME=3Droot
TERM=3Dxterm
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b=
in
LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...]

$(env)

"
SHELL=3D/bin/bash
SUDO_USER=3Duser
PWD=3D/root

user@e538556bf337: /=07user@e538556bf337:/$ sudo sh -c 'echo -e "env with p=
lain sudo: $(env)\n\n"'
sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"'
=2De env with plain sudo: SUDO_GID=3D1000
MAIL=3D/var/mail/root
USER=3Droot
HOSTNAME=3De538556bf337
HOME=3D/home/user
SUDO_UID=3D1000
LOGNAME=3Droot
TERM=3Dxterm
USERNAME=3Droot
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b=
in
LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...]
SUDO_COMMAND=3D/bin/sh -c echo -e "env with plain sudo: $(env)

"
SHELL=3D/bin/bash
SUDO_USER=3Duser
PWD=3D/
=2D-8<---------------cut here---------------end--------------->8---

What do we get from this?

Well, first, the user's PATH is *not* preserved when using 'sudo', at
least on Debian and Ubuntu.  These are configured out of the box to
reset the PATH to a 'safe' value, even when using the -E option of sudo.

We also see, as Ludovic found out, that the user's HOME is preserved for
the normal invocation of sudo on Ubuntu.

In light of this, I suggest the attached patch to our documentation.
It's a bit sub-optimal in that it modifies a section of the 'Guix
System', which behaved as described; but given that it's the only place
where we mention of 'sudo guix pull', better safe than sorry, I'd say
(foreign distribution users might read it, thinking it also applies to
themselves).

Does that seem worthwile/reasonable?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-doc-Adapt-the-guix-pull-command-recommendation.patch
Content-Transfer-Encoding: quoted-printable

From=20bfa2f754592a00fefa4fcd20080582268b6273dd Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Date: Sat, 21 Sep 2019 20:36:04 +0900
Subject: [PATCH] doc: Adapt the guix pull command recommendation.

This change follows the discussion for issue #36785 (see:
https://bugs.gnu.org/36785).

* doc/guix.texi (After System Installation): Add the '-i' sudo option to the
suggested commands used to keep a Guix System up-to-date.  Although this
section is specific to Guix System, it is likely to be read by users of
foreign GNU/Linux distributions as well.  Remove the note, given that sudo
doesn't preserve the user's PATH on foreign distributions such as Debian.
=2D--
 doc/guix.texi | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 0ed59072c9..3690e3b152 100644
=2D-- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System!  From th=
en on, you can update the
 system whenever you want by running, say:
=20
 @example
=2Dguix pull
=2Dsudo guix system reconfigure /etc/config.scm
+sudo -i guix pull
+sudo -i guix system reconfigure /etc/config.scm
 @end example
=20
 @noindent
@@ -2396,14 +2396,6 @@ This builds a new system generation with the latest =
packages and services
 (@pxref{Invoking guix system}).  We recommend doing that regularly so that
 your system includes the latest security updates (@pxref{Security Updates}=
).
=20
=2D@c See <https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.h=
tml>.
=2D@quotation Note
=2D@cindex sudo vs. @command{guix pull}
=2DNote that @command{sudo guix} runs your user's @command{guix} command and
=2D@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged. =
 To
=2Dexplicitly run root's @command{guix}, type @command{sudo -i guix @dots{}=
}.
=2D@end quotation
=2D
 Join us on @code{#guix} on the Freenode IRC network or on
 @email{guix-devel@@gnu.org} to share your experience!
=20
=2D-=20
2.23.0


--=-=-=
Content-Type: text/plain


Thanks,

Maxim

--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAl2GGE0ACgkQEmDkZILm
NWI2rA/+Lqr51Nxe5dPWfQAkpMgF5hkiM+akelRB4prEXFvqmkIOf7Vor6BUR2+X
xW9spQxzpt7lheP8dPsmFjMgLXdRir1Z+plqAnABIywwfL1jEicPWqxY7r3IdS54
f2w6s7p5AjjEftGHB0ixtrzLPRuxckCK1oBqpIJC+Bfq8fskw6q0qIiNbAoxwzGi
EzCZDsnU4TudJg5AlgZflZy89Fdm7zxaTVQRmuKsNx9AOq7xC3holCzZDVntZ252
UzU7EPhx8UaLFQrcefWTkSBF9jL5wCfN5ZoFpu8xo60EdAqgOaQW2MZxMH4WA/7l
PMMY7KA2QbpuIQfy8NzT9RItiVwztMB4sCBAy/hsgAca3FEPQb+TdCseRehh5WmF
HSzUqh1GZISzxr9SgFRnuKgZ80Sd/RhTCW4x9QARzmpn0lhRBvvUk/5Rwte6uH8Q
fCDDwZe4MBsoDu2GY/3BaQNcPb03XLre8fN/XO1qfzupOwe8uHQsC6ADSxTSlCkO
h1Bi/7+MVm3ILxCCksNG8RfG+trgnS5tErDnXm0CI0SSfX76vpzs53JJdk5qb2ds
8vLZ9+lmRHRYiypYSnBVBZvz/5WS49iP85tWbwlrtsUFlMfyBIe4l+3wN4Y8MzO0
Dq5ZXb3tmYHvJGCfo8qEDexXew4jL4WbZNoEwut083HGB441cDo=
=b+D6
-----END PGP SIGNATURE-----
--==-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 21 Sep 2019 12:31:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 08:31:31 2019
Received: from localhost ([127.0.0.1]:59309 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iBeXz-0000rF-6m
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2019 08:31:31 -0400
Received: from mail-pl1-f170.google.com ([209.85.214.170]:45856)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1iBeXx-0000r1-Aj
 for 36785 <at> debbugs.gnu.org; Sat, 21 Sep 2019 08:31:29 -0400
Received: by mail-pl1-f170.google.com with SMTP id u12so4436212pls.12
 for <36785 <at> debbugs.gnu.org>; Sat, 21 Sep 2019 05:31:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=gicE2Af+LD+7FiJCQKaRPmKCNLDQNn7HpgN91waxiQM=;
 b=vLtyCSDsz2XiLelV1fBZFZYbnhv3Bw3wiXgZIBN8qSzzqEvoudAHDq6XwBoPCSMzvd
 SUaLnkvve7I2jA597lLeiHR9/hQI/eElGmemD7Ccd0QZqJVCc6FIDEHaEeFR5m3dK59o
 u30uHhrI8HMMq49/LgtlYuDprMyLIfhhcnzjy9A4Eo1hIPX08t8NrY26MTm/Pb2E+gwP
 CHbWaSmsitMTpsyYW3AIe5FA8oB6Zp9UsG1xP8VU4nvVyLTB5Gv7tXIpb3G0d7S13N4E
 ZK0jT2jT/qFE10SqPwOHssBo5qt7Qas3TgP9IHK0OT+GdwoxIA8Srs+iAI3DkElBQY18
 pSfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=gicE2Af+LD+7FiJCQKaRPmKCNLDQNn7HpgN91waxiQM=;
 b=YdjJLWPCy/RcWviovfpaaqtRA8orx85ksdB/j+KJROZsRxVmKcX+3Oia9Qo2i5G1z6
 nefgRUMZLjBILGQBM7NUfbhKa6aowbJ9ekQEa6/LQN4Js9efH0rQAsTyjnUdigUIzl2w
 HdSAbMGmvLGLwI8jtZHCv7/+Jx6Yjo94Am1t2TgqwhtGD0+Cyyc0lclucQIMzuTb63WZ
 x8KdjP+zbfwZBIuDCQdjWfsBewekgXx4C46pqiXzr9g9+0uKVwZzDfU8xtYKZBfqPcf5
 0Zv+BG6D3g3g2DIPOBu8uk/by6q1iCa30MFVj6YNiOHx+FOjEVcPJoTsoNzfBn6ntPPm
 BINA==
X-Gm-Message-State: APjAAAXHbkEGNxJfvx5157jNpWvG1flJEDgbSC5U3fArp/8f6rMzdJ7m
 ai12ByxpXSn7SekMTXKd9TWQK7ePXso=
X-Google-Smtp-Source: APXvYqwI3HztmUadlGBeIpo2wQ7WCL9ygg1Q1yUzzjMqQHldCjy687IvM2zsGP0U1xyh1VKGX+DeYQ==
X-Received: by 2002:a17:902:a508:: with SMTP id
 s8mr21193001plq.317.1569069083286; 
 Sat, 21 Sep 2019 05:31:23 -0700 (PDT)
Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6])
 by smtp.gmail.com with ESMTPSA id 16sm5856951pfi.55.2019.09.21.05.31.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 21 Sep 2019 05:31:20 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN> <87woe3otut.fsf@HIDDEN>
Date: Sat, 21 Sep 2019 21:31:16 +0900
In-Reply-To: <87woe3otut.fsf@HIDDEN> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Fri, 20 Sep 2019 17:44:26 +0200")
Message-ID: <87pnjt6dbf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="==-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org,
 =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--==-=-=
Content-Type: multipart/mixed; boundary="=-=-="

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,

Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:
>
>> Indeed, the default recommended invocation to update the root's guix
>> could be changed to be 'sudo -i guix pull', which should work on all
>> systems including Ubuntu.
>
> Oh right.  Could you make this change in the manual?
>
> Thanks,
> Ludo=E2=80=99.

I looked at what was in the manual, and became less sure, thought maybe
'sudo -E' could be better, so I've done the following little experiment
using Docker to test an Ubuntu enviroment:

Here's the Dockerfile, with instructions to reproduce in it:

=2D-8<---------------cut here---------------start------------->8---
FROM ubuntu

RUN apt-get update && apt-get install sudo
RUN useradd -ms /bin/bash user
RUN usermod -aG sudo user
RUN echo user:user | chpasswd

USER user

CMD bash

# To test (in the directory where this file is written as 'Dockerfile'):
# docker build .
# docker run -it --rm <container_id>

# Then run the following commands:
# export PATH=3Dextra-stuff:$PATH
# sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"'
# sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"'
# sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"'
=2D-8<---------------cut here---------------end--------------->8---

And the result:

=2D-8<---------------cut here---------------start------------->8---
echo $PATH
echo $PATH
extra-stuff:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -E sh -c 'echo -e "env w=
hen using -E: \n$(env)\n\n"'
sudo -E sh -c 'echo -e "env when using -E: \n$(env)\n\n"'
=2De env when using -E:
SUDO_GID=3D1000
USER=3Droot
HOSTNAME=3De538556bf337
SHLVL=3D1
HOME=3D/home/user
SUDO_UID=3D1000
LOGNAME=3Droot
_=3D/usr/bin/sudo
TERM=3Dxterm
USERNAME=3Droot
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b=
in
LS_COLORS=3Drs=3D0:di=3D01;34:[...]

SUDO_COMMAND=3D/bin/sh -c echo -e "env when using -E:
$(env)

"
SHELL=3D/bin/bash
SUDO_USER=3Duser
PWD=3D/

0;user@e538556bf337: /=07user@e538556bf337:/$ sudo -i sh -c 'echo -e "env w=
hen using -i: \n$(env)\n\n"'
sudo -i sh -c 'echo -e "env when using -i: \n$(env)\n\n"'
=2De env when using -i:
SUDO_GID=3D1000
MAIL=3D/var/mail/root
USER=3Droot
HOSTNAME=3De538556bf337
SHLVL=3D1
HOME=3D/root
SUDO_UID=3D1000
LOGNAME=3Droot
_=3D/bin/sh
USERNAME=3Droot
TERM=3Dxterm
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b=
in
LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...]

$(env)

"
SHELL=3D/bin/bash
SUDO_USER=3Duser
PWD=3D/root

user@e538556bf337: /=07user@e538556bf337:/$ sudo sh -c 'echo -e "env with p=
lain sudo: $(env)\n\n"'
sudo sh -c 'echo -e "env with plain sudo: $(env)\n\n"'
=2De env with plain sudo: SUDO_GID=3D1000
MAIL=3D/var/mail/root
USER=3Droot
HOSTNAME=3De538556bf337
HOME=3D/home/user
SUDO_UID=3D1000
LOGNAME=3Droot
TERM=3Dxterm
USERNAME=3Droot
PATH=3D/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/b=
in
LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36: [...]
SUDO_COMMAND=3D/bin/sh -c echo -e "env with plain sudo: $(env)

"
SHELL=3D/bin/bash
SUDO_USER=3Duser
PWD=3D/
=2D-8<---------------cut here---------------end--------------->8---

What do we get from this?

Well, first, the user's PATH is *not* preserved when using 'sudo', at
least on Debian and Ubuntu.  These are configured out of the box to
reset the PATH to a 'safe' value, even when using the -E option of sudo.

We also see, as Ludovic found out, that the user's HOME is preserved for
the normal invocation of sudo on Ubuntu.

In light of this, I suggest the attached patch to our documentation.
It's a bit sub-optimal in that it modifies a section of the 'Guix
System', which behaved as described; but given that it's the only place
where we mention of 'sudo guix pull', better safe than sorry, I'd say
(foreign distribution users might read it, thinking it also applies to
themselves).

Does that seem worthwile/reasonable?


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-doc-Adapt-the-guix-pull-command-recommendation.patch
Content-Transfer-Encoding: quoted-printable

From=20bfa2f754592a00fefa4fcd20080582268b6273dd Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Date: Sat, 21 Sep 2019 20:36:04 +0900
Subject: [PATCH] doc: Adapt the guix pull command recommendation.

This change follows the discussion for issue #36785 (see:
https://bugs.gnu.org/36785).

* doc/guix.texi (After System Installation): Add the '-i' sudo option to the
suggested commands used to keep a Guix System up-to-date.  Although this
section is specific to Guix System, it is likely to be read by users of
foreign GNU/Linux distributions as well.  Remove the note, given that sudo
doesn't preserve the user's PATH on foreign distributions such as Debian.
=2D--
 doc/guix.texi | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 0ed59072c9..3690e3b152 100644
=2D-- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2387,8 +2387,8 @@ Success, you've now booted into Guix System!  From th=
en on, you can update the
 system whenever you want by running, say:
=20
 @example
=2Dguix pull
=2Dsudo guix system reconfigure /etc/config.scm
+sudo -i guix pull
+sudo -i guix system reconfigure /etc/config.scm
 @end example
=20
 @noindent
@@ -2396,14 +2396,6 @@ This builds a new system generation with the latest =
packages and services
 (@pxref{Invoking guix system}).  We recommend doing that regularly so that
 your system includes the latest security updates (@pxref{Security Updates}=
).
=20
=2D@c See <https://lists.gnu.org/archive/html/guix-devel/2019-01/msg00268.h=
tml>.
=2D@quotation Note
=2D@cindex sudo vs. @command{guix pull}
=2DNote that @command{sudo guix} runs your user's @command{guix} command and
=2D@emph{not} root's, because @command{sudo} leaves @code{PATH} unchanged. =
 To
=2Dexplicitly run root's @command{guix}, type @command{sudo -i guix @dots{}=
}.
=2D@end quotation
=2D
 Join us on @code{#guix} on the Freenode IRC network or on
 @email{guix-devel@@gnu.org} to share your experience!
=20
=2D-=20
2.23.0


--=-=-=
Content-Type: text/plain


Thanks,

Maxim

--=-=-=--

--==-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAl2GGBQACgkQEmDkZILm
NWLV9BAAkGt82u3y+MSaNkr8coJCT3W7f5MSd+caCBd/GGp/wP4jyO9ALal7ATuk
Yu5ClnphDf3Q5KTJBaFkVolckyAKuXLVFdwvm3z78RZzYecSkgaKQtlOxcAdB/rU
4awBjkHb89S0V1ogHhJwj+UcJ4z3D/Mk1MiA5WmqUamPlRaQJisQsUWpm42S4F5E
jbBBxzTW6IANssVTzbXiuxdqnyug1qraQjq8gmSAD9Thd7Kxnr5f49nSSJp93Glg
fZP7LxNgnBPFVhgE9urQSGvTCg6SgSi1VVREcJQZ7pHcZerRjbSJ8QA8zd1EWijR
/Z1k3hlP6xo3EpTFrAMTep7xK+oI8JL+4CUw+vL7/m/uv+3JrcqzEX2M6p3I23NW
KB8DmkUlh6mzZ270YhGsgmqkujMSuZK9Z8tcVf80ZbIVkZZYDpJTGR4CXYP3zhDW
BR6Qad51kqGEQjdvAZIXHF79zvpbOvQfV+iKMy4mqIK5rP2c+oYHWGU4A6nwjA+m
mSSBb5ssBm8JF4p9w6uv68m+bD9lOzacHf8QXSeF8ga5VURYqp9S3clGRE2TJL40
/gD3Bxdal5LqlWE4d+5PCHFIsee3BF9/mBw9wwnxK53ZX7xc9Tp+b9rYtvbiCVYi
OhEHyBcT7k6YMF+TG5SWtw7yjLihhvYcjyRP2fF0l0zcKAp78Hg=
=fDx5
-----END PGP SIGNATURE-----
--==-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 20 Sep 2019 15:44:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 11:44:43 2019
Received: from localhost ([127.0.0.1]:58321 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iBL5P-00027u-Ho
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2019 11:44:43 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38629)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iBL5N-00027h-OX
 for 36785 <at> debbugs.gnu.org; Fri, 20 Sep 2019 11:44:42 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:53422)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iBL5B-00020x-Rl; Fri, 20 Sep 2019 11:44:31 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45934 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iBL5B-0000Kv-Di; Fri, 20 Sep 2019 11:44:29 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 <87pnjv73sg.fsf@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Jour de la Raison de =?utf-8?Q?l'Ann=C3=A9e?= 227 de
 la =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 20 Sep 2019 17:44:26 +0200
In-Reply-To: <87pnjv73sg.fsf@HIDDEN> (Maxim Cournoyer's message of "Fri, 20
 Sep 2019 17:47:11 +0900")
Message-ID: <87woe3otut.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org,
 =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis:

> Indeed, the default recommended invocation to update the root's guix
> could be changed to be 'sudo -i guix pull', which should work on all
> systems including Ubuntu.

Oh right.  Could you make this change in the manual?

Thanks,
Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 20 Sep 2019 08:47:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 04:47:25 2019
Received: from localhost ([127.0.0.1]:56755 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iBEZY-0003zx-Kw
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2019 04:47:25 -0400
Received: from mail-pl1-f181.google.com ([209.85.214.181]:42168)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1iBEZW-0003uN-FP
 for 36785 <at> debbugs.gnu.org; Fri, 20 Sep 2019 04:47:23 -0400
Received: by mail-pl1-f181.google.com with SMTP id e5so2866003pls.9
 for <36785 <at> debbugs.gnu.org>; Fri, 20 Sep 2019 01:47:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-transfer-encoding;
 bh=6ddQmOPIOLzcwYJshBdCwR2+7hO99JO8neuJyEp9Rto=;
 b=RGKTqCd0LE4+QtArElgDYN3nlYAisXxnSfVsXJa47G/NsYHkn6Mv0N4VhhukbLl6/Q
 JTCAooJz5HFvCht/lYmy9ZRMPX0DVUTLhR35XIKqQct1dXigXG7pfzpZXQttx3FUxQfB
 PBr73rPdCe6Z68XCeGasy00vCOGaE6zVIvzU7gAmMOlJyxyIOjufMuRZI209s1L2Nzb8
 66vodnE5Q4vu0jbHK/3Xk9ZlT2ZfBcYkt8BhNhzDhZb/U2UgqaQvPDkePPu+oyr8+grb
 M5cQkvd3EMtb2AY3kH59JoqSpmeJlCOdbHVlGubVFjfRxtwyJJJUeFczdmQXVaA4VuJ7
 ic9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version:content-transfer-encoding;
 bh=6ddQmOPIOLzcwYJshBdCwR2+7hO99JO8neuJyEp9Rto=;
 b=PyRcWy3Rv6d4Dvz6ODUkhXMhoGWWTOAsCV4YUjrHpY7J50hC2oAJJSByfUST89OMjl
 Z4WhuKZIibLpuc3xduIqnkODA/zZefGckKvcSWeFKGplSmH9fbgjadu3PgQ3fgiFBd8R
 mPhGcjzwrioEzuTppzo1KyLnjJgz2T/z3z59MfMJrxVMnrv9v8q/0jdmIaCRsR865/aT
 c1UvN6OmRD5Cq1USvQCwZzaKQO5hGLN8gdWFwePpGUp+6wzduhIx6tKx9HcaY0QAqNRi
 FzIwBfwnxY8TsIVIaLpUZ4I0PSW0aOFcikKRLD2qe+ShehjKqjf1BiMey7Z9O210+i94
 k4Nw==
X-Gm-Message-State: APjAAAUcKzR9mMv1IYxCBINwQcQWgah1sSm4ijCUKNog207CAeflGfTc
 MJL8WWgxY3XvwcLudxL5+Je3eDBm
X-Google-Smtp-Source: APXvYqwV7IuxdkXej7Vv4cdvuYAncTpS9N9u+ZxnPTjhvljM4kyacGNd6rUvUWBkKv2Czs1U4Sp1jA==
X-Received: by 2002:a17:902:7846:: with SMTP id
 e6mr12307582pln.136.1568969236351; 
 Fri, 20 Sep 2019 01:47:16 -0700 (PDT)
Received: from x200 ([240f:c7:38e9:1:314b:485c:9ba4:72c6])
 by smtp.gmail.com with ESMTPSA id w6sm3431272pfj.17.2019.09.20.01.47.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 20 Sep 2019 01:47:15 -0700 (PDT)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
Date: Fri, 20 Sep 2019 17:47:11 +0900
In-Reply-To: <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Wed, 18 Sep 2019
 01:33:40 +0200")
Message-ID: <87pnjv73sg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

G=C3=A1bor Boskovits <boskovits@HIDDEN> writes:

> Hello Ludo,
>
> Ludovic Court=C3=A8s <ludo@HIDDEN> ezt =C3=ADrta (id=C5=91pont: 2019. sz=
ept. 18., Sze,
> 0:04):
>
>> Hi,
>>
>> Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:
>>
>> > Indeed.  I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile=
-directory=E2=80=99 and
>> > (canonicalize-profile %user-profile-directory), and here=E2=80=99s wha=
t I see
>> > with =E2=80=98sudo=E2=80=99:
>> >
>> > $ sudo -E ./pre-inst-env guix pull
>> >
>> > ;;; (pd "/var/guix/profiles/per-user/root")
>> >
>> > ;;; (upd "/home/ludo/.config/guix/current")
>>
>> I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead o=
f ~root.
>> Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80=
=9Csudo guix pull=E2=80=9D does
>> the right thing (this is on Guix System):
>>
>> --8<---------------cut here---------------start------------->8---
>> $ sudo guix repl
>> GNU Guile 2.2.4
>> Copyright (C) 1995-2017 Free Software Foundation, Inc.
>>
>> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
>> This program is free software, and you are welcome to redistribute it
>> under certain conditions; type `,show c' for details.
>>
>> Enter `,help' for help.
>> scheme@(guix-user)> (getenv "HOME")
>> $1 =3D "/root"
>> scheme@(guix-user)> ,m(guix scripts pull)
>> scheme@(guix scripts pull)> %profile-directory
>> $2 =3D "/var/guix/profiles/per-user/root"
>> scheme@(guix scripts pull)> %user-profile-directory
>> $3 =3D "/root/.config/guix/current"
>> scheme@(guix scripts pull)> (cache-directory)
>> $4 =3D "/root/.cache/guix"
>> scheme@(guix scripts pull)> (config-directory)
>> $5 =3D "/root/.config/guix"
>> --8<---------------cut here---------------end--------------->8---
>>
>> So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profil=
e and writes to
>> ~root/.cache, everything is fine.
>>
>> Done?
>>
>> I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80=
=98sudo=E2=80=99
>> on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by de=
fault:
>>
>>   $ sudo env | grep HOME
>>   HOME=3D/home/ubuntu
>>
>> This is written here:
>>
>>
>> https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_she=
lls
>>
>> (That=E2=80=99s with sudo 1.8.21p2, FWIW.)
>>
>> Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special.  Ac=
tually, Debian
>> has (almost) the same /etc/sudoers and yet it does not preserve HOME.
>>
>> (Time passes=E2=80=A6)
>>
>> Digging further, I fetched the source from
>> <https://packages.ubuntu.com/bionic/sudo>, and boom! I found the
>> culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_defaul=
t.patch=E2=80=99.
>>
>> --8<---------------cut here---------------start------------->8---
>> Description: Set HOME in initial_keepenv_table
>>  Set HOME in initial_keepenv_table; without this, $HOME will never be
>>  preserved unless added to keep_env.  There's appropriate logic to handle
>>  resetting the home for -H and -i options, so this is the only part that=
's
>>  missing.
>> Author: Steve Langasek <steve.langasek@HIDDEN>
>> --- a/plugins/sudoers/env.c
>> +++ b/plugins/sudoers/env.c
>> @@ -189,6 +189,7 @@
>>      "COLORS",
>>      "DISPLAY",
>>      "DPKG_COLORS",
>> +    "HOME",
>>      "HOSTNAME",
>>      "KRB5CCNAME",
>>      "LS_COLORS",
>> --8<---------------cut here---------------end--------------->8---
>>
>> (This patch is playing with fire IMO.  If you=E2=80=99re an Ubuntu user,
>> consider reporting a bug!)
>>
>> But anyway, what can we do?
>>
>> We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done.
>>
>> We could also add some logic to detect whether (1) we=E2=80=99re running=
 under
>> sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s ho=
me
>> directory as it appears in /etc/passwd.  If both conditions are
>> satisfied, we could ignore $HOME and use the home directory from
>> /etc/passwd instead.
>>
>> But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of =
=E2=80=98sudo -H=E2=80=99.
>>
>> We could apply the patch I posted earlier, which simply disables profile
>> migration when SUDO_USER is set.  That won=E2=80=99t address the fact th=
at root
>> writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we c=
an do here.
>>
>> Thoughts?
>>
>
> We could simply document a proper sudo invocation for updating root's gui=
x,
> that
> always works. Wdyt?
>
> We could provide it simply as a hint if it fails.

Indeed, the default recommended invocation to update the root's guix
could be changed to be 'sudo -i guix pull', which should work on all
systems including Ubuntu.

Maxim




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785-done <at> debbugs.gnu.org:


Received: (at 36785-done) by debbugs.gnu.org; 19 Sep 2019 08:24:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 19 04:24:27 2019
Received: from localhost ([127.0.0.1]:55127 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iArjn-0002r1-4t
	for submit <at> debbugs.gnu.org; Thu, 19 Sep 2019 04:24:27 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53880)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iArjl-0002qn-O1
 for 36785-done <at> debbugs.gnu.org; Thu, 19 Sep 2019 04:24:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47652)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iArjg-0003ot-78; Thu, 19 Sep 2019 04:24:20 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=56070 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iArjf-00029p-Qe; Thu, 19 Sep 2019 04:24:20 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <87o8zho3ko.fsf@HIDDEN>
Date: Thu, 19 Sep 2019 10:24:18 +0200
In-Reply-To: <87o8zho3ko.fsf@HIDDEN> (Ricardo Wurmus's message of "Wed,
 18 Sep 2019 20:35:19 +0200")
Message-ID: <87lfuky9ql.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785-done
Cc: 36785-done <at> debbugs.gnu.org, Julien Lepiller <julien@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Ricardo Wurmus <rekado@HIDDEN> skribis:

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

[...]

>> We could apply the patch I posted earlier, which simply disables profile
>> migration when SUDO_USER is set.  That won=E2=80=99t address the fact th=
at root
>> writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we c=
an do here.
>
> This sounds fine to me.

I went ahead and pushed that as
ee25048e51dd45ad91a1ad4b0f25f4013843c52b.

Thanks,
Ludo=E2=80=99.




Notification sent to Tobias Geerinckx-Rice <me@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Ludovic Courtès <ludo@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 36785-done <at> debbugs.gnu.org:


Received: (at 36785-done) by debbugs.gnu.org; 19 Sep 2019 08:24:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 19 04:24:27 2019
Received: from localhost ([127.0.0.1]:55127 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iArjn-0002r1-4t
	for submit <at> debbugs.gnu.org; Thu, 19 Sep 2019 04:24:27 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53880)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iArjl-0002qn-O1
 for 36785-done <at> debbugs.gnu.org; Thu, 19 Sep 2019 04:24:26 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47652)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iArjg-0003ot-78; Thu, 19 Sep 2019 04:24:20 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=56070 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iArjf-00029p-Qe; Thu, 19 Sep 2019 04:24:20 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Ricardo Wurmus <rekado@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <87o8zho3ko.fsf@HIDDEN>
Date: Thu, 19 Sep 2019 10:24:18 +0200
In-Reply-To: <87o8zho3ko.fsf@HIDDEN> (Ricardo Wurmus's message of "Wed,
 18 Sep 2019 20:35:19 +0200")
Message-ID: <87lfuky9ql.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785-done
Cc: 36785-done <at> debbugs.gnu.org, Julien Lepiller <julien@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Ricardo Wurmus <rekado@HIDDEN> skribis:

> Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

[...]

>> We could apply the patch I posted earlier, which simply disables profile
>> migration when SUDO_USER is set.  That won=E2=80=99t address the fact th=
at root
>> writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we c=
an do here.
>
> This sounds fine to me.

I went ahead and pushed that as
ee25048e51dd45ad91a1ad4b0f25f4013843c52b.

Thanks,
Ludo=E2=80=99.




Notification sent to Julien Lepiller <julien@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Ludovic Courtès <ludo@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 18 Sep 2019 18:35:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 18 14:35:34 2019
Received: from localhost ([127.0.0.1]:54815 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iAene-0003Sw-H0
	for submit <at> debbugs.gnu.org; Wed, 18 Sep 2019 14:35:34 -0400
Received: from sender4-of-o52.zoho.com ([136.143.188.52]:21220)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1iAenc-0003So-3J
 for 36785 <at> debbugs.gnu.org; Wed, 18 Sep 2019 14:35:32 -0400
ARC-Seal: i=1; a=rsa-sha256; t=1568831724; cv=none; d=zoho.com; s=zohoarc; 
 b=mWUTJq6N9OvfKsdJ6Izb90EGhkjiDgChgPe3XeohIVO3PEtOUaplUem0LCquGFaoXRIf2SrXxdPu5AEDKASTWhXnvyzUYBGirJre8ATWcOPyW1jPXDa7rNnnU7vArQw4lM3wXjYfK/DKp7rW+3Mhi6/v0fYOqj0Ik9BmSH4To80=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com;
 s=zohoarc; t=1568831724;
 h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results;
 bh=HmAhPV1kURPML6ekB/aePT7Waba/j7yZV5ny+ucKmjc=; 
 b=OaQ3ikNAxtOINPgv7y9U4p7H2D/Uqen+Zv9Bh102tIH+U7ap0ae0MiEHft32T2xMSOz3/3gCUwyrK4Lngi/zNGmFe8GR9yx8Pe6jDUpOsGRXwCivDsUGpio5hrlKmE/z4C0Qw19aNnljmTiuh0SAfZpsiBOf14Nvr3YXcZzCHxI=
ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass  header.i=elephly.net;
 spf=pass  smtp.mailfrom=rekado@HIDDEN;
 dmarc=pass header.from=<rekado@HIDDEN> header.from=<rekado@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1568831724; 
 s=zoho; d=elephly.net; i=rekado@HIDDEN;
 h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding;
 l=1400; bh=HmAhPV1kURPML6ekB/aePT7Waba/j7yZV5ny+ucKmjc=;
 b=gmInfTH9y4FbwaQE2nsHzJ/rDFcUfLciCC90ovU5PX3Tf6l3wfDEseiN95BIfK9h
 cmEO3rE9+AR8JVAYsBl0u4P6W4Q6O+wPVOcYGavjg/ddWTM5GRjaVrj5EKRbtcgUMwX
 vOyxNBpa4JR8EEXnDXex8dqZhSUXC2ZBjD8hxHHU=
Received: from localhost (p54AD4E3E.dip0.t-ipconnect.de [84.173.78.62]) by
 mx.zohomail.com with SMTPS id 1568831722903604.3006250975964;
 Wed, 18 Sep 2019 11:35:22 -0700 (PDT)
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.2
From: Ricardo Wurmus <rekado@HIDDEN>
To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
In-reply-to: <87woe6fune.fsf@HIDDEN>
X-URL: https://elephly.net
X-PGP-Key: https://elephly.net/rekado.pubkey
X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
Date: Wed, 18 Sep 2019 20:35:19 +0200
Message-ID: <87o8zho3ko.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org, Julien Lepiller <julien@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Ludovic Court=C3=A8s <ludo@HIDDEN> writes:

> Digging further, I fetched the source from
> <https://packages.ubuntu.com/bionic/sudo>, and boom! I found the
> culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default=
.patch=E2=80=99.
>
> --8<---------------cut here---------------start------------->8---
> Description: Set HOME in initial_keepenv_table
>  Set HOME in initial_keepenv_table; without this, $HOME will never be=20
>  preserved unless added to keep_env.  There's appropriate logic to handle
>  resetting the home for -H and -i options, so this is the only part that's
>  missing.
> Author: Steve Langasek <steve.langasek@HIDDEN>
> --- a/plugins/sudoers/env.c
> +++ b/plugins/sudoers/env.c
> @@ -189,6 +189,7 @@
>      "COLORS",
>      "DISPLAY",
>      "DPKG_COLORS",
> +    "HOME",
>      "HOSTNAME",
>      "KRB5CCNAME",
>      "LS_COLORS",
> --8<---------------cut here---------------end--------------->8---
>
> (This patch is playing with fire IMO.  If you=E2=80=99re an Ubuntu user,
> consider reporting a bug!)

Wow.  Changing fundamental behaviour like that is bad.

> We could apply the patch I posted earlier, which simply disables profile
> migration when SUDO_USER is set.  That won=E2=80=99t address the fact tha=
t root
> writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we ca=
n do here.

This sounds fine to me.

--=20
Ricardo





Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 18 Sep 2019 08:50:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 18 04:50:40 2019
Received: from localhost ([127.0.0.1]:53566 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iAVfc-0000xB-Be
	for submit <at> debbugs.gnu.org; Wed, 18 Sep 2019 04:50:40 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42119)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iAVfa-0000ww-BF
 for 36785 <at> debbugs.gnu.org; Wed, 18 Sep 2019 04:50:38 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:56359)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iAVdl-0005MU-SI; Wed, 18 Sep 2019 04:50:28 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49842 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iAVdl-0007l0-BQ; Wed, 18 Sep 2019 04:48:45 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: =?utf-8?Q?G=C3=A1bor?= Boskovits <boskovits@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
 <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Jour du =?utf-8?Q?G=C3=A9nie?= de =?utf-8?Q?l'Ann?=
 =?utf-8?Q?=C3=A9e?= 227 de la =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Wed, 18 Sep 2019 10:48:42 +0200
In-Reply-To: <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
 (=?utf-8?Q?=22G=C3=A1bor?= Boskovits"'s message of "Wed, 18 Sep 2019
 01:33:40 +0200")
Message-ID: <87h85af0r9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org, Julien Lepiller <julien@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

G=C3=A1bor Boskovits <boskovits@HIDDEN> skribis:

> We could simply document a proper sudo invocation for updating root's gui=
x,
> that
> always works. Wdyt?

The thing is =E2=80=9Csudo guix pull=E2=80=9D works on all (?) distros but =
Ubuntu, which
provides a patched sudo.  So we=E2=80=99d have to explicitly mention Ubuntu.

That=E2=80=99s probably a good idea, though chances are people will run =E2=
=80=9Csudo
guix pull=E2=80=9D before they=E2=80=99ve read that footnote in the manual.=
  (A
colleague of mine ran =E2=80=9Csudo guix pull=E2=80=9D mostly because they =
were used to
=E2=80=9Csudo apt-get update=E2=80=9D and didn=E2=80=99t really think =E2=
=80=98sudo=E2=80=99 was unnecessary.)

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 17 Sep 2019 23:34:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 17 19:34:00 2019
Received: from localhost ([127.0.0.1]:53408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iAMyt-0003BM-Jv
	for submit <at> debbugs.gnu.org; Tue, 17 Sep 2019 19:34:00 -0400
Received: from mail-ed1-f51.google.com ([209.85.208.51]:41362)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boskovits@HIDDEN>) id 1iAMys-0003B4-14
 for 36785 <at> debbugs.gnu.org; Tue, 17 Sep 2019 19:33:58 -0400
Received: by mail-ed1-f51.google.com with SMTP id f20so2466457edv.8
 for <36785 <at> debbugs.gnu.org>; Tue, 17 Sep 2019 16:33:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc; bh=m/C1Uq0RHJnb9su2L/IeaU+NWFvKThtoUM1ef92jvpY=;
 b=Gc5VPC7ej6owOZYtX3FABaEKvi++SSSWWYtPZb57Rcpf0ge+148zzxpnMfCJO8FqkL
 aSKh1YYbx9bkhQtQthvgf79J1MreiLRqJS2mBLNAQl7n6OFLze99zV9Kti5xiTRUOLwu
 UGcx2UBsQfP8UrhYWTR2tFXnSHcO//BUJTLL6od23Fsjk/UP5biDNblQwmt+6qB6rBrG
 CjMcmB/1M5cq5iSxmmhoWk2CJf0YcuamrC+wU3QPnHjapvOINr1AYDY+rukXW2Qc48Z9
 lPtxCKh9TMcVucRfpUeHKCfLtiQ97yJJrNwxy0S+qd+IKuxfUUueF2Rd/QcA3vlc2mF/
 dVlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to:cc;
 bh=m/C1Uq0RHJnb9su2L/IeaU+NWFvKThtoUM1ef92jvpY=;
 b=PnvtXCIGcAO4XISM5K5C5rt71lwCvRIQwCGQbARmHBP+ginQtz/izZ1p9FXr/BXK02
 2uBfLbvK/FxWwYtm80f4dR//nbTEyBjp47eBfjrmJ2QxGMMpOxDkXddulWq3j70g03lf
 9YYcsoBAd4o0KZAxfNcqbXmCtDlOGoPnuIwgL3JZvFpLD7GX2gxqmWDkJACZKFcdVDzb
 OD7R9FZC38aDuAUkSWo0MYTxZBMgkcohzTdlDMhvrRYpBlXRJYpIOznmd5eOjd4HNTt2
 s04lTW4C3y0biElVb+Q5KGVb8iVzFa5m4vfnbNEMbRxFYHKFTYuuKMmKYmP+2S88u5CI
 Y78A==
X-Gm-Message-State: APjAAAXA5gcaa3lQdHOjd8HGjKhoQqblR+WZJuR+YtRIEMmKDbi6gH4p
 knlXOejejR++n958ccDBFzp7CF4mlfpYlXvGdg==
X-Google-Smtp-Source: APXvYqyMfRNvCXXJaX1bDrvGJfctsu5CcNF7TIn6gszKkSnZi78kecBiWg803c9+fL3B82WyySV0xhyymG9v1iNQ7wQ=
X-Received: by 2002:a17:906:c742:: with SMTP id
 fk2mr7105097ejb.44.1568763231918; 
 Tue, 17 Sep 2019 16:33:51 -0700 (PDT)
MIME-Version: 1.0
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN> <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN> <87woe6fune.fsf@HIDDEN>
In-Reply-To: <87woe6fune.fsf@HIDDEN>
From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= <boskovits@HIDDEN>
Date: Wed, 18 Sep 2019 01:33:40 +0200
Message-ID: <CAE4v=piu8Cigd2VS0b2Ou2GqNEFa4EVXoNY9zvmuQHYX32cgOA@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
To: =?UTF-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
Content-Type: multipart/alternative; boundary="0000000000002cde500592c82710"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org, Julien Lepiller <julien@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--0000000000002cde500592c82710
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello Ludo,

Ludovic Court=C3=A8s <ludo@HIDDEN> ezt =C3=ADrta (id=C5=91pont: 2019. szep=
t. 18., Sze,
0:04):

> Hi,
>
> Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:
>
> > Indeed.  I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile-=
directory=E2=80=99 and
> > (canonicalize-profile %user-profile-directory), and here=E2=80=99s what=
 I see
> > with =E2=80=98sudo=E2=80=99:
> >
> > $ sudo -E ./pre-inst-env guix pull
> >
> > ;;; (pd "/var/guix/profiles/per-user/root")
> >
> > ;;; (upd "/home/ludo/.config/guix/current")
>
> I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead of=
 ~root.
> Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80=9C=
sudo guix pull=E2=80=9D does
> the right thing (this is on Guix System):
>
> --8<---------------cut here---------------start------------->8---
> $ sudo guix repl
> GNU Guile 2.2.4
> Copyright (C) 1995-2017 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> scheme@(guix-user)> (getenv "HOME")
> $1 =3D "/root"
> scheme@(guix-user)> ,m(guix scripts pull)
> scheme@(guix scripts pull)> %profile-directory
> $2 =3D "/var/guix/profiles/per-user/root"
> scheme@(guix scripts pull)> %user-profile-directory
> $3 =3D "/root/.config/guix/current"
> scheme@(guix scripts pull)> (cache-directory)
> $4 =3D "/root/.cache/guix"
> scheme@(guix scripts pull)> (config-directory)
> $5 =3D "/root/.config/guix"
> --8<---------------cut here---------------end--------------->8---
>
> So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profile=
 and writes to
> ~root/.cache, everything is fine.
>
> Done?
>
> I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80=98=
sudo=E2=80=99
> on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by def=
ault:
>
>   $ sudo env | grep HOME
>   HOME=3D/home/ubuntu
>
> This is written here:
>
>
> https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_shel=
ls
>
> (That=E2=80=99s with sudo 1.8.21p2, FWIW.)
>
> Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special.  Act=
ually, Debian
> has (almost) the same /etc/sudoers and yet it does not preserve HOME.
>
> (Time passes=E2=80=A6)
>
> Digging further, I fetched the source from
> <https://packages.ubuntu.com/bionic/sudo>, and boom! I found the
> culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default=
.patch=E2=80=99.
>
> --8<---------------cut here---------------start------------->8---
> Description: Set HOME in initial_keepenv_table
>  Set HOME in initial_keepenv_table; without this, $HOME will never be
>  preserved unless added to keep_env.  There's appropriate logic to handle
>  resetting the home for -H and -i options, so this is the only part that'=
s
>  missing.
> Author: Steve Langasek <steve.langasek@HIDDEN>
> --- a/plugins/sudoers/env.c
> +++ b/plugins/sudoers/env.c
> @@ -189,6 +189,7 @@
>      "COLORS",
>      "DISPLAY",
>      "DPKG_COLORS",
> +    "HOME",
>      "HOSTNAME",
>      "KRB5CCNAME",
>      "LS_COLORS",
> --8<---------------cut here---------------end--------------->8---
>
> (This patch is playing with fire IMO.  If you=E2=80=99re an Ubuntu user,
> consider reporting a bug!)
>
> But anyway, what can we do?
>
> We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done.
>
> We could also add some logic to detect whether (1) we=E2=80=99re running =
under
> sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s hom=
e
> directory as it appears in /etc/passwd.  If both conditions are
> satisfied, we could ignore $HOME and use the home directory from
> /etc/passwd instead.
>
> But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of =
=E2=80=98sudo -H=E2=80=99.
>
> We could apply the patch I posted earlier, which simply disables profile
> migration when SUDO_USER is set.  That won=E2=80=99t address the fact tha=
t root
> writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we ca=
n do here.
>
> Thoughts?
>

We could simply document a proper sudo invocation for updating root's guix,
that
always works. Wdyt?

We could provide it simply as a hint if it fails.


>
> Ludo=E2=80=99.
>
>
>
>
Best regards,
g_bor
--=20
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21

--0000000000002cde500592c82710
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>Hello Ludo,<br></div><br><div class=3D"gmail_quo=
te"><div dir=3D"ltr" class=3D"gmail_attr">Ludovic Court=C3=A8s &lt;<a href=
=3D"mailto:ludo@HIDDEN">ludo@HIDDEN</a>&gt; ezt =C3=ADrta (id=C5=91pont: =
2019. szept. 18., Sze, 0:04):<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">Hi,<br>
<br>
Ludovic Court=C3=A8s &lt;<a href=3D"mailto:ludo@HIDDEN" target=3D"_blank">=
ludo@HIDDEN</a>&gt; skribis:<br>
<br>
&gt; Indeed.=C2=A0 I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%pr=
ofile-directory=E2=80=99 and<br>
&gt; (canonicalize-profile %user-profile-directory), and here=E2=80=99s wha=
t I see<br>
&gt; with =E2=80=98sudo=E2=80=99:<br>
&gt;<br>
&gt; $ sudo -E ./pre-inst-env guix pull<br>
&gt;<br>
&gt; ;;; (pd &quot;/var/guix/profiles/per-user/root&quot;)<br>
&gt;<br>
&gt; ;;; (upd &quot;/home/ludo/.config/guix/current&quot;)<br>
<br>
I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead of ~=
root.<br>
Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80=9Csu=
do guix pull=E2=80=9D does<br>
the right thing (this is on Guix System):<br>
<br>
--8&lt;---------------cut here---------------start-------------&gt;8---<br>
$ sudo guix repl<br>
GNU Guile 2.2.4<br>
Copyright (C) 1995-2017 Free Software Foundation, Inc.<br>
<br>
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w&#39;.<br=
>
This program is free software, and you are welcome to redistribute it<br>
under certain conditions; type `,show c&#39; for details.<br>
<br>
Enter `,help&#39; for help.<br>
scheme@(guix-user)&gt; (getenv &quot;HOME&quot;)<br>
$1 =3D &quot;/root&quot;<br>
scheme@(guix-user)&gt; ,m(guix scripts pull)<br>
scheme@(guix scripts pull)&gt; %profile-directory<br>
$2 =3D &quot;/var/guix/profiles/per-user/root&quot;<br>
scheme@(guix scripts pull)&gt; %user-profile-directory<br>
$3 =3D &quot;/root/.config/guix/current&quot;<br>
scheme@(guix scripts pull)&gt; (cache-directory)<br>
$4 =3D &quot;/root/.cache/guix&quot;<br>
scheme@(guix scripts pull)&gt; (config-directory)<br>
$5 =3D &quot;/root/.config/guix&quot;<br>
--8&lt;---------------cut here---------------end---------------&gt;8---<br>
<br>
So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profile a=
nd writes to<br>
~root/.cache, everything is fine.<br>
<br>
Done?<br>
<br>
I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80=98su=
do=E2=80=99<br>
on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by defau=
lt:<br>
<br>
=C2=A0 $ sudo env | grep HOME<br>
=C2=A0 HOME=3D/home/ubuntu<br>
<br>
This is written here:<br>
<br>
=C2=A0 <a href=3D"https://help.ubuntu.com/community/RootSudo#Special_notes_=
on_sudo_and_shells" rel=3D"noreferrer" target=3D"_blank">https://help.ubunt=
u.com/community/RootSudo#Special_notes_on_sudo_and_shells</a><br>
<br>
(That=E2=80=99s with sudo 1.8.21p2, FWIW.)<br>
<br>
Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special.=C2=A0 =
Actually, Debian<br>
has (almost) the same /etc/sudoers and yet it does not preserve HOME.<br>
<br>
(Time passes=E2=80=A6)<br>
<br>
Digging further, I fetched the source from<br>
&lt;<a href=3D"https://packages.ubuntu.com/bionic/sudo" rel=3D"noreferrer" =
target=3D"_blank">https://packages.ubuntu.com/bionic/sudo</a>&gt;, and boom=
! I found the<br>
culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default.p=
atch=E2=80=99.<br>
<br>
--8&lt;---------------cut here---------------start-------------&gt;8---<br>
Description: Set HOME in initial_keepenv_table<br>
=C2=A0Set HOME in initial_keepenv_table; without this, $HOME will never be =
<br>
=C2=A0preserved unless added to keep_env.=C2=A0 There&#39;s appropriate log=
ic to handle<br>
=C2=A0resetting the home for -H and -i options, so this is the only part th=
at&#39;s<br>
=C2=A0missing.<br>
Author: Steve Langasek &lt;<a href=3D"mailto:steve.langasek@HIDDEN" =
target=3D"_blank">steve.langasek@HIDDEN</a>&gt;<br>
--- a/plugins/sudoers/env.c<br>
+++ b/plugins/sudoers/env.c<br>
@@ -189,6 +189,7 @@<br>
=C2=A0 =C2=A0 =C2=A0&quot;COLORS&quot;,<br>
=C2=A0 =C2=A0 =C2=A0&quot;DISPLAY&quot;,<br>
=C2=A0 =C2=A0 =C2=A0&quot;DPKG_COLORS&quot;,<br>
+=C2=A0 =C2=A0 &quot;HOME&quot;,<br>
=C2=A0 =C2=A0 =C2=A0&quot;HOSTNAME&quot;,<br>
=C2=A0 =C2=A0 =C2=A0&quot;KRB5CCNAME&quot;,<br>
=C2=A0 =C2=A0 =C2=A0&quot;LS_COLORS&quot;,<br>
--8&lt;---------------cut here---------------end---------------&gt;8---<br>
<br>
(This patch is playing with fire IMO.=C2=A0 If you=E2=80=99re an Ubuntu use=
r,<br>
consider reporting a bug!)<br>
<br>
But anyway, what can we do?<br>
<br>
We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done.<br>
<br>
We could also add some logic to detect whether (1) we=E2=80=99re running un=
der<br>
sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s home<=
br>
directory as it appears in /etc/passwd.=C2=A0 If both conditions are<br>
satisfied, we could ignore $HOME and use the home directory from<br>
/etc/passwd instead.<br>
<br>
But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of =E2=
=80=98sudo -H=E2=80=99.<br>
<br>
We could apply the patch I posted earlier, which simply disables profile<br=
>
migration when SUDO_USER is set.=C2=A0 That won=E2=80=99t address the fact =
that root<br>
writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we can =
do here.<br>
<br>
Thoughts?<br></blockquote><div><br></div><div>We could simply document a pr=
oper sudo invocation for updating root&#39;s guix, that</div><div>always wo=
rks. Wdyt?</div><div><br></div><div>We could provide it simply as a hint if=
 it fails.<br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex">
<br>
Ludo=E2=80=99.<br>
<br>
<br>
<br>
</blockquote></div><br clear=3D"all"></div><div>Best regards,</div><div>g_b=
or<br></div><div>-- <br><div dir=3D"ltr" class=3D"gmail_signature"><div dir=
=3D"ltr">OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:C=
F63:0B21<br></div></div></div></div>

--0000000000002cde500592c82710--




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 17 Sep 2019 22:03:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 17 18:03:20 2019
Received: from localhost ([127.0.0.1]:53397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iALZ9-0000jn-Jo
	for submit <at> debbugs.gnu.org; Tue, 17 Sep 2019 18:03:19 -0400
Received: from eggs.gnu.org ([209.51.188.92]:59931)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1iALZ7-0000jZ-8o
 for 36785 <at> debbugs.gnu.org; Tue, 17 Sep 2019 18:03:17 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:48476)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1iALYu-0000ZQ-2w; Tue, 17 Sep 2019 18:03:05 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=48516 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1iALYt-0004NS-IF; Tue, 17 Sep 2019 18:03:03 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Julien Lepiller <julien@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
 <87tvb9qktd.fsf@HIDDEN>
Date: Wed, 18 Sep 2019 00:03:01 +0200
In-Reply-To: <87tvb9qktd.fsf@HIDDEN> ("Ludovic
 \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\=
 \=\?utf-8\?Q\?s\?\= message of "Fri, 26 Jul 2019 10:09:02 +0200")
Message-ID: <87woe6fune.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org, Tobias Geerinckx-Rice <me@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Ludovic Court=C3=A8s <ludo@HIDDEN> skribis:

> Indeed.  I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile-di=
rectory=E2=80=99 and
> (canonicalize-profile %user-profile-directory), and here=E2=80=99s what I=
 see
> with =E2=80=98sudo=E2=80=99:
>
> $ sudo -E ./pre-inst-env guix pull
>
> ;;; (pd "/var/guix/profiles/per-user/root")
>
> ;;; (upd "/home/ludo/.config/guix/current")

I used =E2=80=98-E=E2=80=99 above, which is why HOME was ~ludo instead of ~=
root.
Without =E2=80=98-E=E2=80=99, HOME is ~root as expected, and so =E2=80=9Csu=
do guix pull=E2=80=9D does
the right thing (this is on Guix System):

--8<---------------cut here---------------start------------->8---
$ sudo guix repl
GNU Guile 2.2.4
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (getenv "HOME")
$1 =3D "/root"
scheme@(guix-user)> ,m(guix scripts pull)
scheme@(guix scripts pull)> %profile-directory
$2 =3D "/var/guix/profiles/per-user/root"
scheme@(guix scripts pull)> %user-profile-directory
$3 =3D "/root/.config/guix/current"
scheme@(guix scripts pull)> (cache-directory)
$4 =3D "/root/.cache/guix"
scheme@(guix scripts pull)> (config-directory)
$5 =3D "/root/.config/guix"
--8<---------------cut here---------------end--------------->8---

So =E2=80=98sudo guix pull=E2=80=99 really updates root=E2=80=99s profile a=
nd writes to
~root/.cache, everything is fine.

Done?

I investigated a bit, tried Debian, then Ubuntu, and found that =E2=80=98su=
do=E2=80=99
on Ubuntu behaves differently: it preserves =E2=80=98HOME=E2=80=99 by defau=
lt:

  $ sudo env | grep HOME
  HOME=3D/home/ubuntu

This is written here:

  https://help.ubuntu.com/community/RootSudo#Special_notes_on_sudo_and_shel=
ls

(That=E2=80=99s with sudo 1.8.21p2, FWIW.)

Ubuntu=E2=80=99s /etc/sudoers doesn=E2=80=99t have anything special.  Actua=
lly, Debian
has (almost) the same /etc/sudoers and yet it does not preserve HOME.

(Time passes=E2=80=A6)

Digging further, I fetched the source from
<https://packages.ubuntu.com/bionic/sudo>, and boom! I found the
culprit: it=E2=80=99s called =E2=80=98debian/patches/keep_home_by_default.p=
atch=E2=80=99.

--8<---------------cut here---------------start------------->8---
Description: Set HOME in initial_keepenv_table
 Set HOME in initial_keepenv_table; without this, $HOME will never be=20
 preserved unless added to keep_env.  There's appropriate logic to handle
 resetting the home for -H and -i options, so this is the only part that's
 missing.
Author: Steve Langasek <steve.langasek@HIDDEN>
--- a/plugins/sudoers/env.c
+++ b/plugins/sudoers/env.c
@@ -189,6 +189,7 @@
     "COLORS",
     "DISPLAY",
     "DPKG_COLORS",
+    "HOME",
     "HOSTNAME",
     "KRB5CCNAME",
     "LS_COLORS",
--8<---------------cut here---------------end--------------->8---

(This patch is playing with fire IMO.  If you=E2=80=99re an Ubuntu user,
consider reporting a bug!)

But anyway, what can we do?

We could ignore the issue, it=E2=80=99s-Ubuntu=E2=80=99s-fault, done.

We could also add some logic to detect whether (1) we=E2=80=99re running un=
der
sudo, and in that case, and whether (2) $HOME matches $USER=E2=80=99s home
directory as it appears in /etc/passwd.  If both conditions are
satisfied, we could ignore $HOME and use the home directory from
/etc/passwd instead.

But=E2=80=A6 that=E2=80=99s complicated, and it=E2=80=99d break uses of =E2=
=80=98sudo -H=E2=80=99.

We could apply the patch I posted earlier, which simply disables profile
migration when SUDO_USER is set.  That won=E2=80=99t address the fact that =
root
writes to the user=E2=80=99s ~/.cache, but there=E2=80=99s not much we can =
do here.

Thoughts?

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.
Merged 36785 37148. Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Changed bug title to ''sudo guix pull' failure in the profile migration code' from 'Impossible to pull on foreign distro' Request was from Ludovic Courtès <ludo@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 26 Jul 2019 08:09:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 26 04:09:16 2019
Received: from localhost ([127.0.0.1]:40778 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hqvHw-0000lN-4m
	for submit <at> debbugs.gnu.org; Fri, 26 Jul 2019 04:09:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51858)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1hqvHu-0000l8-7N
 for 36785 <at> debbugs.gnu.org; Fri, 26 Jul 2019 04:09:14 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59682)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1hqvHm-0002qO-3S; Fri, 26 Jul 2019 04:09:06 -0400
Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=57130 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1hqvHk-0002PK-Ir; Fri, 26 Jul 2019 04:09:04 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Julien Lepiller <julien@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
 <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
Date: Fri, 26 Jul 2019 10:09:02 +0200
In-Reply-To: <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN> (Julien
 Lepiller's message of "Fri, 26 Jul 2019 08:22:01 +0200")
Message-ID: <87tvb9qktd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi Julien,

Julien Lepiller <julien@HIDDEN> skribis:

> Le 26 juillet 2019 01:03:08 GMT+02:00, "Ludovic Court=C3=A8s" <ludo@HIDDEN=
rg> a =C3=A9crit :

[...]

>>;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks.=20
>>Move
>>  ;; them to %PROFILE-DIRECTORY.
>>  (unless (string=3D? %profile-directory
>>              (dirname (canonicalize-profile %user-profile-directory)))
>>    (migrate-generations %user-profile-directory %profile-directory))

[...]

> Could there be some veird interaction between sudo and these %profile-dir=
ectory and %user-profile-directory variables?

Indeed.  I added =E2=80=98pk=E2=80=99 calls to print =E2=80=98%profile-dire=
ctory=E2=80=99 and
(canonicalize-profile %user-profile-directory), and here=E2=80=99s what I s=
ee
with =E2=80=98sudo=E2=80=99:

--8<---------------cut here---------------start------------->8---
$ sudo -E ./pre-inst-env guix pull

;;; (pd "/var/guix/profiles/per-user/root")

;;; (upd "/home/ludo/.config/guix/current")
Migrating profile generations to '/var/guix/profiles/per-user/root'...
guix pull: error: symlink: Dosiero jam ekzistas: "/var/guix/profiles/per-us=
er/root/current-guix"
--8<---------------cut here---------------end--------------->8---

=E2=80=98%user-profile-directory=E2=80=99 is computed as a function of $HOM=
E, which is
unchanged when using =E2=80=98sudo=E2=80=99, whereas =E2=80=98%profile-dire=
ctory=E2=80=99 is computed as
a function of $USER.

I think $HOME should always prevail over the home directory defined in
/etc/passwd, so think we should not change the way
=E2=80=98%user-profile-directory=E2=80=99 is computed.

We could do this:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline

--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1721,7 +1721,8 @@ because the NUMBER is zero.)"
 
 (define %profile-directory
   (string-append %state-directory "/profiles/"
-                 (or (and=> (or (getenv "USER")
+                 (or (and=> (or (getenv "SUDO_USER")
+                                (getenv "USER")
                                 (getenv "LOGNAME"))
                             (cut string-append "per-user/" <>))
                      "default")))

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


=E2=80=A6 but then =E2=80=98sudo guix pull=E2=80=99 won=E2=80=99t update ro=
ot=E2=80=99s guix at all.

Otherwise I=E2=80=99m thinking of this gross hack:


--=-=-=
Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 54bbaddf30..8d8a8aa889 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -293,8 +293,9 @@ true, display what would be built without actually buil=
ding it."
=20
   ;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks.  =
Move
   ;; them to %PROFILE-DIRECTORY.
-  (unless (string=3D? %profile-directory
-                    (dirname (canonicalize-profile %user-profile-directory=
)))
+  (unless (or (getenv "SUDO_USER")
+              (string=3D? (pk 'pd %profile-directory)
+                        (dirname (pk 'upd (canonicalize-profile %user-prof=
ile-directory)))))
     (migrate-generations %user-profile-directory %profile-directory))
=20
   ;; Make sure ~/.config/guix/current points to /var/guix/profiles/=E2=80=
=A6.

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


I think it=E2=80=99s acceptable because that=E2=80=99s =E2=80=9Cthrow away=
=E2=80=9D code anyway, and
it=E2=80=99s not supposed to be triggered these days.

Thoughts?

Ludo=E2=80=99.

--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 26 Jul 2019 06:22:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 26 02:22:05 2019
Received: from localhost ([127.0.0.1]:40726 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hqtcC-0004S3-N3
	for submit <at> debbugs.gnu.org; Fri, 26 Jul 2019 02:22:04 -0400
Received: from lepiller.eu ([89.234.186.109]:35554)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <julien@HIDDEN>) id 1hqtcA-0004Rd-KF
 for 36785 <at> debbugs.gnu.org; Fri, 26 Jul 2019 02:22:03 -0400
Received: from lepiller.eu (localhost [127.0.0.1])
 by lepiller.eu (OpenSMTPD) with ESMTP id 9e98a86d;
 Fri, 26 Jul 2019 06:22:00 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lepiller.eu; h=date
 :in-reply-to:references:mime-version:content-type
 :content-transfer-encoding:subject:to:cc:from:message-id; s=
 dkim; bh=BA7HlOTERs0zlhGGACG1DCgs9bo=; b=AXoiKT2pA58oH32gmnEa123
 rK5gBuAZYDRpHqKk+deKoiILvZkePTPIMM2RSDSHi9US4syknjWjEr89PMTMzrso
 kNbywP0TAUG3r1sCWEsc7X973yuzDpX7ayBvP9Ew+L0iqWKeuykMzx6b+HWo/5lq
 YHxm8qVecoB2t9EPpXiTtSn+o1P89tmU8ssZ2a0wSe11VvyxOiduL1TFOVhbuUIT
 rqXbA5s/4cPqasF0zVxO8Szp9codAJyhtjucnRFKFg0EGfYgYUwACJ+yzQEWzQZN
 OU6nwB/WqBjPt3B6XdR8z/qnTnYuNv2QNbnoEXn/jh7vmawtOJvujZRnNi5NFFQ=
 =
DomainKey-Signature: a=rsa-sha1; c=nofws; d=lepiller.eu; h=date
 :in-reply-to:references:mime-version:content-type
 :content-transfer-encoding:subject:to:cc:from:message-id; q=dns;
 s=dkim; b=Ff2Me78XsMX1Z9TQfLX8CirM8rjIhplgsprVMJzX/ursoxGKWPHpQ
 yjghJV+5Xi02yw1XMr3jEJP1GnscUM0jWfRwA0X38qplaEQ0NOqyMEzxsUjIstzs
 i1ept4SkLOH5gtPrSHT8qt0hF3ON425Rlg3Qqjp36zMzge1WVCIlSAYzBKC3zTkJ
 4ba/TjGH0tFBtCp+qsB4XqZ73rx/ajJ98QnzRyBZzXU+mxWRlYL0eXDuXm3X/YZ6
 gE82qDppMCJiN2am2w1QC6Er1hR8VlnlrUQO24WXDbbo4ADPA7P8YWNfzZ7LIwKG
 pn3mhAunA1SKIuHSaYQjek3zQxRVUqflQ==
Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id f47cf94f
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); 
 Fri, 26 Jul 2019 06:21:59 +0000 (UTC)
Date: Fri, 26 Jul 2019 08:22:01 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <874l39ra37.fsf@HIDDEN>
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
 <874l39ra37.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#36785: Impossible to pull on foreign distro
To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= <ludo@HIDDEN>
From: Julien Lepiller <julien@HIDDEN>
Message-ID: <3DC355B8-FE36-4C4E-BBC9-EEC5F580AF0D@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Le 26 juillet 2019 01:03:08 GMT+02:00, "Ludovic Court=C3=A8s" <ludo@gnu=2Eo=
rg> a =C3=A9crit :
>Hi Julien,
>
>Julien Lepiller <julien@lepiller=2Eeu> skribis:
>
>> I gave a small tutorial to someone today, where we installed guix on
>top of a foreign distro=2E We used the script and everything went
>smoothly, and after finding out that we were going to build php (we
>were trying to define a VM that would serve one of their services), we
>tried to run guix pull:
>>
>> sudo guix pull =E2=80=94commit=3D=E2=80=A6
>>
>> However the command failed immediately with:
>>
>> Migrating profile generations to
>'/var/guix/profiles/per-user/root'=2E=2E=2E
>> Guix pull: error: symlink: File exists:
>"/var/guix/profiles/per-user/root/current-guix"
>>
>> Indeed, the file exists and everything looks good=2E Why does guix try
>to migrate a profile that's already good?
>>
>> I was able to work around that situation, but it's not great for our
>users=2E
>
>I=E2=80=99m guessing the machine had remnants of a previous Guix installa=
tion,
>no?  See:
>
>;; In 0=2E15=2E0+ we'd create ~/=2Econfig/guix/current-[0-9]*-link symlin=
ks=2E=20
>Move
>  ;; them to %PROFILE-DIRECTORY=2E
>  (unless (string=3D? %profile-directory
>              (dirname (canonicalize-profile %user-profile-directory)))
>    (migrate-generations %user-profile-directory %profile-directory))
>
>Ludo=E2=80=99=2E

Not at all, this was the first install on that machine=2E The OS was even =
installed recently, so there can't be any remnant of the 0=2E15 era :)=2E I=
nstallation went smoothly and /root/=2Econfig/guix/current was already a sy=
mlink to /var/guix/profiles/per-user/root=2E We ran guix pull as user just =
before and it worked perfectly well (with the message about migrating, alth=
ough ~/=2Econfig/guix/current didn't exist)=2E

Could there be some veird interaction between sudo and these %profile-dire=
ctory and %user-profile-directory variables?




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at 36785 <at> debbugs.gnu.org:


Received: (at 36785) by debbugs.gnu.org; 25 Jul 2019 23:03:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 25 19:03:20 2019
Received: from localhost ([127.0.0.1]:40592 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hqmlb-0006au-LA
	for submit <at> debbugs.gnu.org; Thu, 25 Jul 2019 19:03:19 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51409)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1hqmlY-0006ag-1A
 for 36785 <at> debbugs.gnu.org; Thu, 25 Jul 2019 19:03:16 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:52719)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ludo@HIDDEN>)
 id 1hqmlS-0000q5-Rq; Thu, 25 Jul 2019 19:03:10 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=49996 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <ludo@HIDDEN>)
 id 1hqmlR-0002U9-NG; Thu, 25 Jul 2019 19:03:10 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Julien Lepiller <julien@HIDDEN>
Subject: Re: bug#36785: Impossible to pull on foreign distro
References: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: 8 Thermidor an 227 de la =?utf-8?Q?R=C3=A9volution?=
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Fri, 26 Jul 2019 01:03:08 +0200
In-Reply-To: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN> (Julien
 Lepiller's message of "Wed, 24 Jul 2019 16:40:42 +0200")
Message-ID: <874l39ra37.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 36785
Cc: 36785 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Julien,

Julien Lepiller <julien@HIDDEN> skribis:

> I gave a small tutorial to someone today, where we installed guix on top =
of a foreign distro. We used the script and everything went smoothly, and a=
fter finding out that we were going to build php (we were trying to define =
a VM that would serve one of their services), we tried to run guix pull:
>
> sudo guix pull =E2=80=94commit=3D=E2=80=A6
>
> However the command failed immediately with:
>
> Migrating profile generations to '/var/guix/profiles/per-user/root'...
> Guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/root=
/current-guix"
>
> Indeed, the file exists and everything looks good. Why does guix try to m=
igrate a profile that's already good?
>
> I was able to work around that situation, but it's not great for our user=
s.

I=E2=80=99m guessing the machine had remnants of a previous Guix installati=
on,
no?  See:

  ;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks.  M=
ove
  ;; them to %PROFILE-DIRECTORY.
  (unless (string=3D? %profile-directory
                    (dirname (canonicalize-profile %user-profile-directory)=
))
    (migrate-generations %user-profile-directory %profile-directory))

Ludo=E2=80=99.




Information forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Jul 2019 14:40:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 24 10:40:51 2019
Received: from localhost ([127.0.0.1]:37842 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hqIRj-0007Tg-I1
	for submit <at> debbugs.gnu.org; Wed, 24 Jul 2019 10:40:47 -0400
Received: from lists.gnu.org ([209.51.188.17]:32808)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <julien@HIDDEN>) id 1hqIRi-0007TZ-0h
 for submit <at> debbugs.gnu.org; Wed, 24 Jul 2019 10:40:46 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:33617)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <julien@HIDDEN>) id 1hqIRh-0006E5-0R
 for bug-guix@HIDDEN; Wed, 24 Jul 2019 10:40:45 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: ***
X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_40,RCVD_IN_SBL_CSS
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <julien@HIDDEN>) id 1hqIRf-0003NK-3i
 for bug-guix@HIDDEN; Wed, 24 Jul 2019 10:40:44 -0400
Received: from lepiller.eu ([2a00:5884:8208::1]:54100)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <julien@HIDDEN>) id 1hqIRe-0003LX-Rg
 for bug-guix@HIDDEN; Wed, 24 Jul 2019 10:40:43 -0400
Received: from [131.254.252.98] (205.emeraldonion.org [23.129.64.205])
 by lepiller.eu (OpenSMTPD) with ESMTPSA id 920a0358
 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <bug-guix@HIDDEN>;
 Wed, 24 Jul 2019 14:40:38 +0000 (UTC)
Date: Wed, 24 Jul 2019 16:40:42 +0200
User-Agent: K-9 Mail for Android
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Impossible to pull on foreign distro
To: bug-guix@HIDDEN
From: Julien Lepiller <julien@HIDDEN>
Message-ID: <6733C9AB-E5C1-4B63-8F0E-04CD1BB32338@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:5884:8208::1
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi guix, I gave a small tutorial to someone today, where we
 installed guix on top of a foreign distro. We used the script and everything
 went smoothly, and after finding out that we were going to build php (we
 [...] Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [23.129.64.205 listed in zen.spamhaus.org]
 0.0 SPF_NONE               SPF: sender does not publish an SPF Record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,
 medium trust [209.51.188.17 listed in list.dnswl.org]
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

Hi guix,

I gave a small tutorial to someone today, where we installed guix on top o=
f a foreign distro=2E We used the script and everything went smoothly, and =
after finding out that we were going to build php (we were trying to define=
 a VM that would serve one of their services), we tried to run guix pull:

sudo guix pull =E2=80=94commit=3D=E2=80=A6

However the command failed immediately with:

Migrating profile generations to '/var/guix/profiles/per-user/root'=2E=2E=
=2E
Guix pull: error: symlink: File exists: "/var/guix/profiles/per-user/root/=
current-guix"

Indeed, the file exists and everything looks good=2E Why does guix try to =
migrate a profile that's already good?

I was able to work around that situation, but it's not great for our users=
=2E




Acknowledgement sent to Julien Lepiller <julien@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#36785; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 27 Sep 2019 15:30:02 UTC

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