GNU bug report logs - #74396
System guix masks modules from pulled 3rd-party channels

Previous Next

Package: guix;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sun, 17 Nov 2024 13:22:02 UTC

Severity: normal

To reply to this bug, email your comments to 74396 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#74396; Package guix. (Sun, 17 Nov 2024 13:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 17 Nov 2024 13:22:02 GMT) Full text and rfc822 format available.

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

From: Tomas Volf <~@wolfsden.cz>
To: bug-guix <at> gnu.org
Subject: System guix masks modules from pulled 3rd-party channels
Date: Sun, 17 Nov 2024 14:21:24 +0100
[Message part 1 (text/plain, inline)]
Hi,

when system guix produced by the guix-for-channels procedure is
installed, modules in any channel (except in the 'guix) will shadow the
same modules acquired via `guix pull'.

Steps to reproduce:

Have a channels.scm:

--8<---------------cut here---------------start------------->8---
(cons (channel
       (name 'nonguix)
       (url "https://gitlab.com/nonguix/nonguix")
       (introduction
        (make-channel-introduction
         "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
         (openpgp-fingerprint
          "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))
      %default-channels)
--8<---------------cut here---------------end--------------->8---

Pull it, and reconfigure you system using it.  After that is done, try
to search for `nongnu/packages/linux.scm' in the path using `guix repl':

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,use (gnu)
scheme@(guix-user)> (search-path %load-path "nongnu/packages/linux.scm")
$1 = "/gnu/store/svds1ak4zxdnb5sim3h45q5gk7rzqdr0-nonguix/share/guile/site/3.0/nongnu/packages/linux.scm"
--8<---------------cut here---------------end--------------->8---

Notice that the file is located in `/gnu/store/*-nonguix/...'.

Now reconfigure your system with the following modify-services:

--8<---------------cut here---------------start------------->8---
          (modify-services %base-services
            (guix-service-type
             config => (guix-configuration
                        (inherit config)
                        (guix (guix-for-channels
                               (cons (channel
                                      (name 'nonguix)
                                      (url "https://gitlab.com/nonguix/nonguix")
                                      (introduction
                                       (make-channel-introduction
                                        "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
                                        (openpgp-fingerprint
                                         "2A39 3FFF 68F4 EF7A 3D29  12AF 6F51 20A0 22FB B2D5"))))
                                     %default-channels))))))
--8<---------------cut here---------------end--------------->8---

After you reconfigure you system, try to search for the same file again:

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,use (gnu)
scheme@(guix-user)> (search-path %load-path "nongnu/packages/linux.scm")
$1 = "/run/current-system/profile/share/guile/site/3.0/nongnu/packages/linux.scm"
--8<---------------cut here---------------end--------------->8---

Notice that this time it is located in `/run/current-system/...'.

The implication is that any pull of the channels takes no effect, since
the system-wide shadows them.

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#74396; Package guix. (Sat, 07 Jun 2025 20:01:02 GMT) Full text and rfc822 format available.

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

From: Rutherther <rutherther <at> ditigal.xyz>
To: 74396 <at> debbugs.gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: Re: System guix masks modules from pulled 3rd-party channels
Date: Sat, 07 Jun 2025 22:00:01 +0200
Hi Tomas,

> Hi,
> 
> when system guix produced by the guix-for-channels procedure is
> installed, modules in any channel (except in the 'guix) will shadow the
> same modules acquired via `guix pull'.

Ah right, this is because GUILE_LOAD_PATH is set to
/run/current-system/... The load path will shadow everything except the
guix that cannot really be shadowed, it's treated kind of specially.
This variable is there because both guix and guile are installed to the
profile, see `guix shell guix guile --search-paths`.

I think the easiest and maybe only solution is to also add the search
path to ~/.config/guix/current. This could be done either by installing
guile into it as well, or by installing a dummy package with
GUILE_LOAD_PATH. This would have to be coded into profile made by guix pull.

Since system profile is sourced first, and ~/.config/guix/current after
it, the env var would have the ~/.config/guix/current first and
/run/current-system second. That means the modules from
~/.config/guix/current are used.

Still, if you do pull as user without some of the channels that are
available in system, those channels will still be available to you.
While that might not be preferred behavior, I am not sure there can be
something done about it. The problem is that users definitely do want
the GUILE_LOAD_PATH to be respected, for their own projects etc. ...
So it cannot just be ignored/unset. Another solution would be to
uninstall guile from the system profile, but again, that is not a good
default, so the bug would happen by default.

Regards
Rutherther




This bug report was last modified 12 days ago.

Previous Next


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