From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
To: 52727@debbugs.gnu.org
Subject: 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 01:16:47 +0100 [thread overview]
Message-ID: <20211222011647.2d41452f@primary_laptop> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 5473 bytes --]
Hi,
When running guix package -i hello as user (gnutoo) I have:
> [gnutoo@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@primary_laptop ~]$ sudo su
> [root@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@primary_laptop ~]# which guix
> /run/current-system/profile/bin/guix
Whereas when running it from the user, it doesn't:
> [gnutoo@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@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@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@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@primary_laptop guix]$ export
> GUILE_LOAD_COMPILED_PATH=/run/current-system/profile/lib/guile/3.0/site-ccache
> [gnutoo@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@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@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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-system-GUIX_PROFILE-etc-profile-Fix-GUILE_LOAD_C.patch --]
[-- Type: text/x-patch, Size: 1063 bytes --]
From 579e613da312f288aa9b9aebd264794bb9586625 Mon Sep 17 00:00:00 2001
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Date: Wed, 22 Dec 2021 00:45:28 +0100
Subject: [PATCH] gnu: system: $GUIX_PROFILE/etc/profile: Fix
GUILE_LOAD_COMPILED_PATH
* gnu/system.scm (operating-system-etc-service)[profile]: export
GUILE_LOAD_COMPILED_PATH
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
gnu/system.scm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gnu/system.scm b/gnu/system.scm
index 088c62ddde..4dbdf1928e 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -987,6 +987,8 @@ (define* (operating-system-etc-service os)
# Allow GStreamer-based applications to find plugins.
export GST_PLUGIN_PATH=\"$HOME/.guix-profile/lib/gstreamer-1.0\"
+export GUILE_LOAD_COMPILED_PATH=\"$HOME/.config/guix/current/lib/guile/3.0/site-ccache:$HOME/.config/guix/current/share/guile/site/3.0\"
+
if [ -n \"$BASH_VERSION\" -a -f /etc/bashrc ]
then
# Load Bash-specific initialization code.
--
2.34.0
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2021-12-22 0:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 0:16 Denis 'GNUtoo' Carikli [this message]
2021-12-22 7:57 ` bug#52727: When logged as user, GUILE_LOAD_COMPILED_PATH points to the system cache instead of the user cache Liliana Marie Prikler
2021-12-22 10:29 ` Maxime Devos
2021-12-23 7:31 ` Denis 'GNUtoo' Carikli
2021-12-23 8:22 ` Liliana Marie Prikler
2021-12-22 10:32 ` Maxime Devos
2021-12-22 11:03 ` Liliana Marie Prikler
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=20211222011647.2d41452f@primary_laptop \
--to=gnutoo@cyberdimension.org \
--cc=52727@debbugs.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).