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

Resulting appimage does not work

Open Redhawk18 opened this issue 1 year ago • 4 comments

─redhawk🎉Mythra─ ~/Code/code-editor 
 └$ ./target/appimage/code-editor.AppImage 
Error: couldn't exec process: No such file or directory

And this is my build process

─redhawk🎉Mythra─ ~/Code/code-editor 
 └$ cargo appimage
    Finished release [optimized] target(s) in 0.34s
appimagetool, continuous build (commit 8bbf694), build <local dev build> built on 2020-12-31 11:48:33 UTC
WARNING: zsyncmake command is missing, please install it if you want to use binary delta updates
Using architecture x86_64
/home/redhawk/Code/code-editor/target/code-editor.AppDir should be packaged as target/appimage/code-editor.AppImage
WARNING: AppStream upstream metadata is missing, please consider creating it
         in usr/share/metainfo/cargo-appimage.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 http://output.jsbin.com/qoqukof.
Generating squashfs...
Parallel mksquashfs: Using 12 processors
Creating 4.0 filesystem on target/appimage/code-editor.AppImage, block size 131072.
[==================================================================================================================================================================================================|] 151/151 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 6045.79 Kbytes (5.90 Mbytes)
        31.75% of uncompressed filesystem size (19043.26 Kbytes)
Inode table size 589 bytes (0.58 Kbytes)
        68.65% of uncompressed inode table size (858 bytes)
Directory table size 126 bytes (0.12 Kbytes)
        81.29% of uncompressed directory table size (155 bytes)
Number of duplicate files found 1
Number of inodes 8
Number of files 4
Number of fragments 1
Number of symbolic links  1
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 3
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...
Embedding MD5 digest
Success

Please consider submitting your AppImage to AppImageHub, the crowd-sourced
central directory of available AppImages, by opening a pull request
at https://github.com/AppImage/appimage.github.io

Redhawk18 avatar Jul 06 '23 15:07 Redhawk18

Just ran into the same problem. I'd be happy to help tracking this issue down, what further info is required?

I already tried strace on the resulting AppImage, to see whats going on:

$ strace ./target/appimage/apt-decoder.AppImage
...
eadlink("/proc/self/exe", "/tmp/.mount_apt-deNoxpP4/AppRun", 256) = 31
chdir("/tmp/.mount_apt-deNoxpP4")       = 0
execve("/tmp/.mount_apt-deNoxpP4/usr/bin/bin", ["./target/appimage/apt-decoder.Ap"...], 0x559af2c06fb0 /* 81 vars */) = -1 ENOENT (No such file or directory)
write(2, "Error: ", 7Error: )                  = 7
write(2, "couldn't exec process", 21couldn't exec process)   = 21
write(2, ": ", 2: )                       = 2
write(2, "No such file or directory", 25No such file or directory) = 25
write(2, "\n", 1
)                       = 1
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
munmap(0x7f9129d18000, 12288)           = 0
exit_group(0)                           = ?
+++ exited with 0 +++

And sure enough usr/bin/bin does not exist in the AppImage:

$ appimagetool -l ./target/appimage/apt-decoder.AppImage
appimagetool, continuous build (commit 8bbf694), build <local dev build> built on 2020-12-31 11:48:33 UTC
WARNING: zsyncmake command is missing, please install it if you want to use binary delta updates
WARNING: appstreamcli command is missing, please install it if you want to use AppStream metadata
.DirIcon
AppRun
cargo-appimage.desktop
icon.png
usr
usr/bin
usr/bin/apt-decoder

In case you want to check the image yourself: apt-decoder.AppImage.gz

LongHairedHacker avatar Aug 01 '23 19:08 LongHairedHacker

Okay I think I found it.

v1.4.0 copied the binary to usr/bin/bin inside the AppImage. See v1.4.0/src/main.rs#L197

v2.0.0 copies the binary to format!("usr/bin/{}", &name). See v2.0.0/src/main.rs#L229. However apprun.rs still tries to execvp usr/bin/bin. See v2.0.0/src/apprun.rs#L25

LongHairedHacker avatar Aug 01 '23 20:08 LongHairedHacker

yeah, ive temporarily fixed it by just changing format!("usr/bin/{}", &name) back to /usr/bin/bin in a fork of it

Spagett1 avatar Aug 12 '23 02:08 Spagett1

Should we close this? #28 fixes the issue

fililip avatar Nov 17 '23 21:11 fililip