Subject: Re: bug#31841: ./pre-inst-env guix system no longer works without ~/.config/guix

From: Ricardo Wurmus <[email-masked]>
Date: Fri, 15 Jun 2018 13:24:05 +0200

Hi Mark,

> Since updating to current master (commit b494bbe46), 'guix system' no
> longer works for me:
>
> --8<---------------cut here---------------start------------->8---
> mhw@jojen ~/guix$ ./pre-inst-env guix system build -n /etc/config.scm
> guix: system: command not found
> Try `guix --help' for more information.
> --8<---------------cut here---------------end--------------->8---

This works when inside an environment containing guile-sqlite3:

--8<---------------cut here---------------start------------->8---
rekado in master: ./pre-inst-env guix environment --ad-hoc guile guile-sqlite3
The following derivations will be built:
   /gnu/store/kgw7p80vksbw9yccx947gdar14486y9y-profile.drv
   /gnu/store/fw5m7zhwch6749w3jz8mr1k46qnjp73v-info-dir.drv
   /gnu/store/c1zr6p5w7kaz7rfcq8vbw9pw9pmzycf1-fonts-dir.drv
   /gnu/store/akxhpxyl9ialbl7c2ikykh26ai3i7yw3-ca-certificate-bundle.drv
   /gnu/store/6n654bc9lbisaw97aikd8d13z9w78779-manual-database.drv
Creating manual page database...
1 entries processed in 0.0 s
rekado in master [env]: ./pre-inst-env guix system --help
Usage: guix system [OPTION ...] ACTION [ARG ...] [FILE]
Build the operating system declared in FILE according to ACTION.
Some ACTIONS support additional ARGS.

The valid values for ACTION are:

[…]
--8<---------------cut here---------------end--------------->8---

When outside of an environment containing guile-sqlite3 strace shows
that Guix tries to load it right before failing.  The cause here is the
autoloading of (guix store database), which depends on the sqlite
bindings.

We could fix this by recording more of the configured
GUILE_LOAD_{,COMPILED_}PATH and setting it up at runtime with
pre-inst-env.

(The same would apply to gnutls bindings, for example.)

--
Ricardo