GNU bug report logs - #77527
[PATCH v4 5/6] guix-install.sh: Group profile sourcing.

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: Hilton Chain <hako@HIDDEN>; Keywords: patch; merged with #77035, #77522, #77523, #77524, #77525, #77526, #77528; dated Fri, 4 Apr 2025 03:24:07 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
Merged 77035 77522 77523 77524 77525 77526 77527 77528. Request was from Hilton Chain <hako@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at submit) by debbugs.gnu.org; 4 Apr 2025 03:23:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Apr 03 23:23:57 2025
Received: from localhost ([127.0.0.1]:36548 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u0Xev-0002bP-9Z
	for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:57 -0400
Received: from lists.gnu.org ([2001:470:142::17]:32952)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <hako@HIDDEN>)
 id 1u0Xes-0002aK-15
 for submit <at> debbugs.gnu.org; Thu, 03 Apr 2025 23:23:54 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hako@HIDDEN>)
 id 1u0Xem-0006tY-NZ
 for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:48 -0400
Received: from mx.boiledscript.com ([88.99.243.112])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <hako@HIDDEN>)
 id 1u0Xel-0002is-0o
 for guix-patches@HIDDEN; Thu, 03 Apr 2025 23:23:48 -0400
From: Hilton Chain <hako@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space;
 s=mail; t=1743737025;
 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:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=2Klkhi6hIObdEXUoc1WrSi6YuLCRK/lw5odfrGdGnLQ=;
 b=iJeElmZWjhtwr0uefZ0SmUGJ5X7lpagswx4NJ0VJPGHbXmsPrJ/Fx9Q5G4aoRjK/Hi+JG4
 RjOF1yewbHXGCRTPcaLe0/kwcLVSIrzJMpH5aCDB+I23dyqRpy4xZIEJ30CcQuHaAS2/Lx
 LZO6eAsq2TgVc8AoRGMZ1DM9KwNYcW9gdJSEuT0sQ0VqzPG6v4UlhxBq6atXMwQsh39y2H
 9B78nh3h+wdS2/gvSaAXKhwWmQYZu+P8u8j3+F01kcOALU751SLTVH7sbPaVYiGBdb6Phi
 TeNJxIweAPXpF4WCYJiIx0CUlEs+NbHcOwfVpxxTSq+da8CbxTF7YYcNrzpCdg==
To: guix-patches@HIDDEN
Subject: [PATCH v4 5/6] guix-install.sh: Group profile sourcing.
Date: Fri,  4 Apr 2025 11:23:02 +0800
Message-ID: <cd5b26dc8e9ee75feccbe230917559afc27dfdca.1743736516.git.hako@HIDDEN>
In-Reply-To: <cover.1743736516.git.hako@HIDDEN>
References: <cover.1743736516.git.hako@HIDDEN>
MIME-Version: 1.0
X-MS-Reactions: disallow
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=88.99.243.112; envelope-from=hako@HIDDEN;
 helo=mx.boiledscript.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
Cc: Hilton Chain <hako@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: -0.0 (/)

* etc/guix-install.sh (sys_create_init_profile): Group sourcing of all default
profiles.

Change-Id: Ia443b78a5ba656b7d03e1abbba53c4bf1240e338
---
 etc/guix-install.sh | 69 +++++++++++++++++++++++++--------------------
 1 file changed, 38 insertions(+), 31 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index b5d833cd64..f0d37bc384 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -749,47 +749,54 @@ export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}"
 export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
 # no default for XDG_RUNTIME_DIR (depends on foreign distro for semantics)
 
-# `guix pull` profile
-GUIX_PROFILE="$HOME/.config/guix/current"
-export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH"
-# Add to INFOPATH and MANPATH so the latest Guix documentation is available to
-# info and man readers.  When INFOPATH is unset, add a trailing colon so Emacs
-# searches 'Info-default-directory-list'.  When MANPATH is unset, add a
-# trailing colon so the system default search path is used.
-export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH"
-export MANPATH="$GUIX_PROFILE/share/man:$MANPATH"
-# Expose the latest Guix modules to Guile so guix shell and repls spawned by
-# e.g. Geiser work out of the box.
-export GUILE_LOAD_PATH="$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
-export GUILE_LOAD_COMPILED_PATH="$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
-
-# User's default profile, if it exists
-GUIX_PROFILE="$HOME/.guix-profile"
-if [ -L "$GUIX_PROFILE" ]; then
-  . "$GUIX_PROFILE/etc/profile"
-
-  # see info '(guix) Application Setup'
-  export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH"
-
-  # Documentation search paths may be handled by $GUIX_PROFILE/etc/profile if
-  # the user installs info and man readers via Guix.  If the user doesn’t,
-  # explicitly add to them so documentation for software from ‘guix install’
-  # is available to the system info and man readers.
+# Set up environment for all default profiles.
+for GUIX_PROFILE in "$HOME/.guix-home/profile" \
+                    "$HOME/.guix-profile" \
+                    "$HOME/.config/guix/current"
+do
+  if [ -f "$GUIX_PROFILE/etc/profile" ]; then
+    . "$GUIX_PROFILE/etc/profile"
+    if [ ! \"$GUIX_PROFILE\" = \"$HOME/.config/guix/current\" ]; then
+      # See info '(guix) Application Setup'.
+      case $GUIX_LOCPATH in
+        *GUIX_PROFILE/lib/locale*) ;;
+        *) export GUIX_LOCPATH="$GUIX_PROFILE/lib/locale${GUIX_LOCPATH:+:}$GUIX_LOCPATH" ;;
+      esac
+    fi
+  fi
+  if [ \"$GUIX_PROFILE\" = \"$HOME/.config/guix/current\" ]; then
+    # Expose the latest Guix modules to Guile so guix shell and repls spawned by
+    # e.g. Geiser work out of the box.
+    case $GUILE_LOAD_PATH in
+      *$GUIX_PROFILE/share/guile/site/3.0*) ;;
+      *) export GUILE_LOAD_PATH=\"$GUIX_PROFILE/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH\" ;;
+    esac
+    case $GUILE_LOAD_COMPILED_PATH in
+      *$GUIX_PROFILE/lib/guile/3.0/site-ccache*) ;;
+      *) export GUILE_LOAD_COMPILED_PATH=\"$GUIX_PROFILE/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH\" ;;
+    esac
+  fi
+  # Make basic things just work when the user installs their first package.
+  case $PATH in
+    *$GUIX_PROFILE/bin*) ;;
+    *) export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH" ;;
+  esac
+  # Add to INFOPATH and MANPATH so the latest Guix documentation is available to
+  # info and man readers.  When INFOPATH is unset, add a trailing colon so Emacs
+  # searches 'Info-default-directory-list'.  When MANPATH is unset, add a
+  # trailing colon so the system default search path is used.
   case $INFOPATH in
     *$GUIX_PROFILE/share/info*) ;;
     *) export INFOPATH="$GUIX_PROFILE/share/info:$INFOPATH" ;;
   esac
   case $MANPATH in
     *$GUIX_PROFILE/share/man*) ;;
-    *) export MANPATH="$GUIX_PROFILE/share/man:$MANPATH"
+    *) export MANPATH="$GUIX_PROFILE/share/man:$MANPATH" ;;
   esac
-fi
+done
 
 # NOTE: Guix Home handles its own profile initialization in ~/.profile. See
 # info '(guix) Configuring the Shell'.
-
-# Clean up after ourselves.
-unset GUIX_PROFILE
 EOF
 }
 
-- 
2.49.0





Acknowledgement sent to Hilton Chain <hako@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#77527; 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: Fri, 4 Apr 2025 03:30:02 UTC

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