Skip to content

AppImages that bundle *everything* #225

Open

Description

@aferrero2707

As suggested in issue #224 I am trying to create a GIMP recipe that bundles all libraries, without blacklisting.
The standard recipe is presently not working on some distributions (Kubuntu 16.04 LiveCD for example), and I hope that the full bundling will solve such incompatibilities.

I have followed the example for sigil (https://github.com/probonopd/AppImages/blob/master/recipes/sigil/Recipe), but somehow I still cannot get the appimage to run correctly. In particular, the gimp executable crashes with a

free(): invalid next size (normal)

error that I cannot really interpret.

The full-bundling recipe can be found here: https://gist.github.com/aferrero2707/aea9aa96648078b306d6034daaf0372d

Does anyone have an idea how to fix that?

Thanks in advance!

Activity

  1. probonopd commented on Sep 4, 2016

    @probonopd
    Member

    Don't bundle everything, it is neither recommended not supported. I also have issues with it.

  2. changed the title [-]Help needed with fully bundled Recipe for GIMP[/-] [+]AppImages that bundle *everything*[/+] on Nov 5, 2016
  3. darealshinji commented on Nov 24, 2016

    @darealshinji
    Contributor

    If you really need newer versions of libc6, libstdc++6 or similar base libraries, running an AppImage inside a chroot might be an option.

  4. probonopd commented on Nov 24, 2016

    @probonopd
    Member

    Doesn't a chroot need root?

  5. darealshinji commented on Nov 24, 2016

    @darealshinji
    Contributor

    schroot doesn't. But you need to be root to set it up. So... yeah.
    Isn't it possible to use fuse to setup a chroot without root rights?

  6. probonopd commented on Nov 24, 2016

    @probonopd
    Member

    ...or use something like fakechroot

  7. probonopd commented on Jul 23, 2017

    @probonopd
    Member
  8. probonopd commented on Aug 20, 2017

    @probonopd
    Member

    Another option may be to edit everything with patchelf so that absolutely no libraries get loaded from the system anymore (check with LD_DEBUG=libs!), and then in AppRun invoke the application like so:

    "$APPDIR"/lib/x86_64-linux-gnu/ld-2.23.so "$APPDIR"/usr/bin/appstreamcli "$@"
    

    Seems to have worked for me where all other options have failed me.

  9. probonopd commented on Feb 2, 2018

    @probonopd
    Member
  10. TheAssassin commented on Jul 15, 2018

    @TheAssassin
    Member

    Such a feature has been requested as a plugin for linuxdeploy, see linuxdeploy/linuxdeploy#5.

  11. darealshinji commented on Jul 16, 2018

    @darealshinji
    Contributor

    Building a snap package may be an option.

  12. 23 remaining items

  13. azubieta commented on Feb 17, 2020

    @azubieta
    Contributor

    Apline Linux support is planned to be added on appimage-builder 0.5. If you have any idea or suggestion please feel free to add them in the following issue: AppImageCrafters/appimage-builder#10

  14. probonopd commented on Feb 17, 2020

    @probonopd
    Member

    Cool @azubieta maybe you want to re-use something from my (currently still experimental) go-based implementation; see the example script at mumble-voip/mumble#3959 (comment).

  15. TheAssassin commented on Feb 18, 2020

    @TheAssassin
    Member

    @probonopd your definition still doesn't work. Please call it a "fully self-contained AppDir", if any. Lingo is extremely important. I've explained more than once why the property "self-contained" applies to the existing AppDir already. I don't know why I have to keep repeating myself on that.

    Regarding the overhead, I don't think anyone wants to ship 30 MiB of runtime for an application of 2 MiB. That poll was way too imprecise, as it doesn't put the AppImage size in relation with the size of the overhead.

    There is also no need to enforce this kind of behavior. I think our established way has been working absolutely amazing, given its simplicity.

    Also your approach still ignores the heterogenity of hardware. As soon as you depend on some special hardware, e.g., graphics accelerators, being "fully self-contained" is nearly impossible unless you make an AppImage for every possible situation. That usually means one per graphics card driver for a game, for instance. You will never get away with full isolation between AppImage resources and host system, there'll always be situations in which there is a need to share some resources. And I don't think that's an issue at all.

    P.S.: I think it's absolutely possible and also necessary to keep < 1 MiB for the runtime. That should be our goal. Even if we had to bundle a (subset of a) libc implementation, e.g., musl, as well as some FUSE code.
    If glibc, ld-linux & Co. became hard dependencies that have to be bundled as the contents require that, they become part of the runtime IMO. And in that case, the size of the runtime is going to go through the roof immediately.

  16. TheAssassin commented on Feb 18, 2020

    @TheAssassin
    Member

    Also, the following questions haven't been covered in this issue yet:

    How to implement security maintenance? Reusing some critical bits like libc or libssl from the system means they're usually up to date (and if not, that's really the problem of the system owner).

    If you rely on updating the AppImages instead of reusing system libs, how can you ensure long term maintenance? Check appimage.github.io, there's tons of AppImages that haven't been updated in years. Anything that contains a browser (which is like, half of them, as they're using that damn Electron) is a security hazard.

    Please don't yell "sandboxing!" now. Founding security on sandboxing is a horrible idea. Not to mention we don't have any serious sandboxing available for AppImages!

  17. azubieta commented on Feb 18, 2020

    @azubieta
    Contributor

    I think that people will be totally fine with an extra 30 (or even 50 MB) of AppImage size if that's the only way the app will work. Consider the cases where the user wants to keep running very old and well-known software or his favorite retro-game.

    Developers, on the other hand, will love the idea of being able to build their packages in the latest and really up-to-date distribution where they can find all the app resources instead of dealing with several hairy backports and for a nearly to dead distribution (yes I'm talking about Centos 6).

    AppImage have been always a gamble between portability and size. You want to produce a more portable binary then you have to embed more stuff. Why it is not enough to bundle just the middleware? We all know the answer to that, GNU/Linux distributions are a mess (a reference to the @probonopd platform issues goes here).

    It's not about enforcing this kind of AppImages is about to give an alternative. Developers will have the final word on whether they want their binaries to be more or less portable. We must give options.

    You will never get away with full isolation between AppImage resources and the host system, there'll always be situations in which there is a need to share some resources. And I don't think that's an issue at all

    Agreed, yet the AppImages produced using this approach haven't had any significant issue related to this topic. It will be always a tradeoff.

    On the security topic. Security starts on the code if the application is not maintained you cannot expect it to be up to date with the latest security standards. The 1.1 version of libssl provides better encryption mechanisms that version 1.0. The software must change to use such an improved mechanism. So if a given piece of software is being maintained properly spinning a new bundle with up to date binaries is not a big deal, they can even set a programmed task on their build service. And the delta updates mechanism used by AppImageUpdate makes the process simple for the final user. Also being able to build in the very latest distributions makes it easier getting such updates.

    Those were my 50c on the topic

  18. TheAssassin commented on Feb 18, 2020

    @TheAssassin
    Member

    @azubieta you seem to agree to the point that there are cases in which this might be useful, but it shouldn't be required nor enforced. It's IMO still an edge case, and we shouldn't replace the current "build on old systems" approach.

    On the security topic. Security starts on the code if the application is not maintained you cannot expect it to be up to date with the latest security standards. [...]

    I've been following the same approach distributions have been using for decades. Old software can still be around, but its dependencies are at least kept up to date. For crypto libraries for instance this works pretty well, as devs are instructed to use them instead of shipping their own. If the calls are in the right order, the stability of the crypto libs' APIs usually guarantees that it'll be safe at the time of development as well as the future. (If it ain't securely developed in the first place it will never be safe in the future, sure, but that's not the point).

    IMO bundling everything should be the ever last resort after everything else has failed. One should IMO reference at least some LTS system (e.g., the latest(!) Ubuntu LTS) for a project's dependencies, not the cutting edge, but ideally you target the oldest still-supported LTS you can find (CentOS usually).
    Regarding keeping things up to date, any kind of "bundles everything" AppImage should be built on OBS, as that will make sure it'll receive updates in the future.

  19. azubieta commented on Feb 18, 2020

    @azubieta
    Contributor

    we shouldn't replace the current "build on old systems" approach

    I found it easier a "build on newer systems" approach, but it's not up to us to decide that. The decision should be made by the developers. We must give them accurate information about the different existent approaches, their strengths, and weakness. And of course, we should provide the tools.

  20. probonopd commented on Mar 6, 2020

    @probonopd
    Member

    From a cursory glance it seems like some of the patches in https://github.com/flatpak/freedesktop-sdk-images modify upstream software so that it works in non-standard locations.

    ALSA, GL, GLX, fontconfig, libva-vdpau, mesa, mesa-dri, Nvidia stuff, SDL,...

    Who understands what is going on there? Is this helpful for AppImages that bundle everything?

  21. azubieta commented on Mar 6, 2020

    @azubieta
    Contributor

    Interesting, but that forces us to build the whole dependencies stack to create an AppImage. Or use the binaries they already have.

  22. probonopd commented on Mar 22, 2020

    @probonopd
    Member

    Seems like a real downside of AppImages that bundle everything is that we cannot get Nvidia GPU acceleration to work in them, unless we introduce some concept of runtimes/dependencies (which we don't want).

    At least I get this impression when I look at what Flatpak is doing:

    On a system that has this kernel driver version (340.107):

    me@host:~$ dmesg | grep 340.107
    [   19.879987] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  340.107  Thu May 24 21:54:01 PDT 2018
    

    Flatpak installed this runtime automatically (340.107):

    me@host:~$ ls .local/share/flatpak/runtime/org.freedesktop.Platform.GL.nvidia-340-107/x86_64/1.4/b0e864d2e4465f9a554d45a62d353b2f768815a3cebeee1ed9354ce3b6a8b47d/files/extra/
    libcuda.so               libnvcuvid.so.1                libnvidia-ml.so.340.107
    libcuda.so.1             libnvcuvid.so.340.107          libnvidia-opencl.so
    libcuda.so.340.107       libnvidia-cfg.so.340.107       libnvidia-opencl.so.340.107
    libEGL.so.1              libnvidia-compiler.so.340.107  libnvidia-tls.so.340.107
    libEGL.so.340.107        libnvidia-eglcore.so.340.107   libnvidia-wfb.so.340.107
    libGLESv1_CM.so.340.107  libnvidia-encode.so.1          libvdpau_nvidia.so
    libGLESv2.so.1           libnvidia-encode.so.340.107    libvdpau_nvidia.so.340.107
    libGLESv2.so.340.107     libnvidia-fbc.so.340.107       libvdpau.so.340.107
    libGL.so.1               libnvidia-glcore.so.340.107    libvdpau_trace.so.340.107
    libGL.so.340.107         libnvidia-glsi.so.340.107      OpenCL
    libglx.so.1              libnvidia-ifr.so.340.107       tls
    libglx.so.340.107        libnvidia-ml.so.1
    

    So it seems like it matches the runtime to the version of the installed kernel module. Which means that if we wanted to ship Nvidia drivers, we would have to bundle all possible versions of Nvidia drivers. Which is clearly impossible for future versions of the driver...

    So it seems that Nvidia acceleration cannot be supported without some concept of dependencies/runtimes.

    Thanks @azubieta for helping me learn this.

    barthalion on IRC confirmed that this is not the case for Intel and AMD.

  23. Kirtai commented on Aug 21, 2020

    @Kirtai

    Doesn't Flatpak require this due to the sandbox, rather than the bundling?

  24. probonopd commented on Aug 22, 2020

    @probonopd
    Member

    According to @azubieta, in order to get Nvidia GPU acceleration to work it is required to use some libraries from the target operating system, especially the Nvidia libraries. This means that if we want to use Nvidia GPU acceleration, then we cannot have a 100% standalone AppImage since whenever the glibc, libz, and libstdc++ on the system are newer than what comes with the AppImage, then the Nvidia libraries on the system may require those newer versions rather than what comes with the AppImage. @azubieta hence uses a logic to determine whether the version of those libraries (and auxiliary files that go along with them) is newer in the AppImage or on the system, and uses that in https://github.com/AppImageCrafters/AppRun.

    While this solution is not as elegant as I'd like it to be, it's probably the best that we can technically do at the moment, given how all of this works... Flatpak seems to be the Nvidia stuff in a Flatpak runtime as well (rather than using what comes with the system). I would assume they have many different variations/versions of org.freedesktop.Platform.GL.nvidia which is infeasible for the AppImage "one app = one file" concept, but I haven't checked it in detail.

  25. probonopd commented on Aug 22, 2020

    @probonopd
    Member

    One thing that still puzzles me is why this appears to be an issue for Nvidia but not for Intel nor AMD graphics.

    Or is it?

  26. azubieta commented on Aug 24, 2020

    @azubieta
    Contributor

    Intal and AMD drivers are compatible between different versions, but still you may not have access to the latest driver/device features if you're using an old client library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions