Gauche
Gauche copied to clipboard
gosh depends on system libgauche during installation
I did something funny today. Probably not a big deal, but could be potential issue.
I wanted a clean start because my installation accumulated so many gauche versions, so I made sure to "make" everything ok, then "rm -r ~/opt/gauche", my gauche prefix and did "make install".
"make install" failed because gosh failed to find libgauche.so. I remember that the new gosh is relinked in installation phase to add -rpath
to point to the right location. That is probably the problem because the right location doe not have libgauche.so anymore. "gosh" before this final phase has -rpath
pointing to the new libgauche.so in the source tree.
The potential problem here is the new "gosh" is not always compatible with the old (installed) libgauche.so. So running gosh at installation phase using the old libgauche.so could end up with weird errors.
Ah, I see.
The premise is that we do use system's install command to install libgauche and other binaries, and use gauche-install to install the rest. By the time we use gauche-install, the fresh libgauche is already in place.
However, at some point I forgot about the dependency and runs make install in ext/ before src/, and ext/'s installation uses gauche-install. Do'h.
Now I figured what happened.
The toplevel "make install
" triggers the following events:
- run
make install
underlib
, which uses system'sinstall
to install library files - run
make install
underext
, which usesgauche-install
(which callsgosh -ftest
). - run
make install
undersrc
, which relinksgosh
and use system'sinstall
to install binaries.
First time you run this, gosh
in the second step hasn't been relinked, so it links to the libgauche
in the build tree. It works no matter which version of libgauche
is already installed.
However, you run make install
again without triggering linking of gosh
, then the second step uses gosh
that's already been relinked. If you've deleted the installed libgauche
, it fails.
Now, the version mismatch only occurs when you build and install different version of Gauche from a separate tree inbetween. It can occur, but I guess it's not a typical case.
I think it can be avoided to build a relinked version of gosh
with a different name or in a different directory so that installation of ext
always uses the version that's linked to the libgauche
in a build tree.
I think it can be avoided to build a relinked version of gosh with a different name or in a different directory so that installation of ext always uses the version that's linked to the libgauche in a build tree.
Yes I came up with the same conclusion. Either that or we delay relinking until the very last minute, and it will be the last file we install. But it's more fragile that way.
BTW it does not have to be fixed. I understand I do weird stuff sometimes. It's your call to see if something should be done or this is issue should be closed. I'm fine either way.