Carlos Sánchez de La Lama (2016-09-20 09:39 +0200) wrote: > Hi, > >>> Is this the intended behaviour? I am wondering whether packages with >>> search paths should include both the user-profile directories and the >>> system-profile ones. >> >> I think you’re right. This was discussed at >> <http://bugs.gnu.org/20255>, leading to a patch (for GuixSD). >> >> However, we failed to build consensus around the approach of this patch, >> so we did not apply it. If you have ideas, please email >> 20...@debbugs.gnu.org. :-) > > what about something like: > > - /etc/profile > # [...] > GUIX_PROFILES="/run/current-system/profile:$HOME/.guix-profile" > . /run/current-system/profile/etc/profile > # [...] > . "$HOME/.guix-profile/etc/profile" > # [...] > > - /run/current-system/profile/etc/profile > profiles="${GUIX_PROFILES:=/gnu/store/<hashA>-profile}" > export PATH="${profiles//:/\/bin}/bin ${profiles//:/\/sbin}/sbin" > # [...] > > > - $HOME/.guix-profile/etc/profile > profiles="${GUIX_PROFILES:=/gnu/store/<hashB>-profile}" > export ACLOCAL_PATH="${profiles//:/\/share/aclocal}/share/aclocal" > # [...] > > That is, each profile adds all its search paths to all the profile roots > passed in the colon separated variable GUIX_PROFILES. If GUIX_PROFILES > is empty, it adds the search paths inside its own directory only (as > until now).
I think it was mentioned somewhere in the bug discussion: this will not work for some things. For example, if a user has 'guile' in a system profile, and several guile packages (but not 'guile' itself) in ~/.guix-profile, then GUILE_LOAD_PATH will include "<system-profile>/share/guile/site/2.0" but not "<user-profile>/share/guile/site/2.0". That's why combining profiles inside "guix package --search-paths" command looks like the only solution. -- Alex