You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Proposal to modify handling of blacklisted shared libraries #224
Today I got a report from a gentoo user that my GIMP appimage fails to load properly due to missing libp11-kit.so.0.
This library is part of the blacklisted ones, and is supposed to be provided by the base system. However, it seems that the corresponding package is not strictly necessary on a base gentoo system.
So I was wondering if it would be possible to foresee a different way of handling blacklisted libraries. Instead of completely deleting the blacklisted library files, they could be moved to a special library folder in the appimage , and then libraries searched in this order:
first in the standard library folders in the appimage
then in the library folders in the base system
finally in the special blacklisted folder
This way, blacklisted libraries would be taken from the appimage only if not available in the base system.
Sure it could bue done. But using this line of reasoning, where would it end? Would you include every dependency down to glibc in each AppImage?
I'd rather say (most) AppImages should target the default installation of mainstream desktop distributions, which all seem to come with libp11-kit.so.0 out of the box.
This way, libraries are first searched in the standard appimage folders, then in the system folders, and finally in the appimage folder containing the blacklisted libraries. So blacklisted libraries in the appimage are used only if the corresponding system libraries are not present.
From my initial tests this seems to work as expected, but it needs more testing on various systems.
Do you see any possible bad side effect in doing this?
I definitely see your point, however the sigil recipe is try to address a different problem, which is to completely ignore the system libraries and only use those provided in the appimage, right?
My goal is slightly different: still use the system libraries if present, and revert to appimage libraries if system libraries are absent.
In the specific case discussed here, some gentoo system is built without libp11-kit.so.0, while other low-level libraries are present. Then, since the base system does not depend on libp11-kit.so.0, using the version provided by the appimage should be safe and not leading to crashes, as far as I understand.
It is basically a question wether to try supplying missing libraries from the appimage itself, or ask the users to install some additional base packages. Which solution will be more simple and less error-prone, I still do not know...
Bundle everything (like in the Sigil example) is the safest, bundle everything except the blacklisted ones is less safe and more of trial-and-error, and you suggested model of match-and-mix is probably the most crash-prone if not tested in all possible combinations properly. Although I have not experimented with it so far.
I was intuitively expecting the opposite: bundling everything being the most crash-prone solution, but then I have to admit I'm quite out of my "comfort zone" on this topic.
In the GIMP appimage case, bundling everything would be definitely feasible, since the size overhead is negligible and I already have a wrapper script where I can set the paths properly, following the Sigil example.
But now I'm wondering: why do you blacklist and remove libraries for most of the packages?
Why do you blacklist and remove libraries for most of the packages?
So that we don't ship libraries that can reasonably expected to already be on the target systems, like glibc or GTK+. Some people might call that bloat, using additional download bandwidth, storage, and RAM. But if the additional overhead is relatively small compared to the overall app, it might not be as bad as it sounds. Still, I'd say that Gentoo user can get the one missing lib from the distro.
I think we can close this for the moment, as I have not enough test cases to verify if my proposal is more or less error-prone than the standard solution... to which I will stick for the time being.
Activity
probonopd commentedon Aug 30, 2016
Sure it could bue done. But using this line of reasoning, where would it end? Would you include every dependency down to glibc in each AppImage?
I'd rather say (most) AppImages should target the default installation of mainstream desktop distributions, which all seem to come with libp11-kit.so.0 out of the box.
aferrero2707 commentedon Aug 31, 2016
I did a test of moving the blacklisted libraries instead of deleting them, by using the following function in the Recipe:
This adds an extra 3.5MB to the appimage.
Then I have introduced a wrapper script in the appimage that sets the LD_LIBRARY_PATH in this way before calling the real executable:
This way, libraries are first searched in the standard appimage folders, then in the system folders, and finally in the appimage folder containing the blacklisted libraries. So blacklisted libraries in the appimage are used only if the corresponding system libraries are not present.
From my initial tests this seems to work as expected, but it needs more testing on various systems.
Do you see any possible bad side effect in doing this?
probonopd commentedon Aug 31, 2016
Didn't test the above yet, but might lead to crashes if glibc, ld-linux.so and related low level libraries are not handled properly. See https://github.com/probonopd/AppImages/blob/master/recipes/sigil/Recipe for an example that bundles everything down to glibc. The result, if done properly, should be that the app runs even on ancient distributions (older than the build system).
aferrero2707 commentedon Aug 31, 2016
I definitely see your point, however the sigil recipe is try to address a different problem, which is to completely ignore the system libraries and only use those provided in the appimage, right?
My goal is slightly different: still use the system libraries if present, and revert to appimage libraries if system libraries are absent.
In the specific case discussed here, some gentoo system is built without libp11-kit.so.0, while other low-level libraries are present. Then, since the base system does not depend on libp11-kit.so.0, using the version provided by the appimage should be safe and not leading to crashes, as far as I understand.
It is basically a question wether to try supplying missing libraries from the appimage itself, or ask the users to install some additional base packages. Which solution will be more simple and less error-prone, I still do not know...
probonopd commentedon Aug 31, 2016
Bundle everything (like in the Sigil example) is the safest, bundle everything except the blacklisted ones is less safe and more of trial-and-error, and you suggested model of match-and-mix is probably the most crash-prone if not tested in all possible combinations properly. Although I have not experimented with it so far.
aferrero2707 commentedon Aug 31, 2016
I was intuitively expecting the opposite: bundling everything being the most crash-prone solution, but then I have to admit I'm quite out of my "comfort zone" on this topic.
In the GIMP appimage case, bundling everything would be definitely feasible, since the size overhead is negligible and I already have a wrapper script where I can set the paths properly, following the Sigil example.
But now I'm wondering: why do you blacklist and remove libraries for most of the packages?
Thanks for all your explanations!
probonopd commentedon Aug 31, 2016
So that we don't ship libraries that can reasonably expected to already be on the target systems, like glibc or GTK+. Some people might call that bloat, using additional download bandwidth, storage, and RAM. But if the additional overhead is relatively small compared to the overall app, it might not be as bad as it sounds. Still, I'd say that Gentoo user can get the one missing lib from the distro.
probonopd commentedon Nov 5, 2016
Is this still of concern? Is there any action/change still needed?
aferrero2707 commentedon Nov 10, 2016
I think we can close this for the moment, as I have not enough test cases to verify if my proposal is more or less error-prone than the standard solution... to which I will stick for the time being.
Thanks!