[M3devel] pkg roots/origin/ld_library_path

Jay K jay.krell at cornell.edu
Tue Jul 7 14:31:13 CEST 2009


Really, I understand, but there is a problem nobody seems to see.
 
 
Let's say there are multiple pkg roots.
 
 
Remember my question? It is very important.
  "How are the dependencies of an .so or executable found?"
 
 
What if I install to /opt/cm3.
You install to $HOME/cm3 -- no need for root!
We have some root/bin/executable.
It uses of course libm3core.so.
 
 
I want to be able to copy it from machine to machine, probably without relinking it or running some tool over it.
 
 
People want to install libm3core.so to different places on different machines.
 
 
Does root/bin/executable refer 
to /opt/cm3/lib?
or $HOME/cm3/lib?
or $ORIGIN/../lib?
or no directory and user sets LD_LIBRARY_PATH?
  I'm not even sure you can omit the directory.
 
 
There is a basic contradiction here.
$ORIGIN is good. $ORIGIN is bad.
LD_LIBRARY_PATH is good. LD_LIBRARY_PATH is bad.
Full paths are good. Full paths are bad.
The ability to install to different places is good. The ability to install to different places is bad.
 
 
You cannot have all of:
  ability to specify install location
AND multiple package roots, where a package root is sparse
AND if I install to a custom location, I don't have to set LD_LIBRARY_PATH
 
 
Now, while I advocate(d) $ORIGIN and custom install locations and no need for LD_LIBRARY_PATH, that approach does devolve to everything being in the same directory, which also seems not great.
 
 
The difference is often that you don't use $ORIGIN for "well known important stuff".
You don't get "libc.so" from $ORIGIN/../lib. You get it from where it always is, like /usr/lib or somesuch. You don't actually ever use a custom install for it. If you want to build your own, you are probably building your own entire system, and might use chroot as part of that.
 
 
But where is the line between "my stuff" and "well known important stuff"? Where is the line between stuff that can be installed anywhere vs. stuff that must be installed to its "standard" location?
 
 
 - Jay


More information about the M3devel mailing list