From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SCxIKghS91+5MwAA0tVLHw (envelope-from ) for ; Thu, 07 Jan 2021 18:25:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +P8xJghS918PdgAAbx9fmQ (envelope-from ) for ; Thu, 07 Jan 2021 18:25:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6B58994021E for ; Thu, 7 Jan 2021 18:25:12 +0000 (UTC) Received: from localhost ([::1]:44416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxZyB-0003y0-4s for larch@yhetil.org; Thu, 07 Jan 2021 13:25:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51594) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxZy2-0003xN-9u for guix-patches@gnu.org; Thu, 07 Jan 2021 13:25:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:37117) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxZy2-0004n0-1O for guix-patches@gnu.org; Thu, 07 Jan 2021 13:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kxZy1-0006pv-TP for guix-patches@gnu.org; Thu, 07 Jan 2021 13:25:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45632] [PATCH] guix package: Warn if uses has 'guix' package in profile. References: <20210103183202.11224-1-kuba@kadziolka.net> Resent-From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 Jan 2021 18:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45632 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimon.toutoune@gmail.com, me@tobias.gr, 45632@debbugs.gnu.org X-Debbugs-Original-To: "zimoun" , "Tobias Geerinckx-Rice" , "Tobias Geerinckx-Rice via Guix-patches" X-Debbugs-Original-Cc: 45632@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161004386126206 (code B ref -1); Thu, 07 Jan 2021 18:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jan 2021 18:24:21 +0000 Received: from localhost ([127.0.0.1]:48663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxZxM-0006oa-Ks for submit@debbugs.gnu.org; Thu, 07 Jan 2021 13:24:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:38520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxZxK-0006oR-IF for submit@debbugs.gnu.org; Thu, 07 Jan 2021 13:24:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxZxK-0003tx-Cm for guix-patches@gnu.org; Thu, 07 Jan 2021 13:24:18 -0500 Received: from pat.zlotemysli.pl ([37.59.186.212]:53648) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxZxI-0004V9-3U for guix-patches@gnu.org; Thu, 07 Jan 2021 13:24:18 -0500 Received: (qmail 26568 invoked by uid 1009); 7 Jan 2021 19:24:07 +0100 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/26041. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.04253 secs); 07 Jan 2021 18:24:07 -0000 Received: from unknown (HELO localhost) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with SMTP; 7 Jan 2021 19:24:07 +0100 Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Date: Thu, 07 Jan 2021 18:58:14 +0100 Message-Id: In-Reply-To: Received-SPF: none client-ip=37.59.186.212; envelope-from=kuba@kadziolka.net; helo=pat.zlotemysli.pl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 6B58994021E X-Spam-Score: -1.35 X-Migadu-Scanner: scn0.migadu.com X-TUID: TWP76TTuB2vk On Thu Jan 7, 2021 at 6:56 PM CET, zimoun wrote: > Well, if the conflict is between the package 'guix' and the 'upgrade' > command, then the warning should be there, IMHO. The upgrade command is not part of the problem here, the same can be observed if you use 'guix package -m' instead. You avoid the problem by putting ~/.config/guix/current/bin first in your path. I just checked, and that is the default on Guix System. However, on a foreign distro, ~/.guix-profile/bin will be first in $PATH unless the user intervenes with manual configuration. In light of this, perhaps a better solution would be to unify the profile loading in foreign-Guix's /etc/profile/guix.sh with Guix System's /etc/profile? The problem with that is, /etc/profile/guix.sh is only created once by guix-install.sh, and doesn't get updated... perhaps *this* is something worth fixing, to start with? > > How about warning on pull instead? That should address the =E2=80=98ha= lp, > > me Guix be Benjamin Buttonin'=E2=80=99 support calls that I assume > > inspired this. > > Wait, does someone install packages in the profile > "~/.config/guix/current"? And does they install the package 'guix' in > this profile? Nan... Nah, the scenario is much less convoluted: 1. $PATH contains ~/.guix-profile/bin:~/.config/guix/current/bin, in that order, as that is currently the default on a foreign distro. 2. User adds the guix package to their ~/.guix-profile. This doesn't need to happen with 'guix package -i', in fact the IRC conversation that inspired this [1] (though I seem to recall earlier occurrences of the same problem) the user was making use of a manifest file. It might even be easier to encounter this with a manifest file due to its clean-slate nature. 3. ~/.guix-profile/bin/guix now takes priority. This means - guix describe doesn't work - guix pull has no effect - guix package (-u or -m) will use an older 'guix' package than is currently installed, as a packaged guix version doesn't contain the package definition of itself, but the one that was previously packaged. I hope this helps resolve your confusion. Regards, Jakub K=C4=85dzio=C5=82ka [1]: http://logs.guix.gnu.org/guix/2021-01-01.log#163217