Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Jun 25, 2019 10:30 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Mon Mar 01, 2010 5:50 pm 
Offline
User avatar

Joined: Sat Feb 27, 2010 8:45 pm
Posts: 39
Hi,
I'm using the httpclient class and I'm submitting data via "post" to my clojure based todoserver (clojure+jetty+compojure) and when I build the linux and windows files there is an additional directory being created "MyApplication Libs" with "libRBInternetEncodings.so" and "libRBMD5.so". For windows it's similar, just with different names.

The problem is that it's absolutely uncommon under linux to have the libs under a subdirectory beside the executable. Libs under linux are in /usr/libs /usr/local/libs e.g. but when I copy the two *.so files to /usr/lib (don't worry, it's a virtualbox testing "box") I still get the error upon startup. The same happens when I copy the two libs to /usr/local/lib. For /lib it's the same, too.

I tried to work around it with "/lib/ld-linux.so.2 --library-path /foo/bar /path/to/MYApplication" but the path to the shared objects seems to be hardcoded into the binary.

How am I supposed to deploy on linux? "here is a zip, unzip it, put it _somewhere_, and click the executable"? :) On windows I don't mind...I create a simple installer that puts all the stuff needed into the program files directory but under linux it's a slightly different game.

For me this seems to be a show-stopper (at least for this evening).

Any idea?


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Mon Mar 01, 2010 5:54 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
The libraries are only for your app. So they should not be in /usr/lib or /lib.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Mon Mar 01, 2010 6:09 pm 
Offline
User avatar

Joined: Thu Mar 05, 2009 1:03 pm
Posts: 1786
Location: USA
schipplock wrote:
The problem is that it's absolutely uncommon under linux to have the libs under a subdirectory beside the executable. Libs under linux are in /usr/libs /usr/local/libs e.g. but when I copy the two *.so files to /usr/lib (don't worry, it's a virtualbox testing "box") I still get the error upon startup. The same happens when I copy the two libs to /usr/local/lib. For /lib it's the same, too.

I tried to work around it with "/lib/ld-linux.so.2 --library-path /foo/bar /path/to/MYApplication" but the path to the shared objects seems to be hardcoded into the binary.

Yep, I think they're hardcoded. They're definitely not modifiable without some serious hacking, and then breakage is almost certain.
This is REAL Studio's way of avoiding "DLL ****" and, in this case, the Linux equivalent of it; instead of having to worry about what happens when a newer/older version of the libs overwrites RS's, you can deploy in peace.

schipplock wrote:
How am I supposed to deploy on linux? "here is a zip, unzip it, put it _somewhere_, and click the executable"? :) On windows I don't mind...I create a simple installer that puts all the stuff needed into the program files directory but under linux it's a slightly different game.

Try a .deb or .rpm (I believe those are the two major formats) installer; you might also want to look into InstallJammer, a FOSS cross-platform install builder.

_________________
With great power comes great responsibility.
Learn something new every day, and the rest will take care of itself.
Life is a journey, not a destination. Enjoy the trip! :D


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Tue Mar 02, 2010 3:52 am 
Offline
User avatar

Joined: Sat Feb 27, 2010 8:45 pm
Posts: 39
ok, I have to be more clear on that :). I was probably too tired yesterday evening.

My problem is not to have dedicated .so files for my app because I could live with installing it in /opt/my-app/version/ (binary in ./bin, libs in ./lib) which is my install location anyway, but there is no way to change the path from "myapplication libs" to some more common like "lib", right (beside making a symlink which is useless of course :P)? It seems to always prepend the windowsappname, linuxappname and macosxappname to the word " libs".

Well, it obviously isn't possible to change that (I tried patchelf but rb seems to load the libs in a non standard way; I'm even unable to see the loading of the libRB* libs in the strace output and ldd doesn't list these libraries, too and readelf the same). Now that I slept a night and am awake again I think I can live with it (I think)...but 100% conviction feels different :).

Have a nice day,
Andreas.


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Wed Mar 03, 2010 12:31 am 
Offline
User avatar

Joined: Thu Mar 05, 2009 1:03 pm
Posts: 1786
Location: USA
schipplock wrote:
My problem is not to have dedicated .so files for my app because I could live with installing it in /opt/my-app/version/ (binary in ./bin, libs in ./lib) which is my install location anyway, but there is no way to change the path from "myapplication libs" to some more common like "lib", right (beside making a symlink which is useless of course :P)? It seems to always prepend the windowsappname, linuxappname and macosxappname to the word " libs".

Yeah, that's standard RS behavior. Trying to change that is non-supported, unlikely to work (as you've seen), and very likely to break if you do manage to change it.
I'm pretty sure this is RS's way of working around "Lib ****" - imagine you install two apps to the same folder (not uncommon). If both have their libraries in a "lib" folder, "Lib ****" will probably ensue. If they have differently-named library folders, the chances of a conflict are slim/none.

_________________
With great power comes great responsibility.
Learn something new every day, and the rest will take care of itself.
Life is a journey, not a destination. Enjoy the trip! :D


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Wed Mar 03, 2010 2:29 am 
Offline
User avatar

Joined: Sat Feb 27, 2010 8:45 pm
Posts: 39
all correct, but I don't like to be put into a strait jacket. When I'm not installing two rb apps into one directory, I'd like to be flexible enough to change where my app is expecting the libs :). And _if_ I can change a simple property that defines where to put the libs nobody has a disadvantage. If one app fails because another app has put different versions of the lib into the same directory, it's my fault. Treating the programmer as "dumb" is really the wrong way to go imho.

Sorry if that sounds a bit like a rant :).

Andreas.


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Wed Mar 03, 2010 3:12 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Well, please fill a feature request for that.
And you can patch your apps to share the same libs folder.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Wed Mar 03, 2010 3:34 am 
Offline
User avatar

Joined: Sat Feb 27, 2010 8:45 pm
Posts: 39
Quote:
And you can patch your apps to share the same libs folder.


how? :)


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Wed Mar 03, 2010 3:38 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Write yourself a little utility. Open the app files with a binarystream and replace the file pathes. But keep the length of the pathes equal. You may need to add chr(0) there.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy?
PostPosted: Wed Mar 03, 2010 4:15 am 
Offline
User avatar

Joined: Sat Feb 27, 2010 8:45 pm
Posts: 39
ah, ok, I'll give it a try. thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy
PostPosted: Tue Apr 20, 2010 12:40 pm 
Offline

Joined: Mon Mar 19, 2007 3:08 pm
Posts: 24
I have just updated from RB2008r4.1 to RS2010r1 and am also disatisfied with the lack of control that the developer has over bundled plugins/libs.

Was a feature request ever filed for this? I haven't found it in the RealStudio Feedback. It would be great to be able to specify a location for the app to look in for these libraries, instead of "./MyApplication Libs" (btw a space in a file/dir name is bad practice in linux). This would be a big help especially for those of us that run RB apps on embedded systems where I, the developer, have control over every lib that is installed and their location.

I understand the need to avoid "lib ****", but as a developer I should be given the choice of where to place my plugins/libs. If RealStudios is worried about putting multiple RB apps in one location then they should also give the ability for the developer of the app to name their plugins/libs that are bundled (reference feature request 4083).


Top
 Profile  
Reply with quote  
 Post subject: Re: Shared libraries under linux; how I'm supposed to deploy
PostPosted: Fri Jun 04, 2010 9:33 am 
Offline
User avatar

Joined: Tue Jan 26, 2010 1:33 pm
Posts: 32
Location: Nova Scotia, Canada
Good morning folks.
Further to the topic, I'm curious about how you long-time RB heads would handle a situation where you've got several apps that all use the same libraries, installed in the same directory.
I have no problem having "./MyApp1 Libs"... "./MyAppN Libs" in the program directory (disk space is cheaper than a programmer's time ;) ) but I'm wondering if this (multiple Libs directories) is considered a best-practice solution.

Regards,
BG

_________________
REALStudio Enterprise 2011r4.1
Linux Mint 11
MS WIn 7 / XP


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group