Hi all,
while trying to debug a problem concerning scheme code I stumbled upon
the somewhat broken
state of the "guile-debugger.ly"-interface.
This was discussed several times on the list, seemingly without a good
solution.
See:
https://lists.gnu.org/archive/html/lilypond-user/2014-05/msg00595.html
and more recently
https://lists.gnu.org/archive/html/lilypond-user/2019-09/msg00284.html
I found that guile-debugger.ly will only work on my Ubuntu 18.04 system
if there's an additional guile-1.8 installation present.
This is true for the vanilla installers 2.18.2 and also for 2.19.83 from
http://lilypond.org/download.html and also for the 2.18.2 package in the
Ubuntu 18.04 repo.
Ubuntu 18.04 does not provide guile-1.8 anymore, AFAIK. Self-compiling
worked flawlessly for me, but I think it would
be better to provide the libraries needed for guile-debugger.ly with the
lilypond installer. (Or, as a quick and dirty "solution", add
an error message to guile-debugger.scm stating that guile-1.8 has to be
installed in order to make guile-debugger.ly work)
There a two different problems, though.
1. With the help of strace I could figure out that guile does load
libguilereadline, which is provided
in /lilypond/usr/lib. Then for some reason which I could not find out it
does not (not even try to) load libreadline, however.
It does not output an error, either.
If I copy a self-compiled libguilereadline from my own guile 1.8.8 build
to /lilypond/usr/lib, it does succeed to load libreadline.
The very different sizes of the provided libguilereadline (4352 bytes)
compared to the packaged one (52032 bytes) seemed a bit strange to me, too.
I do not know anything about library linking etc., so maybe this is normal.
2. the whole 'debugger' directory is missing in
/lilypond/usr/share/guile/1.8/ice-9.
After copying this directory from my own guile-1.8 build, the debugger
works fine. (At least loading the debugger; I did not try any real
debugging yet)
See the full test procedure in the log attached, for which I used a
fresh vanilla 2.19.83 install.
Seems that for further investigation I need a GUB setup, which I do not
have currently.
Are the instructions that Knut(?) posted some time ago still valid?
I vaguely remember having read some about some commits that have to be
cherry-picked in order to make GUB work,
quite unsure about this.
Cheers,
Michael
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ ./lilypond
guile-debugger.ly
GNU LilyPond 2.19.83
»/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ly/guile-debugger.ly«
wird verarbeitet
Analysieren...
/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ly/guile-debugger.ly:39:2:
Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
#
(use-modules (ice-9 readline))
readline is not provided in this Guile installation
/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ly/guile-debugger.ly:40:2:
Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
#
(activate-readline)
Unbound variable: activate-readline
Guile debugger for Lilypond
For help enter (debug-help)
/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ly/guile-debugger.ly:46:2:
Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
#
(use-modules (scm guile-debugger))
no code for module (ice-9 debugger command-loop)
guile> (quit)
schwerer Fehler: gescheiterte Dateien: "guile-debugger.ly"
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ strace ./lilypond
guile-debugger.ly 2>&1 | grep readline
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/scm/ice-9/readline.scm",
0x7ffd88c368b0) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/scm/ice-9/readline",
0x7ffd88c368b0) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ice-9/readline.scm",
0x7ffd88c368b0) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ice-9/readline",
0x7ffd88c368b0) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/bin/../share/guile/1.8/ice-9/readline.scm",
{st_mode=S_IFREG|0644, st_size=8007, ...}) = 0
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/bin/../share/guile/1.8/ice-9/readline.scm",
O_RDONLY) = 6
read(6, ";;;; readline.scm --- support fu"..., 4096) = 4096
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/lib/libguilereadline-v-17.la",
O_RDONLY) = 7
read(7, "# libguilereadline-v-17.la - a l"..., 4096) = 1165
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/bin/../lib/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/lib/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/libguilereadline-v-17.a", O_RDONLY|O_CLOEXEC) = -1
ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libguilereadline-v-17.a", O_RDONLY|O_CLOEXEC) = -1
ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/gub/NewGub/gub/target/linux-64/installer/lilypond-git.sv.gnu.org--lilypond.git-stable-test/usr/lib/libguilereadline-v-17.so.17",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/lib/libguilereadline-v-17.so.17",
O_RDONLY|O_CLOEXEC) = 7
(use-modules (ice-9 readline))
(activate-readline)
(quit)
write(2, "readline is not provided in this"..., 137readline is not provided in
this Guile installation
Unbound variable: activate-readline
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ cd ../lilypond/usr/lib
michael@michael-VirtualBox:~/lilypond-generic-2.19/lilypond/usr/lib$ mv
libguilereadline-v-17.so.17.0.3 libguilereadline-v-17.so.17.0.3.old
michael@michael-VirtualBox:~/lilypond-generic-2.19/lilypond/usr/lib$ cp
~/guile-1.8/guile-readline/.libs/libguilereadline-v-17.so.17.0.3 ./
michael@michael-VirtualBox:~/lilypond-generic-2.19/lilypond/usr/lib$ ls -l
libguilereadline-v-17.so.17.0.3
-rwxr-xr-x 1 michael michael 52032 Jan 7 16:17 libguilereadline-v-17.so.17.0.3
michael@michael-VirtualBox:~/lilypond-generic-2.19/lilypond/usr/lib$ ls -l
libguilereadline-v-17.so.17.0.3.old
-rwxr-xr-x 1 michael michael 4352 Mär 20 2019
libguilereadline-v-17.so.17.0.3.old
michael@michael-VirtualBox:~/lilypond-generic-2.19/lilypond/usr/lib$ cd
../../../bin
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ strace ./lilypond
guile-debugger.ly 2>&1 | grep readline
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/scm/ice-9/readline.scm",
0x7ffff872ee10) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/scm/ice-9/readline",
0x7ffff872ee10) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ice-9/readline.scm",
0x7ffff872ee10) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ice-9/readline",
0x7ffff872ee10) = -1 ENOENT (No such file or directory)
stat("/home/michael/lilypond-generic-2.19/lilypond/usr/bin/../share/guile/1.8/ice-9/readline.scm",
{st_mode=S_IFREG|0644, st_size=8007, ...}) = 0
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/bin/../share/guile/1.8/ice-9/readline.scm",
O_RDONLY) = 6
read(6, ";;;; readline.scm --- support fu"..., 4096) = 4096
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/lib/libguilereadline-v-17.la",
O_RDONLY) = 7
read(7, "# libguilereadline-v-17.la - a l"..., 4096) = 1165
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/bin/../lib/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/lib/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/libguilereadline-v-17.a",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/libguilereadline-v-17.a", O_RDONLY|O_CLOEXEC) = -1
ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libguilereadline-v-17.a", O_RDONLY|O_CLOEXEC) = -1
ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/gub/NewGub/gub/target/linux-64/installer/lilypond-git.sv.gnu.org--lilypond.git-stable-test/usr/lib/libguilereadline-v-17.so.17",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/lib/libguilereadline-v-17.so.17",
O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD,
"/home/michael/lilypond-generic-2.19/lilypond/usr/lib/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/guile-1.8/libguile/.libs/tls/x86_64/x86_64/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/guile-1.8/libguile/.libs/tls/x86_64/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/guile-1.8/libguile/.libs/tls/x86_64/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/guile-1.8/libguile/.libs/tls/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/guile-1.8/libguile/.libs/x86_64/x86_64/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/guile-1.8/libguile/.libs/x86_64/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD,
"/home/michael/guile-1.8/libguile/.libs/x86_64/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/michael/guile-1.8/libguile/.libs/libreadline.so.7",
O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libreadline.so.7", O_RDONLY|O_CLOEXEC)
= 7
read(6, "y to use readline in his program"..., 4096) = 3911
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ ./lilypond
guile-debugger.ly
GNU LilyPond 2.19.83
»/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ly/guile-debugger.ly«
wird verarbeitet
Analysieren...
Guile debugger for Lilypond
For help enter (debug-help)
/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ly/guile-debugger.ly:46:2:
Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
#
(use-modules (scm guile-debugger))
no code for module (ice-9 debugger command-loop)
guile> (quit)
schwerer Fehler: gescheiterte Dateien: "guile-debugger.ly"
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ cp
~/guile-1.8/ice-9/debugger ../lilypond/usr/share/guile/1.8/ice-9/
cp: -r wurde nicht angegeben, daher wird das Verzeichnis
'/home/michael/guile-1.8/ice-9/debugger' ausgelassen
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ cp -r
~/guile-1.8/ice-9/debugger ../lilypond/usr/share/guile/1.8/ice-9/
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$ ./lilypond
guile-debugger.ly
GNU LilyPond 2.19.83
»/home/michael/lilypond-generic-2.19/lilypond/usr/share/lilypond/current/ly/guile-debugger.ly«
wird verarbeitet
Analysieren...
Guile debugger for Lilypond
For help enter (debug-help)
guile> (quit)
Kompilation erfolgreich beendet
michael@michael-VirtualBox:~/lilypond-generic-2.19/bin$