[M3devel] ROOT, $ORIGIN, runpath, LD_LIBRARY_PATH, symlinks, hardlinks, etc.

Jay jay.krell at cornell.edu
Thu Jul 2 21:59:50 CEST 2009


> copy and commit the source to cm3 is viable

> I don't know what this sentence means.
 
I don't have to be copying files around in the build order for cm3 to create hard links.
I can just copy on my machine and commit to cvs a little bit of code to do it.
That isn't nearly as hacky.



>  heck, use a relative instead of absolute from ROOT
       > ditto
 
 
$origin it turns out is very portable.
  Every system we support except NetBSD 4.0 seems to have it, and even some we don't currently support.
  And NetBSD 5.0, which already released, has it.
  And MacOSX is plenty close enough. It is a matter of relative to the executable or the reference, and which OS version you support. I believe newer versions relaly do have $origin by another name, but 10.4 has relative to the executable, which is good enough to me.
 
If you don't use $origin, then people either must install to the one true place, or they must use LD_LIBRARY_PATH, or they must rebuild/relink/fixup themselves.
 
LD_LIBRARY_PATH is widely panned.
Having to rebuild seems onerous for most people.
Having a choice of where to install? Important?
 
 

> Right.  rpaths in the executable should do the trick.

 

Just in the executable? Shouldn't they somewhat be in the shared libraries?

If foo uses libm3 and libm3 uses m3core and foo doesn't use m3core, arguably foo shouldn't mention m3core, only libm3 should.



 
 > Ideally we use the same approach for *all* platforms.  So, what do all platforms have in common.
 
$origin comes extremely close to that, and provides the benefit that user can specify where to install.




 > and if there is need for override use $LD_LIBRARY_PATH.
 
But again (I know, I repeated myself, so you did, now I am), this forces any install to non-default location to use LD_LIBRARY_PATH. It is an option. But $origin is also /very/ portable...


 >> But if everything goes in INSTALL_ROOT/lib we have only one directory, right?
 
Correct. That is what I achieved with the hardlinks, and will try to achieve shortly without them.


 > Surely, building for a distro can build in the right path.
 
Not really. It would disrupt the running multiuser system.
But it can probably use -rpath to stick paths in that don't correspond to the "staging" area.
 
 
 > Where did /tmp/cm3 come from?
 
The distribution builds in /tmp. You don't have to be root or disrupt the running machine to build a distribution.
There a question maybe of if the resulting files should be owned by root?
 


 > Elegance is also a concern.
 

Agreed. Copying files in the build isn't elegant. The result is elegant imho.

Hardlinks aren't elegant? I don't know.

Anyway, ok, I'll just put the files in lib and no hardlinks, I'll try that.

> Now, keep in mind, that unshipped binaries sometimes people like to work
 > I don't know understand what you are trying to say here.
 
Let me think about unshipped binaries later..
One thing is that $origin doesn't work with unshipped binaries.
By default we put in both $origin and the full path you like.
But imho distributions should just have $origin.
Or if user can't chose install location, maybe just the full path.
The big question is if user can chose where to install.
On birch I use $HOME/cm3.
Seems kind of important/useful?
 

 

 - Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090702/fcf1784c/attachment-0002.html>


More information about the M3devel mailing list