Discussion:
Debugging Guile module loading
Christopher Baines
2018-03-12 19:25:15 UTC
Permalink
Hey,

I'm having some trouble with Guile module loading. I've got a
(use-modules ...) call which results in some warnings, which seem to be
actually more like errors, as the modules aren't loaded.

From loading one module, I get two errors in the form:

warning: failed to load '...':
Unbound variable: ...

The modules and variables all exist, but as far as I understand Guile
modules, they shouldn't be required for loading the module requested.

Any tips on debugging use-modules? Initially it would be good to work
out what modules it's attempting to load.

Thanks,

Chris
Mike Gran
2018-03-12 20:40:19 UTC
Permalink
Post by Christopher Baines
Hey,
I'm having some trouble with Guile module loading. I've got a
(use-modules ...) call which results in some warnings, which seem to be
actually more like errors, as the modules aren't loaded.
Unbound variable: ...
The modules and variables all exist, but as far as I understand Guile
modules, they shouldn't be required for loading the module requested.
Any tips on debugging use-modules? Initially it would be good to work
out what modules it's attempting to load.
I often find that, using "LD_DEBUG=all guile" will reveal the
problem, somewhere at the bottom of its very verbose output.
Mark H Weaver
2018-03-13 16:57:39 UTC
Permalink
Hi Chris,
Post by Christopher Baines
I'm having some trouble with Guile module loading. I've got a
(use-modules ...) call which results in some warnings, which seem to be
actually more like errors, as the modules aren't loaded.
Unbound variable: ...
When I search for "failed to load" in the guile-2.2 sources, the only
match is "WARNING: failed to load compiled file ...". Was that the
actual message?

Exact output is generally more useful than approximate messages typed
from human memory.
Post by Christopher Baines
The modules and variables all exist, but as far as I understand Guile
modules, they shouldn't be required for loading the module requested.
I'm sorry, but you haven't provided enough information to tell what the
problem is. Can you provide the source code for a small self-contained
example, along with a list of commands needed to reproduce the problem?
Post by Christopher Baines
Any tips on debugging use-modules? Initially it would be good to work
out what modules it's attempting to load.
Running Guile within 'strace' would show you what system calls are being
executed, including 'open' calls attempting to open files, whether the
attempts were successful, and what the error codes were on failures.
While Guile loads modules, it attempts to open *.scm and *.go files in
the directories of Guile's load path (%load-path). You may find useful
clues there.

Mark

Loading...