all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: "Ludovic Courtès" <ludo@gnu.org>, "Liam Hupfer" <liam@hpfr.net>,
	68498@debbugs.gnu.org
Subject: [bug#68498] [PATCH] guix-install.sh: Make Guix modules available too.
Date: Sun, 21 Apr 2024 08:15:15 +0200	[thread overview]
Message-ID: <87frvfw8b0.fsf@gnu.org> (raw)
In-Reply-To: <87il0biv19.fsf@gmail.com> (Maxim Cournoyer's message of "Sat, 20 Apr 2024 17:28:02 -0400")

Maxim Cournoyer writes:

Hi!

> Liam Hupfer <liam@hpfr.net> writes:
>
>> Hi all,
>>
>> I’m new to Guix and ran into the load path issue on foreign distros.
>>
>> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>>
>>> Ludovic Courtès <ludo@gnu.org> writes:
>>>
>>>> Janneke Nieuwenhuizen <janneke@gnu.org> skribis:
>>>>
>>>>> I’m still somewhat puzzled about why setting GUILE_LOAD[_COMPILED]_PATH
>>>>> would be a bad idea, but unless someone else decides to chimes some time
>>>>> soon in I guess we can close this bug.
>>>>
>>>> It’s not too bad, but (1) it could break the user’s setup (for instance
>>>> if they’ve installed some incompatible Guile versions via the host
>>>> distro and all of a sudden Guile 3.0.9 modules show up in the search
>>>> path), and (2) one could just as well consider special-casing ‘CPATH’ or
>>>> ‘GUIX_PYTHONPATH’.
>>
>> I tend to agree. We should avoid adding to the global environment in a
>> default Guix installation as much as possible.
>>
>>> About 2), exposing CPATH or GUIX_PYTHONPATH doesn’t make sense as we
>>> aren’t shipping C or Python libraries while we do ship a Guile API :-).
>>
>> Agreed, but GUILE_LOAD{,_COMPILED}_PATH are set appropriately when guix
>> and guile are installed in a profile. IMO we should keep the global
>> environment clean and encourage installing guix in a profile (or
>> exporting the Guile variables on a per-project basis via something like
>> direnv) for users who want to hack on Guix configs.
>
> Guix is essentially "installed by default" in the system profile or in
> your user profile; it'd make sense to expose its matching library (Guile
> modules) to me.  Note that the workaround of installing 'guix'
> explicitly with 'guix install guix' will cause your guix to downgrade
> itself on every 'guix pull', making it a non-solution.
>
> Thanks for sharing your input.  It looks like on Guix System we could
> extend the /etc/profile skeleton in (gnu system) to extend the
> GUILE_LOAD_PATH and GUILE_LOAD_COMPILED_PATH with the entries from the
> user and guix current profiles, around this bit:
>
> # Arrange so that ~/.config/guix/current comes first.
> for profile in \"$HOME/.guix-profile\" \"$HOME/.config/guix/current\"
> do
>   if [ -f \"$profile/etc/profile\" ]
>   then
>     # Load the user profile's settings.
>     GUIX_PROFILE=\"$profile\" ; \\
>     . \"$profile/etc/profile\"
>   else
>     # At least define this one so that basic things just work
>     # when the user installs their first package.
>     export PATH=\"$profile/bin:$PATH\"
>   fi
> done

This is nice, at I've added

    export GUILE_LOAD_PATH="$profile/share/guile/site/3.0\
${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
    export GUILE_LOAD_COMPILED_PATH="$profile/lib/guile/3.0/site-ccache\
${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"

in my local installation right away and (obviously) now have Guix
modules available that match the newly pulled guix (with the new
guix-home-service-type).

> We'd have to come up with an equivalent for guix-install.sh; I think it
> could go to the /etc/profile.d/guix.sh file we create.

Sure, that's where this started :)

> On top of that, we'd have to review the guix-daemon-service-type and
> modify it so that it no longer propagates a 'guix' package to the system
> profile.
>
> Does that sound like a good way forward?

LGTM!

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




      parent reply	other threads:[~2024-04-21  6:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  8:27 [bug#68498] [PATCH] guix-install.sh: Make Guix modules available too Janneke Nieuwenhuizen
2024-01-24 22:22 ` Ludovic Courtès
2024-01-25  8:00   ` Janneke Nieuwenhuizen
2024-01-29 11:22     ` Ludovic Courtès
2024-01-29 11:54       ` Janneke Nieuwenhuizen
2024-01-29 16:05         ` Ludovic Courtès
2024-03-10  1:14           ` Maxim Cournoyer
2024-04-02 15:26             ` Ludovic Courtès
2024-04-07 14:37               ` bug#68498: " Janneke Nieuwenhuizen
2024-04-18 19:03                 ` [bug#68498] " Janneke Nieuwenhuizen
2024-04-19 11:40                   ` Maxim Cournoyer
2024-04-19 14:58                     ` Janneke Nieuwenhuizen
2024-04-20  3:36             ` Liam Hupfer via Guix-patches via
2024-04-20 21:28               ` Maxim Cournoyer
2024-04-21  2:07                 ` Liam Hupfer via Guix-patches via
2024-04-21  6:15                 ` Janneke Nieuwenhuizen [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87frvfw8b0.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=68498@debbugs.gnu.org \
    --cc=liam@hpfr.net \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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 external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.