GNU bug report logs - #52727
When logged as user, GUILE_LOAD_COMPILED_PATH points to the system cache instead of the user cache

Previous Next

Package: guix;

Reported by: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>

Date: Wed, 22 Dec 2021 00:25:02 UTC

Severity: normal

To reply to this bug, email your comments to 52727 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#52727; Package guix. (Wed, 22 Dec 2021 00:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 22 Dec 2021 00:25:02 GMT) Full text and rfc822 format available.

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

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: bug-guix <at> gnu.org
Subject: When logged as user, GUILE_LOAD_COMPILED_PATH points to the system
 cache instead of the user cache
Date: Wed, 22 Dec 2021 01:16:47 +0100
[Message part 1 (text/plain, inline)]
Hi,

When running guix package -i hello as user (gnutoo) I have:
> [gnutoo <at> primary_laptop ~]$ guix package -i hello
> Backtrace:
> In ice-9/boot-9.scm:
>    222:29 19 (map1 (((gnu packages gnupg)) ((gnu packages golang)) …))
>    222:29 18 (map1 (((gnu packages golang)) ((gnu packages #)) (#) …))
>    222:29 17 (map1 (((gnu packages graphics)) ((gnu packages gtk)) …))
>    222:29 16 (map1 (((gnu packages gtk)) ((gnu packages guile)) (#)
> …)) 222:29 15 (map1 (((gnu packages guile)) ((gnu packages linux)) #
> …)) 222:29 14 (map1 (((gnu packages linux)) ((gnu packages #)) ((…))
> …)) 222:29 13 (map1 (((gnu packages ncurses)) ((gnu packages nss)) #
> …)) 222:29 12 (map1 (((gnu packages nss)) ((gnu packages perl)) (#)
> …)) 222:29 11 (map1 (((gnu packages perl)) ((gnu packages #)) ((…))
> …)) 222:17 10 (map1 (((gnu packages perl-web)) ((gnu packages #)) #
> …)) 3326:17  9 (resolve-interface (gnu packages perl-web) #:select _
> # …) In ice-9/threads.scm:
>     390:8  8 (_ _)
> In ice-9/boot-9.scm:
>   3252:13  7 (_)
> In ice-9/threads.scm:
>     390:8  6 (_ _)
> In ice-9/boot-9.scm:
>   3536:20  5 (_)
>    2835:4  4 (save-module-excursion #<procedure 87f9108 at
> ice-9/boo…>) 3556:26  3 (_)
> In unknown file:
>            2 (primitive-load-path "gnu/packages/perl-web"
> #<procedur…>) In gnu/packages/perl-web.scm:
>      36:5  1 (_)
> In ice-9/boot-9.scm:
>   1685:16  0 (raise-exception _ #:continuable? _)
> 
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> Throw to key `record-abi-mismatch-error' with args `(abi-check "~a:
> record ABI mismatch; recompilation needed" (#<record-type <origin>>)
> ())'.

However that works fine with sudo su:
> [gnutoo <at> primary_laptop ~]$ sudo su
> [root <at> primary_laptop gnutoo]# guix package -i hello
> guix package: warning: Consider running 'guix pull' followed by
> 'guix package -u' to get up-to-date packages and security updates.
> 
> The following package will be installed:
>    hello 2.10
> 
> The following derivation will be built:
>    /gnu/store/ck96mk8hphd9k70a06y8ciqy0p3yp4qa-profile.drv
> 
> 0.1 MB will be downloaded
>  hello-2.10  52KiB
>                             444KiB/s 00:00 [##################]
> 100.0% building CA certificate bundle... listing Emacs
> sub-directories... building fonts directory...
> building directory of Info manuals...
> building profile with 1 package...
> hint: Consider setting the necessary environment variables by running:
> 
>      GUIX_PROFILE="/root/.guix-profile"
>      . "$GUIX_PROFILE/etc/profile"
> 
> Alternately, see `guix package --search-paths -p
> "/root/.guix-profile"'.

As I understand from what I was told on #guix, when running sudo su,
guix comes from the system:
> [root <at> primary_laptop ~]# which guix
> /run/current-system/profile/bin/guix

Whereas when running it from the user, it doesn't:
> [gnutoo <at> primary_laptop ~]$ which guix
> /home/gnutoo/.config/guix/current/bin/guix

And as user GUILE_LOAD_COMPILED_PATH is somehow exported to system
paths:
> [gnutoo <at> primary_laptop ~]$ echo $GUILE_LOAD_COMPILED_PATH
> /run/current-system/profile/lib/guile/3.0/site-ccache:/run/current-system/profile/share/guile/site/3.0

So if I instead set it to the right paths it works again:
> [gnutoo <at> primary_laptop guix]$ export
> GUILE_LOAD_COMPILED_PATH="/home/gnutoo/.config/guix/current/lib/guile/3.0/site-ccache:/home/gnutoo/.config/guix/current/share/guile/site/3.0"
> [gnutoo <at> primary_laptop guix]$ guix package -i hello
> The following package will be upgraded:
>    hello (dependencies or package changed)
> 
> nothing to be done

'GUILE_LOAD_COMPILED_PATH="" guix package -i hello' also works.

In my case the issue is that having
'/run/current-system/profile/lib/guile/3.0/site-ccache' in
GUILE_LOAD_COMPILED_PATH makes it fail:
> [gnutoo <at> primary_laptop guix]$ export
> GUILE_LOAD_COMPILED_PATH=/run/current-system/profile/lib/guile/3.0/site-ccache
> [gnutoo <at> primary_laptop guix]$ guix package -i hello Backtrace:
> In ice-9/boot-9.scm:
>    222:29 19 (map1 (((gnu packages gnupg)) ((gnu packages golang)) …))
[...]

And apparently it fails just because it is in the path:
> [gnutoo <at> primary_laptop guix]$ export
> GUILE_LOAD_COMPILED_PATH="/home/gnutoo/.config/guix/current/lib/guile/3.0/site-ccache:/home/gnutoo/.config/guix/current/share/guile/site/3.0:/run/current-system/profile/lib/guile/3.0/site-ccache"
> [gnutoo <at> primary_laptop guix]$ guix package -i hello Backtrace:
> In ice-9/boot-9.scm:
>    222:29 19 (map1 (((gnu packages gnupg)) ((gnu packages golang)) …))
[...]

This behavior probably happens becuase the system guix wasn't updated
with guix system reconfigure for some time, and that the user relies on
the system guile cache.

And as I understand from #guix on liberachat, I'm supposed to be able
to not keep my user profile and my guix system in sync.

Would the solution to that be to correctly export
GUILE_LOAD_COMPILED_PATH in  ~/.guix-profile/etc/profile like it is
done in the patch I attached (with an extra small modification in the
commit message to mention the bug report)?

Other commits fixing bugs in that same profile mentioned bug reports,
so I assume that it's simplier to discuss the bug in a bug report
than directly sending a patch to fix the issue.

Note that I also didn't test the patch yet but I did test that export
command.

Denis.
[0001-gnu-system-GUIX_PROFILE-etc-profile-Fix-GUILE_LOAD_C.patch (text/x-patch, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52727; Package guix. (Wed, 22 Dec 2021 07:58:01 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
To: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>, 52727 <at> debbugs.gnu.org
Subject: Re: When logged as user, GUILE_LOAD_COMPILED_PATH points to the
 system cache instead of the user cache
Date: Wed, 22 Dec 2021 08:57:06 +0100
Hi Denis,

Am Mittwoch, dem 22.12.2021 um 01:16 +0100 schrieb Denis 'GNUtoo'
Carikli:
> [A]s user GUILE_LOAD_COMPILED_PATH is somehow exported to system
> paths:
> > [gnutoo <at> primary_laptop ~]$ echo $GUILE_LOAD_COMPILED_PATH
> > /run/current-system/profile/lib/guile/3.0/site-ccache:/run/current-
> > system/profile/share/guile/site/3.0
> 
> So if I instead set it to the right paths it works again:
> > [gnutoo <at> primary_laptop guix]$ export
> > GUILE_LOAD_COMPILED_PATH="/home/gnutoo/.config/guix/current/lib/guile
> > /3.0/site-
> > ccache:/home/gnutoo/.config/guix/current/share/guile/site/3.0"
> > [gnutoo <at> primary_laptop guix]$ guix package -i hello
> > The following package will be upgraded:
> >    hello (dependencies or package changed)
> > 
> > nothing to be done
> 
> 'GUILE_LOAD_COMPILED_PATH="" guix package -i hello' also works.
> 
> In my case the issue is that having
> '/run/current-system/profile/lib/guile/3.0/site-ccache' in
> GUILE_LOAD_COMPILED_PATH makes it fail:
> > [gnutoo <at> primary_laptop guix]$ export
> > GUILE_LOAD_COMPILED_PATH=/run/current-
> > system/profile/lib/guile/3.0/site-ccache
> > [gnutoo <at> primary_laptop guix]$ guix package -i hello Backtrace:
> > In ice-9/boot-9.scm:
> >    222:29 19 (map1 (((gnu packages gnupg)) ((gnu packages golang))
> > …))
> [...]
> 
> And apparently it fails just because it is in the path:
> > [gnutoo <at> primary_laptop guix]$ export
> > GUILE_LOAD_COMPILED_PATH="/home/gnutoo/.config/guix/current/lib/guile
> > /3.0/site-
> > ccache:/home/gnutoo/.config/guix/current/share/guile/site/3.0:/run/cu
> > rrent-system/profile/lib/guile/3.0/site-ccache"
> > [gnutoo <at> primary_laptop guix]$ guix package -i hello Backtrace:
> > In ice-9/boot-9.scm:
> >    222:29 19 (map1 (((gnu packages gnupg)) ((gnu packages golang))
> > …))
> [...]
> 
> This behavior probably happens becuase the system guix wasn't updated
> with guix system reconfigure for some time, and that the user relies on
> the system guile cache.
> 
> And as I understand from #guix on liberachat, I'm supposed to be able
> to not keep my user profile and my guix system in sync.
This is only true to some extent.  The local guix command still relies
on things in the system, such as the guix daemon itself, so you ought
to keep it up to date.

GUILE_LOAD_PATH does not point to the system cache "instead of" the
user cache, it gets expanded via profiles as everything else.  Since
Guix has a system-wide installation of guile-3.0-latest, the guile
paths get set.  You should probably install Guile locally instead of
system-wide if you plan on having the two diverge farther.

> Would the solution to that be to correctly export
> GUILE_LOAD_COMPILED_PATH in  ~/.guix-profile/etc/profile like it is
> done in the patch I attached (with an extra small modification in the
> commit message to mention the bug report)?
No.  The Guix command as built by `guix pull' sets its own load path,
but respects system paths too.  You can check by spawning a REPL:

scheme@(guix-user)> %load-path
$1 = ("/gnu/store/yi47s6iy3glwzimy3nch1h7c9hjzmyw8-guix-module-
union/share/guile/site/3.0"
"/gnu/store/3h3jn0745ngd87zp83k5smwhykxvdfgf-guile-
3.0.7/share/guile/3.0" "/gnu/store/3h3jn0745ngd87zp83k5smwhykxvdfgf-
guile-3.0.7/share/guile/3.0"
"/gnu/store/3h3jn0745ngd87zp83k5smwhykxvdfgf-guile-
3.0.7/share/guile/site/3.0"
"/gnu/store/3h3jn0745ngd87zp83k5smwhykxvdfgf-guile-
3.0.7/share/guile/site" "/gnu/store/3h3jn0745ngd87zp83k5smwhykxvdfgf-
guile-3.0.7/share/guile" "/run/current-
system/profile/share/guile/site/3.0")

> Other commits fixing bugs in that same profile mentioned bug reports,
> so I assume that it's simplier to discuss the bug in a bug report
> than directly sending a patch to fix the issue.
> 
> Note that I also didn't test the patch yet but I did test that export
> command.
For the record, guile has been a part of the system profile since
%base-packages were first defined, so if your load paths break, there
is probably a larger issue at hand.  In this particular case, your
local guix profile ought to shadow anything that's in /run/current-
system, so I don't really get how the ABI match is triggered.  Perhaps
you might want to debug that in a REPL.

Cheers




Information forwarded to bug-guix <at> gnu.org:
bug#52727; Package guix. (Wed, 22 Dec 2021 10:30:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>, Denis 'GNUtoo'
 Carikli <GNUtoo <at> cyberdimension.org>, 52727 <at> debbugs.gnu.org
Subject: Re: bug#52727: When logged as user, GUILE_LOAD_COMPILED_PATH points
 to the system cache instead of the user cache
Date: Wed, 22 Dec 2021 11:29:29 +0100
Liliana Marie Prikler schreef op wo 22-12-2021 om 08:57 [+0100]:
> For the record, guile has been a part of the system profile since
> %base-packages were first defined, so if your load paths break, there
> is probably a larger issue at hand.  In this particular case, your
> local guix profile ought to shadow anything that's in /run/current-
> system, so I don't really get how the ABI match is triggered.  Perhaps
> you might want to debug that in a REPL.

Maybe the system guix has a package module that does not exist in the
user guix, so guix tries to load the system package module instead of
the non-existing user package module?

Greetings,
Maxime





Information forwarded to bug-guix <at> gnu.org:
bug#52727; Package guix. (Wed, 22 Dec 2021 10:33:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>, Denis 'GNUtoo'
 Carikli <GNUtoo <at> cyberdimension.org>, 52727 <at> debbugs.gnu.org
Subject: Re: bug#52727: When logged as user, GUILE_LOAD_COMPILED_PATH points
 to the system cache instead of the user cache
Date: Wed, 22 Dec 2021 11:32:45 +0100
Liliana Marie Prikler schreef op wo 22-12-2021 om 08:57 [+0100]:
> No.  The Guix command as built by `guix pull' sets its own load path,
> but respects system paths too.  You can check by spawning a REPL: [...]

But are there any good reasons to respect $GUILE_LOAD{,_COMPILE}_PATH
at all? Usually, we use wrap-program etc. to set load paths (guile,
python, PATH or otherwise). Maybe guile-launcher can be modified to set
the load path instead of appending to it?

Greetings,
Maxime.





Information forwarded to bug-guix <at> gnu.org:
bug#52727; Package guix. (Wed, 22 Dec 2021 11:04:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
To: Maxime Devos <maximedevos <at> telenet.be>, Denis 'GNUtoo' Carikli
 <GNUtoo <at> cyberdimension.org>, 52727 <at> debbugs.gnu.org
Subject: Re: bug#52727: When logged as user, GUILE_LOAD_COMPILED_PATH points
 to the system cache instead of the user cache
Date: Wed, 22 Dec 2021 12:03:42 +0100
Am Mittwoch, dem 22.12.2021 um 11:32 +0100 schrieb Maxime Devos:
> Liliana Marie Prikler schreef op wo 22-12-2021 om 08:57 [+0100]:
> > No.  The Guix command as built by `guix pull' sets its own load path,
> > but respects system paths too.  You can check by spawning a REPL:
> > [...]
> 
> But are there any good reasons to respect $GUILE_LOAD{,_COMPILE}_PATH
> at all? Usually, we use wrap-program etc. to set load paths (guile,
> python, PATH or otherwise). Maybe guile-launcher can be modified to set
> the load path instead of appending to it?
IIUC the guix command does not particularly need to provide support for
multiple profiles, so we could isolate it.  After all, extensions ought
to be installed in the user's (single) current-guix profile, no? 
(Disregarding the use of guix environment/guix shell, of course.)  Or
more accurately, GUIX_EXTENSIONS_PATH serves as a different escape
hatch.





Information forwarded to bug-guix <at> gnu.org:
bug#52727; Package guix. (Thu, 23 Dec 2021 08:01:01 GMT) Full text and rfc822 format available.

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

From: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>,
 52727 <at> debbugs.gnu.org
Subject: Re: bug#52727: When logged as user, GUILE_LOAD_COMPILED_PATH points
 to the system cache instead of the user cache
Date: Thu, 23 Dec 2021 08:31:15 +0100
[Message part 1 (text/plain, inline)]
On Wed, 22 Dec 2021 11:29:29 +0100
Maxime Devos <maximedevos <at> telenet.be> wrote:

> Liliana Marie Prikler schreef op wo 22-12-2021 om 08:57 [+0100]:
> > For the record, guile has been a part of the system profile since
> > %base-packages were first defined, so if your load paths break,
> > there is probably a larger issue at hand.  In this particular case,
> > your local guix profile ought to shadow anything that's in
> > /run/current- system, so I don't really get how the ABI match is
> > triggered.  Perhaps you might want to debug that in a REPL.  
> 
> Maybe the system guix has a package module that does not exist in the
> user guix, so guix tries to load the system package module instead of
> the non-existing user package module?
In my system.scm (I attached it) I do have a package (fdm-git) that
doesn't exist elsewhere (because I need a patch that is upstream but
not in an fdm release yet).

Right now I can't test without fdm-git because when doing guix
system reconfigure, it tries to build guix but its tests fails. I'll
bugreport about that.

Denis.
[j9anw5swkxfy7x2amcf7bxr0mfd1y14d-configuration.scm (text/x-scheme, attachment)]
[Message part 3 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#52727; Package guix. (Thu, 23 Dec 2021 08:23:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at>
To: Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>, Maxime Devos
 <maximedevos <at> telenet.be>
Cc: 52727 <at> debbugs.gnu.org
Subject: Re: bug#52727: When logged as user, GUILE_LOAD_COMPILED_PATH points
 to the system cache instead of the user cache
Date: Thu, 23 Dec 2021 09:22:11 +0100
Am Donnerstag, dem 23.12.2021 um 08:31 +0100 schrieb Denis 'GNUtoo'
Carikli:
> On Wed, 22 Dec 2021 11:29:29 +0100
> Maxime Devos <maximedevos <at> telenet.be> wrote:
> 
> > Liliana Marie Prikler schreef op wo 22-12-2021 om 08:57 [+0100]:
> > > For the record, guile has been a part of the system profile since
> > > %base-packages were first defined, so if your load paths break,
> > > there is probably a larger issue at hand.  In this particular
> > > case,
> > > your local guix profile ought to shadow anything that's in
> > > /run/current- system, so I don't really get how the ABI match is
> > > triggered.  Perhaps you might want to debug that in a REPL.  
> > 
> > Maybe the system guix has a package module that does not exist in
> > the user guix, so guix tries to load the system package module
> > instead of the non-existing user package module?
> In my system.scm (I attached it) I do have a package (fdm-git) that
> doesn't exist elsewhere (because I need a patch that is upstream but
> not in an fdm release yet).
The only relevant package from your system.scm (in the context of this
problem) would be the guix package, but you're not even editing the
guix service so it'd be a file removed from guix upstream since you
last reconfigured.


Cheers




This bug report was last modified 2 years and 123 days ago.

Previous Next


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