philippgille / hello-netcoreapp

Basic .NET Core console application with additional scripts and files for building the app and creating release artifacts for a framework-dependent deployment, self-contained deployment, Docker image, Chocolatey package and AppImage
GNU General Public License v3.0
6 stars 5 forks source link

AppImage should include .NET Core native prerequisites #35

Open probonopd opened 6 years ago

probonopd commented 6 years ago

libunwind.so.8 cannot be assumed to be part of each target distribution and should hence be bundled inside the AppImage:

me@host:~$ /home/me/Downloads/hello-netcoreapp_v0.1.0_linux-x64.AppImage 
Failed to load ���, error: libunwind.so.8: cannot open shared object file: No such file or directory
Failed to bind to CoreCLR at '/tmp/.mount_chxwbL/usr/bin/hello-netcoreapp_linux-x64/libcoreclr.so'
philippgille commented 6 years ago

Currently the self-contained deployments (e.g. hello-netcoreapp_v0.1.0_linux-x64.tar.gz) as well as the AppImage (which is based on the linux-x64 SCD) require the .NET Core native prerequisites to be installed.

I understand that this is a bad requirement for a package like AppImage that should be portable. I'll have to look into how to include libraries and programs in an AppImage.

Until then, installing them is the only option: apt-get install -y --no-install-recommends libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev unzip

probonopd commented 6 years ago

You are correct, please bundle all the libraries needed except the ones we can expect to be on each target system in a recent enough version, like these.

probonopd commented 6 years ago

Also have a look at the many examples at https://github.com/AppImage/AppImages/.

philippgille commented 6 years ago

I had a look at some Recipes back when I first added AppImage as a target artifact type for this project, but they appeared (to me) to be complicated. I think exactly the part of copying the necessary dependencies into the AppImage was the most confusing part and I didn't understand it. It also didn't help that I'm not familiar with the internals of native Linux applications that rely on shared libraries (it's easier with .jar and .dll files for Java / C# apps).

Looking at some Recipes a second time now and having played around with the AppImage build process a bit, it seems to me as if copy_deps() in functions.sh is most of what's necessary for that. Is that correct?

probonopd commented 6 years ago

Yes, copy_deps, followed by delete_blacklisted should do.

philippgille commented 6 years ago

Found a .NET Core documentation page describing how (some of?) those third-party dependencies can be included with the shipped application, not just for the AppImage: https://github.com/dotnet/core/blob/master/Documentation/self-contained-linux-apps.md