GNU bug report logs - #75130
[PATCH] home: Load system profile in setup-environment.

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-patches; Reported by: Antero Mejr <mail@HIDDEN>; Keywords: patch; dated Thu, 26 Dec 2024 23:28:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

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


Received: (at 75130) by debbugs.gnu.org; 27 Dec 2024 10:08:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 27 05:08:51 2024
Received: from localhost ([127.0.0.1]:44749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tR7H0-0007lf-SC
	for submit <at> debbugs.gnu.org; Fri, 27 Dec 2024 05:08:51 -0500
Received: from out-182.mta0.migadu.com ([91.218.175.182]:16540)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <andrew@HIDDEN>) id 1tR7Gw-0007lN-4f
 for 75130 <at> debbugs.gnu.org; Fri, 27 Dec 2024 05:08:48 -0500
X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and
 include these headers.
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=key1;
 t=1735294090;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=SvCwMYD8VyAd8uGSbeyVNj07kfNex+RAGYU53zbidfM=;
 b=eLy77aWr3foONselAWE7VwHidWUl2IetzXyLT72Cu0nVK8z8Uxe121FDewNQ5vVV+V8RVK
 yxEVE+HHYewKcAlvV7WnmNrXGANbgcw4202iWsYDweMVoHJSioHIYBH4upFQtQ+03jSZls
 aqAze4gPvC1OcWNaQLrP5gesGYRO6lQykL0FceIJW2f6ckUW1Rp4H7JqTV3MWxtuF2RbJW
 GtIbdzm/97LIBpz6GAuacfQ1oClJK6ANCZhGDcFb+dFSBoV/tmpcAsWPXwF20j73kTK9g3
 SBs0TFvQdG38ibXxhzOycpVu80sfoGUc3yaG0vK93cmsGdf2o1F5L6WZvyfGyg==
From: Andrew Tropin <andrew@HIDDEN>
To: Antero Mejr <mail@HIDDEN>, 75130 <at> debbugs.gnu.org
Subject: Re: [bug#75130] [PATCH] home: Load system profile in
 setup-environment.
In-Reply-To: <87a5ci10v1.fsf@HIDDEN>
References: <87a5ci10v1.fsf@HIDDEN>
Date: Fri, 27 Dec 2024 14:08:04 +0400
Message-ID: <87seq9moaj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha512; protocol="application/pgp-signature"
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 75130
Cc: ludo@HIDDEN, tanguy@HIDDEN, janneke@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.7 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On 2024-12-26 18:27, Antero Mejr wrote:

> This ensures packages installed with `guix install` are available on
> $PATH when using Guix home with a foreign distro.
>
> * gnu/home/services.scm (environment-variables->setup-environment-script):
> Load system profile while loading home profile in setup-environment.
>
> Change-Id: I96b047b92f3c050b15e521fecc96740390cae2ca
> ---
>  gnu/home/services.scm | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/home/services.scm b/gnu/home/services.scm
> index 39c9033ad6..1cf5ce0835 100644
> --- a/gnu/home/services.scm
> +++ b/gnu/home/services.scm
> @@ -268,8 +268,6 @@ (define (environment-variables->setup-environment-scr=
ipt vars)
>     %store-monad
>     (return
>      `(("setup-environment"
> -       ;; TODO: It's necessary to source ~/.guix-profile too
> -       ;; on foreign distros
>         ,(computed-file "setup-environment"
>                         #~(call-with-output-file #$output
>                             (lambda (port)
> @@ -280,6 +278,10 @@ (define (environment-variables->setup-environment-sc=
ript vars)
>  PROFILE_FILE=3D\"$HOME_ENVIRONMENT/profile/etc/profile\"
>  [ -f $PROFILE_FILE ] && . $PROFILE_FILE
>=20=20
> +SYSTEM_ENVIRONMENT=3D$HOME/.guix-profile
> +SYSTEM_PROFILE_FILE=3D\"$SYSTEM_ENVIRONMENT/etc/profile\"
> +[ -f $SYSTEM_PROFILE_FILE ] && . $SYSTEM_PROFILE_FILE
> +

IIRC, it called user profile.

/etc/profile on Guix System already contains this:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system.scm?h=3D092467b3=
b6#n1085
Unconditionally sourcing it two times is not the best idea (while it
probably will work most of the time, still feels wrong and probably can
cause unexpected issues).

There is a reason why GUIX_PROFILE is set before sourcing profile file.
Its value used to set PATH and similiar variables to
~/path/to/profile/bin instead of /gnu/blabla-profile/bin, so in case of
changing of ~/path/to/profile content/symlink all respective variables
don't require updates.

>  case $XDG_DATA_DIRS in
>    *$HOME_ENVIRONMENT/profile/share*) ;;
>    *) export XDG_DATA_DIRS=3D$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DI=
RS ;;
>
> base-commit: e4bdd464ebb49f4e698e5105f70b29688fff9475

=2D-=20
Best regards,
Andrew Tropin

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

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

iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmdufIQACgkQIgjSCVjB
3rDFRhAAi6kCH0GBzm95WhDiYQNABSUtnh5VgKxbcSnOqWWNlQqILHFgGvAnj8fX
SYTgLozybL64+KmHSSsw77NFqMkhPsYEYM3CoWHrLr6pUKNQhMn8+kdvQ6NCkWVD
qBavhTjCnafbGllhZlCoDERY+Hqf9IlaMj2V1BUC5LUHjdBlVCHl495eFJ2EucSS
OhAHK2hM5PoX5XtjeUwLv651OaciHgGWRQc3/T5CpNxS9ulw53vF8D+Nm/hzWdBe
G6swpqHa6Z+7DhzZog795RO0k+xQ8xtnVFBhpQMz3bF7+lMb0fGT8ahnioQzGxzW
K6J+BHiaiFqXKkiuyfz8v9WVs+hc8ts2V+Jg+kiqqYVsD7HDlCbVAhTNh+xYL/k3
np+RUaX1WtmpMpKGLlVwGGtTTGnuNGtsJJuWtiQ2FOEvxA9ICYrToT5++/QYckRk
yjcdLohbuqcGRDFAxm/aMTVzbD4gWXk8qVNGQX/MR0umKsMfqlxTu112GR1des06
mhvpmfGJk5EwCwC7bBKhD5vu+v03+pJkQz42EXXoTgOGrwpvP1DsBJBNp5gJwARY
0h115dYQ4S4VKawVTzml/poaSSHe8sBkj7U1TypGPxdlfBSgI1lY/kFvlgLMF1Jg
zRNfBl2pw08EC3L1++tt2V9vt+FDVkhroExWeD8c8TKinVRQ6h8=
=/Evr
-----END PGP SIGNATURE-----
--=-=-=--




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

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


Received: (at submit) by debbugs.gnu.org; 26 Dec 2024 23:27:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 26 18:27:40 2024
Received: from localhost ([127.0.0.1]:43131 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tQxGV-0000ub-SD
	for submit <at> debbugs.gnu.org; Thu, 26 Dec 2024 18:27:40 -0500
Received: from lists.gnu.org ([209.51.188.17]:44656)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mail@HIDDEN>) id 1tQxGU-0000uS-Ce
 for submit <at> debbugs.gnu.org; Thu, 26 Dec 2024 18:27:39 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1tQxGU-0002lE-3M
 for guix-patches@HIDDEN; Thu, 26 Dec 2024 18:27:38 -0500
Received: from sender4-op-o15.zoho.com ([136.143.188.15])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <mail@HIDDEN>) id 1tQxGS-0001Zo-6Z
 for guix-patches@HIDDEN; Thu, 26 Dec 2024 18:27:37 -0500
ARC-Seal: i=1; a=rsa-sha256; t=1735255653; cv=none; 
 d=zohomail.com; s=zohoarc; 
 b=U908+7bo/86iu862JJ7BvShHnzCreN6cjKPfL+6ejnBaRVB9O9MGAYxnDSBwMSAHTs6CcTowDUHsgU9B6c7bpKnG8id/+NlRTDeStyQRXbYHHblUvQBFnYD/s3hHKDHvuXnHK5VrbMbUGWAt1VrBbn04upEOUcNyc6doqhjrz3w=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc; t=1735255653;
 h=Content-Type:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To:Cc;
 bh=M1gn2AvfMyupoa9Xjc8AWkQyJANkPiVyyydCtKHq0fY=; 
 b=QAHguq9YI56LKbgvO6jvuejxVM4KPDfXWa1KoNK6eocuQT5WNT0PNBMbEYgQH4qZ53bYOWxulkUUXToWkmpBXFE/v0t7qo87UlJfuL34lB0ye8eKHHEPq/9mozd3pD8SNY47xmsk1rYjjqK+B7Rk85LyiW+Vw/DlbCS7SD3QYZQ=
ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass  header.i=antr.me;
 spf=pass  smtp.mailfrom=mail@HIDDEN;
 dmarc=pass header.from=<mail@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1735255653; 
 s=zmail; d=antr.me; i=mail@HIDDEN;
 h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To;
 bh=M1gn2AvfMyupoa9Xjc8AWkQyJANkPiVyyydCtKHq0fY=;
 b=UQn9G6UpiQ8pP91iT5VB6LJitQsGkQBRIShrbpJ2QHQwPzIM4gvxWAP+LdtxEy/C
 I9pPvyPbmdMdr5goM2saPENJhiyforpFCMzoOoWtEy9C1ZISK4Zdw8//JOvvecgWXsj
 VBG2Q4gJK5uZO4uaLDpk1Pb+HNroS2HsHPRFJeoI=
Received: by mx.zohomail.com with SMTPS id 1735255652102708.1165160971351;
 Thu, 26 Dec 2024 15:27:32 -0800 (PST)
From: Antero Mejr <mail@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] home: Load system profile in setup-environment.
X-Debbugs-Cc: andrew@HIDDEN, janneke@HIDDEN, ludo@HIDDEN,
 tanguy@HIDDEN
Date: Thu, 26 Dec 2024 18:27:30 -0500
Message-ID: <87a5ci10v1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-ZohoMailClient: External
Received-SPF: pass client-ip=136.143.188.15; envelope-from=mail@HIDDEN;
 helo=sender4-op-o15.zoho.com
X-Spam_score_int: -19
X-Spam_score: -2.0
X-Spam_bar: --
X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -0.6 (/)
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: -1.6 (-)


This ensures packages installed with `guix install` are available on
$PATH when using Guix home with a foreign distro.

* gnu/home/services.scm (environment-variables->setup-environment-script):
Load system profile while loading home profile in setup-environment.

Change-Id: I96b047b92f3c050b15e521fecc96740390cae2ca
---
 gnu/home/services.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 39c9033ad6..1cf5ce0835 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -268,8 +268,6 @@ (define (environment-variables->setup-environment-script vars)
    %store-monad
    (return
     `(("setup-environment"
-       ;; TODO: It's necessary to source ~/.guix-profile too
-       ;; on foreign distros
        ,(computed-file "setup-environment"
                        #~(call-with-output-file #$output
                            (lambda (port)
@@ -280,6 +278,10 @@ (define (environment-variables->setup-environment-script vars)
 PROFILE_FILE=\"$HOME_ENVIRONMENT/profile/etc/profile\"
 [ -f $PROFILE_FILE ] && . $PROFILE_FILE
 
+SYSTEM_ENVIRONMENT=$HOME/.guix-profile
+SYSTEM_PROFILE_FILE=\"$SYSTEM_ENVIRONMENT/etc/profile\"
+[ -f $SYSTEM_PROFILE_FILE ] && . $SYSTEM_PROFILE_FILE
+
 case $XDG_DATA_DIRS in
   *$HOME_ENVIRONMENT/profile/share*) ;;
   *) export XDG_DATA_DIRS=$HOME_ENVIRONMENT/profile/share:$XDG_DATA_DIRS ;;

base-commit: e4bdd464ebb49f4e698e5105f70b29688fff9475
-- 
2.47.1





Acknowledgement sent to Antero Mejr <mail@HIDDEN>:
New bug report received and forwarded. Copy sent to andrew@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to andrew@HIDDEN, janneke@HIDDEN, ludo@HIDDEN, tanguy@HIDDEN, guix-patches@HIDDEN:
bug#75130; Package guix-patches. 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: Sun, 12 Jan 2025 05:45:02 UTC

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