GNU bug report logs - #77525
[PATCH v4 2/6] system: /etc/profile: Rearrange to avoid search path duplication.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Fri, 4 Apr 2025 03:24:05 UTC

Severity: normal

Tags: patch

Merged with 77035, 77522, 77523, 77524, 77526, 77527, 77528

Full log


Message #19 received at 77525 <at> debbugs.gnu.org (full text, mbox):

From: 宋文武 <iyzsong <at> envs.net>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: 77525 <at> debbugs.gnu.org
Subject: Re: [bug#77525] [PATCH v4 2/6] system: /etc/profile: Rearrange to
 avoid search path duplication.
Date: Sat, 19 Apr 2025 10:13:52 +0800
Hilton Chain <hako <at> ultrarare.space> writes:

> * gnu/system.scm (operating-system-etc-service)[profile]: Set umask first.
OK.

> Group environment variables setup with profile sourcing to avoid duplication.
It was already grouped in previous commit, maybe "Setup crucial
variables from all the default profiles."

> Export $GUILE_LOAD_PATH and $GUILE_LOAD_COMPILED_PATH for ‘guix pull’ profile.
Could be a seperated commit, but maybe not needed?  Since 'guix repl'
would ensure it.

> * gnu/system/shadow.scm (%default-bash-profile): Remove duplicated exports.
I think this better go into a seperated commit, and with comment or
cookbook doc for the merge search paths from multiple profiles usage.

> [...]
>  do
> -  if [ -f \"$GUIX_PROFILE/etc/profile\" ]
> -  then
> +  if [ -f \"$GUIX_PROFILE/etc/profile\" ]; then
>      . \"$GUIX_PROFILE/etc/profile\"
> -  else
> -    # At least define this one so that basic things just work
> -    # when the user installs their first package.
> -    export PATH=\"$GUIX_PROFILE/bin:$PATH\"
> +    if [ ! \"$GUIX_PROFILE\" = \"$HOME/.config/guix/current\" ]; then
> +      # Crucial variables that could be missing in the profiles' 'etc/profile'
> +      # because they would require combining both profiles.
> +      # FIXME: See <http://bugs.gnu.org/20255>.
> +      case $XDG_DATA_DIRS in
> +        *$GUIX_PROFILE/share*) ;;
> +        *) export XDG_DATA_DIRS=\"$GUIX_PROFILE/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS\" ;;
> +      esac
> +      case $XDG_CONFIG_DIRS in
> +        *$GUIX_PROFILE/etc/xdg*) ;;
> +        *) export XDG_CONFIG_DIRS=\"$GUIX_PROFILE/etc/xdg${XDG_CONFIG_DIRS:+:}$XDG_CONFIG_DIRS\" ;;
> +      esac
> +      # Make sure libXcursor finds cursors installed into user or system profiles.
> +      # See <http://bugs.gnu.org/24445>

Commit 2acfafff set XCURSORPATH contains user and system profiles, but
not home profile as this patch did, this comment about 24445 can be
removed.

Otherwise, look good to me!




This bug report was last modified 153 days ago.

Previous Next


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