watkipet | 27 Aug 18:00

Loading shared libraries that are not TCL packages


I've created a Starpack that loads the mysqltcl package. This works
fine on one system that has libmysqlclient.so.15 (part of mysql
client), but the systems I want deploy to use libmysqlclient.so.14 and
my Starpack fails to run.

I doubt that my organization will update mysql accross all the systems
just to run my app. I know I can load shared libraries that are TCL
packages with a starpack. Is it possible to include libmysqlclient.so.
15 (not a TCL package), with my Starpack? If so, how do I do it?

Bezoar | 28 Aug 20:01

Re: Loading shared libraries that are not TCL packages


This may be something you can try. I believe that when the starpack
starts up
it only copies out the tcl shared library s the Operating system can
load it up and then
uses vfs to allow your script to access shared libraries inside the
starpack.  The OS does not
know about those libraries nor can it get to them like your script
can.  So the only way
this may work is to include the mysql so file in the starpack then
copy it out to a known
location outside the starpack  then modify the environment
LD_LIBRARY_PATH to include the
directory where the library is located as its first path.  It is
possible that you may need to
do the old fork and exec trick to make this work; so your starpack
will need to operate in
two modes , prep mode and run mode.

set prepmode 1 ; # assume prep mode
if { $argc == 1 }  {
# if we have a command line arg then we are in run mode if you have
args to your program your
# means to figure out mode will be different
  set prepmode 0
}

if { $prepmode } {
    file copy [file join $starkit::dir  lib mysqllib.so ] [file join /
tmp mysqlib.so ]
(Continue reading)


Gmane