go-appimage icon indicating copy to clipboard operation
go-appimage copied to clipboard

go-appimage does NOT follow AppImage spec recommendation nor FHS regarding `/usr` prefix

Open brunvonlope opened this issue 1 year ago • 13 comments

The draft spec (https://github.com/AppImage/AppImageSpec/blob/master/draft.md#the-payload-application) says:

It is RECOMMENDED that the payload application and its dependencies are located in a $PREFIX directory tree inside the AppDir with $PREFIX commonly being ./usr/; it is RECOMMENDED that the $PREFIX directory tree inside the AppDir follows the File System Hierarchy conventions for /usr

However, using go-appimage for deployment makes a .appimage with some deps outside the /usr dir (so in AppDir), but others are deployed to inside /usr dir as expected. This inconsistency causes problems:

In GIMP .appimage script (due to babl and GEGL and to conform to the best practices of the spec), we force move deps to inside /usr prefix after -s deploy: https://gitlab.gnome.org/GNOME/gimp/-/blob/2aaeb55ac0293e8c64b12d82e77dbe14bbfef2ff/build/linux/appimage/2_bundle-gimp-appimage.sh#L299, but this corrupts the RPATH of the deps that we needed to force move.

brunvonlope avatar Nov 28 '24 21:11 brunvonlope

Thanks @brunvonlope.

The files which are not in ./usr, where are they coming from on the build system? Which files are these?

probonopd avatar Nov 28 '24 21:11 probonopd

They are coming from the system prefix. They are libraries and some dirs like gconv

brunvonlope avatar Nov 28 '24 21:11 brunvonlope

Can you please list the paths of the affected files? Thanks.

probonopd avatar Nov 28 '24 22:11 probonopd

AppDir/lib/arch_triplet have:

gconv/
gdk-pixbuf-2.0/
gtk-3.0/
libICE.so.6
libIex-3_1.so.30
libIlmThread-3_1.so.30
libImath-3_1.so.29
libLerc.so.4
libOpenEXR-3_1.so.30
libSM.so.6
libX11.so.6
libXau.so.6
libXcomposite.so.1
libXcursor.so.1
libXdamage.so.1
libXdmcp.so.6
libXext.so.6
libXfixes.so.3
libXi.so.6
libXinerama.so.1
libXmu.so.6
libXpm.so.4
libXrandr.so.2
libXrender.so.1
libXt.so.6
libaa.so.1
libacl.so.1
libamd.so.2
libaom.so.3
libappstream-glib.so.8
libarchive.so.13
libatk-1.0.so.0
libatk-bridge-2.0.so.0
libatspi.so.0
libavahi-client.so.3
libavahi-common.so.3
libblas.so.3
libblkid.so.1
libbluray.so.2
libbrotlicommon.so.1
libbrotlidec.so.1
libbrotlienc.so.1
libbsd.so.0
libbz2.so.1.0
libc.so.6
libcairo-gobject.so.2
libcairo.so.2
libcamd.so.2
libcanberra-gtk3.so.0
libcanberra.so.0
libcap.so.2
libccolamd.so.2
libcfitsio.so.10
libcholmod.so.3
libcolamd.so.2
libcolord.so.2
libcom_err.so.2
libcrypt.so.1
libcrypto.so.3
libcups.so.2
libcurl-gnutls.so.4
libdatrie.so.1
libdav1d.so.6
libdb-5.3.so
libdbus-1.so.3
libde265.so.0
libdeflate.so.0
libdl.so.2
libepoxy.so.0
libexiv2.so.27
libexpat.so.1
libexslt.so.0
libffi.so.8
libfontconfig.so.1
libfreetype.so.6
libfribidi.so.0
libgcc_s.so.1
libgck-1.so.0
libgcr-base-3.so.1
libgcrypt.so.20
libgdk-3.so.0
libgdk_pixbuf-2.0.so.0
libgexiv2.so.2
libgfortran.so.5
libgio-2.0.so.0
libgirepository-1.0.so.1
libgjs.so.0
libglib-2.0.so.0
libgmodule-2.0.so.0
libgmp.so.10
libgnomekbd.so.8
libgnomekbdui.so.8
libgnutls.so.30
libgobject-2.0.so.0
libgomp.so.1
libgpg-error.so.0
libgpm.so.2
libgraphite2.so.3
libgs.so.10
libgssapi_krb5.so.2
libgtk-3.so.0
libgudev-1.0.so.0
libharfbuzz.so.0
libheif.so.1
libhogweed.so.6
libhwy.so.1
libicudata.so.72
libicuuc.so.72
libidn.so.12
libidn2.so.0
libijs-0.35.so
libjbig.so.0
libjbig2dec.so.0
libjpeg.so.62
libjson-c.so.5
libjson-glib-1.0.so.0
libjxl.so.0.7
libjxl_threads.so.0.7
libk5crypto.so.3
libkeyutils.so.1
libkrb5.so.3
libkrb5support.so.0
liblapack.so.3
liblber-2.5.so.0
liblcms2.so.2
libldap-2.5.so.0
libltdl.so.7
liblz4.so.1
liblzma.so.5
libm.so.6
libmaxflow.so.0
libmd.so.0
libmetis.so.5
libmng.so.1
libmount.so.1
libmozjs-102.so.0
libmypaint-1.5.so.1
libncurses.so.6
libncursesw.so.6
libnettle.so.8
libnghttp2.so.14
libnsl.so.2
libnspr4.so
libnss3.so
libnssutil3.so
libnuma.so.1
libogg.so.0
libopenjp2.so.7
libp11-kit.so.0
libpanelw.so.6
libpango-1.0.so.0
libpangocairo-1.0.so.0
libpangoft2-1.0.so.0
libpaper.so.1
libpcre2-8.so.0
libpixman-1.so.0
libplc4.so
libplds4.so
libpng16.so.16
libpoppler-glib.so.8
libpoppler.so.126
libproxy.so.1
libpsl.so.5
libpthread.so.0
libquadmath.so.0
libraw.so.20
libreadline.so.8
libresolv.so.2
librsvg-2.so.2
librtmp.so.1
libsasl2.so.2
libsecret-1.so.0
libselinux.so.1
libslang.so.2
libsmime3.so
libspiro.so.1
libsqlite3.so.0
libssh2.so.1
libssl.so.3
libstdc++.so.6
libstemmer.so.0d
libsuitesparseconfig.so.5
libsystemd.so.0
libtasn1.so.6
libtdb.so.1
libthai.so.0
libtiff.so.6
libtinfo.so.6
libtirpc.so.3
libudev.so.1
libudfread.so.0
libudisks2.so.0
libumfpack.so.5
libunistring.so.2
libunwind.so.8
libuuid.so.1
libvorbis.so.0
libvorbisfile.so.3
libwayland-client.so.0
libwayland-cursor.so.0
libwayland-egl.so.1
libwebp.so.7
libwebpdemux.so.2
libwebpmux.so.3
libwmf-0.2.so.7
libwmflite-0.2.so.7
libx265.so.199
libxapp.so.1
libxcb-render.so.0
libxcb-shm.so.0
libxcb.so.1
libxkbcommon.so.0
libxkbfile.so.1
libxklavier.so.16
libxml2.so.2
libxslt.so.1
libyaml-0.so.2
libz.so.1
libzstd.so.1

AppDir/etc have:

fonts/

brunvonlope avatar Nov 29 '24 00:11 brunvonlope

Where are these located on your build system? In /usr or not?

probonopd avatar Nov 29 '24 11:11 probonopd

Where are these located on your build system? In /usr or not?

As I said in https://github.com/probonopd/go-appimage/issues/315#issuecomment-2506795320, they come from the "system prefix" aka /usr dir

brunvonlope avatar Nov 29 '24 11:11 brunvonlope

Thanks. Geneally appimgetool tries to copy files into the AppDir at the same path as they are on the build system, so that the files stay at the same locations relative to each other. Is there a symlink on your system from /lib pointing to /usr/lib or vice versa?

probonopd avatar Nov 29 '24 11:11 probonopd

Is there a symlink on your system from /lib pointing to /usr/lib or vice versa?

Yes, Debian have that exact same symlink: /lib pointing to /usr/lib

brunvonlope avatar Nov 29 '24 11:11 brunvonlope

I have exact the same problem on ubuntu20.04. Ubuntu20.04 have that exact same symlink: /lib pointing to /usr/lib too. Is that solved? I can't run my appimage because can not find libpthread.so.0. I think the reason is mostly that some deps like libpthread.so.0 is outside the /usr dir.

liebebaby avatar Nov 28 '25 09:11 liebebaby

log as below: VERSION=1.0 ~/Download/appimagetool-911-x86_64.AppImage -s ./AppDir dataShow 2025/11/28 18:51:39 Architecture of libQt5Charts.so.5: x86_64 ERROR Determine architecture: Could not detect a valid architecture 2025/11/28 18:51:39 Apparently not in a git repository 2025/11/28 18:51:39 Target AppImage filename: dataShow-1.0-x86_64.AppImage 2025/11/28 18:51:39 Icon file: AppDir/usr/share/icons/hicolor/256x256/apps/dataShow.png 2025/11/28 18:51:39 WARNING: AppStream upstream metadata is missing, please consider creating it in AppDir/usr/share/metainfo/dataShow.appdata.xml Please see https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps for more information or use the generator at https://appimagecommunity.github.io/simple-appstream-generator/ /tmp/.mount_appimaPFpGHp/usr/bin/mksquashfs AppDir dataShow-1.0-x86_64.AppImage -offset 442680 -fstime 1764327099 -comp zstd -root-owned -noappend -b 1M Parallel mksquashfs: Using 16 processors Creating 4.0 filesystem on dataShow-1.0-x86_64.AppImage, block size 1048576. [==============================================================/] 465/465 100%

Exportable Squashfs 4.0 filesystem, zstd compressed, data block size 1048576 compressed data, compressed metadata, compressed fragments, compressed xattrs, compressed ids duplicates are removed Filesystem size 39262.74 Kbytes (38.34 Mbytes) 32.80% of uncompressed filesystem size (119690.72 Kbytes) Inode table size 3587 bytes (3.50 Kbytes) 25.13% of uncompressed inode table size (14273 bytes) Directory table size 4104 bytes (4.01 Kbytes) 45.11% of uncompressed directory table size (9098 bytes) Number of duplicate files found 1 Number of inodes 433 Number of files 386 Number of fragments 36 Number of symbolic links 1 Number of device nodes 0 Number of fifo nodes 0 Number of socket nodes 0 Number of directories 46 Number of hard-links 0 Number of ids (unique uids + gids) 1 Number of uids 1 root (0) Number of gids 1 root (0) Embedding ELF... Marking the AppImage as executable... Calculating the sha256 digest... Assuming section .sha256_sig offset 431824 length 1024 to contain only '0x00's Assuming section .sig_key offset 432848 length 8192 to contain only '0x00's ...hashing 431824 bytes ...hashing 1024 bytes as if they were 0x00 ...hashing 8192 bytes as if they were 0x00 ...hashing 40207976 bytes

Embedded .sha256_sig section Offset: 431824 Embedded .sha256_sig section Length: 1024

Writing into .sha256_sig section... 1024

Embedded .sha256_sig section now contains: 1fcb466d9e07bee09986a23d1e6acf590fbf1b117fe2623c93d29c39341e0be1

Could not read /pubkey.asc: open /pubkey.asc: no such file or directory Almost a success

The AppImage was created, but is lacking update information. Possibly it was built on a local developer machine. Such an AppImage is fine for local use but should not be distributed.

./dataShow-1.0-x86_64.AppImage /tmp/.mount_dataShnmbIKk/usr/bin/dataShow: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory

liebebaby avatar Nov 28 '25 11:11 liebebaby