From: csanchezdll@gmail.com (Carlos Sánchez de La Lama)
To: Alex Kost <alezost@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: User-profile search paths should include system-profile directories
Date: Tue, 20 Sep 2016 16:38:44 +0200 [thread overview]
Message-ID: <7td1jyab63.fsf@gmail.com> (raw)
In-Reply-To: <87bmziabse.fsf@gmail.com> (Alex Kost's message of "Tue, 20 Sep 2016 17:25:21 +0300")
Alex Kost <alezost@gmail.com> writes:
> 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
>>> 20255@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.
It will actually solve it, that is the case I was trying to fix in
fact. The code I show will include /share/guile/site/2.0 prefixed
by every root in the colon-separated list GUIX_PROFILES (note the
difference with current code with has GUIX_PROFILE, singular). If
GUIX_PROFILES is (as in the example):
GUIX_PROFILES="/run/current-system/profile:$HOME/.guix-profile"
And guile is in the system profile, the line
export GUILE_LOAD_PATH="${profiles//://share/guile/site/2.0:}/share/guile/site/2.0"
will produce:
export GUILE_LOAD_PATH=/run/current-system/profile/share/guile/site/2.0:$HOME/.guix-profile/share/guile/site/2.0
As desired. Same result if guile is only in user profile, or if it is on
both. Try the following in bash:
profiles="/run/current-system/profile:$HOME/.guix-profile:/my/third/profile"
echo "${profiles//://share/guile/site/2.0:}/share/guile/site/2.0"
BR
Carlos
next prev parent reply other threads:[~2016-09-20 14:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-14 7:35 User-profile search paths should include system-profile directories Carlos Sánchez de La Lama
2016-09-14 14:58 ` Ludovic Courtès
2016-09-15 7:38 ` Alex Kost
2016-09-19 14:08 ` Customizing /etc Ludovic Courtès
2016-09-20 14:14 ` Alex Kost
2016-09-20 7:39 ` User-profile search paths should include system-profile directories Carlos Sánchez de La Lama
2016-09-20 14:25 ` Alex Kost
2016-09-20 14:38 ` Carlos Sánchez de La Lama [this message]
2016-09-21 15:22 ` Ludovic Courtès
2016-09-22 9:59 ` Carlos Sánchez de La Lama
2016-09-24 2:57 ` Ludovic Courtès
2016-09-26 11:19 ` Carlos Sánchez de La Lama
2016-09-30 20:16 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7td1jyab63.fsf@gmail.com \
--to=csanchezdll@gmail.com \
--cc=alezost@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).