-
Notifications
You must be signed in to change notification settings - Fork 430
Correctly handle libraries in subdirectories #327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I tried this again with a minimal example and the above case actually works. However, our structures is actually a bit more complicated (I think QtCreator does it similarly):
In this case, everything in When linuxdeployqt encounters I honestly don't know what the best way of fixing this is. Even if the dependency resolution would work, What do you think about another option, that would not copy dependencies that are already part of the package and would only prepend to the original RPATH instead of overriding it? So basically keeping the structure of the original package and only copy dependencies from outside. |
The original RPATH could be absolute (this is what I see most of the time) or relative (starting with This leaves the question what to do with pre-existing absolute RPATHs. Not sure how this "prepend" should work but we should not get the situation where a library inside the AppImage leads the linker to look up nonstandard places outside of the AppImage, e.g. it should not start to try loading libraries from |
Interesting, I would have expected it the other way around. Anyway, I would just remove any RPATH that does not start with I will try to create a pull request for this and see if this actually solves my problem. |
I mean, if there was an absolute RPATH to begin with, then we could try to rewrite it into a relative one. If we already find a relative one, then just leave it alone. Does this make sense? |
Hm, I think this would only work for RPATHs starting with I think rewriting the absolute RPATH is too complicated and probably not worth the effort. |
Since in your case you are doing a very special thing (which you as the author are familiar with) it would probably be OK to just run |
I used to use chrpath to change the rpath QtWebEngineProcess and other files. I don't know if patchelf has the same restriction (believe it should.) You cannot insert a longer RAPTH into a file than was originally built in. $ORIGIN didn't exist (or I didn't know about it) last time I wrote this stuff. Qt certainly didn't have any documentation on it, but now it has lots. Be careful with $ORIGIN. When it comes to "plugins," not always what you think. Depending on how the thing is launched it could be the plugin directory and not the /bin where the primary executable is. Relative paths get really horrible then. Along these lines and the lines of: I'm currently experimenting with porting a Qt Webengine multi-arch debian to use AppImage. Under Ubuntu Mate 18.04 32-bit still getting bit by the nss stuff, but, might have work around. The real killer is linuxdeployqt doesn't appear to have any multi-arch support. I would like to suggest a few things to ease overall pain. -include-lib-dir As long as the land of Linux remains complete anarchy (yes, I skimmed through https://gitlab.com/probono/platformissues and don't expect the anarchy to end any time soon, they all want to be the profitable one) developers are going to need a method of forcing in directory structures along with additional files. For the 32-bit version it would be nice to see -multi-arch but you may be limited via snapd itself there. What I envision for that feature is a complete packaging of 32-bit libraries such that the .AppImage can be dropped onto a 64-bit machine and just run. No need to install platform specific multi-arch libraries. |
Actually with patchelf you can, since it automatically adjusts the size of the executable.
$ORIGIN is always expanded to the directory containing the program or shared object. E.g. the $ORIGIN in the RPATH of a shared library will always be the directory of the shared library and never of the executable that loaded the library. However, there can be some other issues with RPATH vs RUNPATH (see here).
In this case you could move the affected folders out of the package into a temporary directory, call |
Ah! So it is much better than chrpath. That's the one I was thinking of.
What you said is what I've believed for some time until I started working with QWebEngine. The plugins don't always behave in such manner. Perhaps some of it is due to items in the link you provided.
One could, but, it would sure be nice to provide them in the command. I actually was looking at (not trying, just thinking about) copying them into the tree under lib so it would be: |
Our philosophy is not to add additional switches like Instead, we should make |
@M-Mueller writes in #216 (comment):
This is still an issue if a library as an RPATH. For example if you have the following structure:
libfoo.so
has an RPATH of$ORIGIN/libfoo
and links againstlibbar.so
.linuxdeployqt will first set the RPATH of
libfoo.so
to$ORIGIN
and then complain that ldd cannot findlibbar.so
. I think the order in this case should be changed as well.I had attempted to fix this by adding
lib/libfoo.so
toLD_LIBRARY_PATH
in 9a93e03 but apparently it is not working. Any help appreciated.The text was updated successfully, but these errors were encountered: