Mojca Miklavec <[email protected]> writes:

> PS/unrelated: Talking about macs, I don't like the fact that I have to
> create a script doing
>     #!/bin/bash
>     exec /Applications/LilyPond.app/Contents/Resources/bin/lilypond "$@"
> Why doesn't simple symlinking work? If I try symlinking
>     /Applications/LilyPond.app/Contents/Resources/bin/lilypond
> here's what I get:
>
> GNU LilyPond 2.19.45
> warning: not relocating, no 2.19.45/ or current/ found under
> /Users/me/share/lilypond/
> ERROR: In procedure primitive-load-path:
> ERROR: Unable to find file "ice-9/boot-9.scm" in load path
>
> There is an easy workaround of course and it's not a problem for
> anyone reading the docs, but it's not intuitive and it would be better
> to fix it at some point.

The difference will be the argv[0] that the executable is called with.
LilyPond apparently does not follow symlinks here since it has its own
symlink from out/bin/lilypond to lily/out/lilypond and calling the
symlink works while calling linked target does not:

dak@lola:/usr/local/tmp/lilypond$ ls -l out/bin/lilypond
lrwxrwxrwx 1 dak dak 23 Jul 11 13:20 out/bin/lilypond -> ../../lily/out/lilypond
dak@lola:/usr/local/tmp/lilypond$ out/bin/lilypond scheme-sandbox
GNU LilyPond 2.19.46
Processing 
`/usr/local/tmp/lilypond/out/share/lilypond/current/ly/scheme-sandbox.ly'
Parsing...
guile> (exit 0)

Success: compilation successfully completed

dak@lola:/usr/local/tmp/lilypond$ out/bin/../../lily/out/lilypond scheme-sandbox
GNU LilyPond 2.19.46
warning: not relocating, no 2.19.46/ or current/ found under 
/usr/local/tmp/lilypond/out/bin/../../lily/share/lilypond/
ERROR: In procedure primitive-load-path:
ERROR: Unable to find file "lily.scm" in load path

dak@lola:/usr/local/tmp/lilypond$ lily/out/lilypond scheme-sandbox
GNU LilyPond 2.19.46
warning: not relocating, no 2.19.46/ or current/ found under 
/usr/local/tmp/lilypond/lily/share/lilypond/
ERROR: In procedure primitive-load-path:
ERROR: Unable to find file "lily.scm" in load path

Arguably, following the symlink tentatively with readlink rather than
giving up altogether would make sense.  readlink is very tiresome to
interpret, however, when it delivers a relative file name rather than an
absolute one, and using realpath will follow _all_ symlinks, and that
does not work in the out/bin/lilypond situation at least.

And of course one needs the respective autoconf tests because clearly we
don't even have symlinks on all supported platforms (I'm fuzzy about
current Windows systems/filesystems).

Basically: you have a point.  It's just sort of an expensive point.

-- 
David Kastrup

_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to