probonopd / go-appimage

Go implementation of AppImage tools
MIT License
818 stars 71 forks source link

How to launch without FUSERMOUNT_PROG variable? #281

Open spvkgn opened 7 months ago

spvkgn commented 7 months ago

On Ubuntu 22.04 I can't launch it until set FUSERMOUNT_PROG

$ wget -qO appimagetool https://github.com/probonopd/go-appimage/releases/download/continuous/appimagetool-828-x86_64.AppImage

$ chmod +x appimagetool

$ ./appimagetool -h
fuse: failed to exec fusermount: Permission denied

Cannot mount AppImage, please check your FUSE setup.
You might still be able to extract the contents of this AppImage 
if you run it with the --appimage-extract option. 
See https://github.com/AppImage/AppImageKit/wiki/FUSE 
for more information
open dir error: No such file or directory

$ FUSERMOUNT_PROG=`which fusermount` ./appimagetool -v
appimagetool version 182
spvkgn commented 7 months ago

strace.txt

probonopd commented 7 months ago
3264039 open("/usr/bin/fusermount3", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
3264039 open("/usr/bin/fusermount", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)

What does which fusermount and which fusermount3 say on your system?

spvkgn commented 7 months ago

What does which fusermount and which fusermount3 say on your system?

 ~ $ which fusermount
/bin/fusermount
 ~ $ which fusermount3
/bin/fusermount3
~ $ dpkg -L fuse3 | grep '/bin/fusermount'
/bin/fusermount3
/bin/fusermount
probonopd commented 7 months ago

Looks like we would have to search for it in all directories on the $PATH since you never can now where the various distributions put it...

probonopd commented 6 months ago

Essentially we need to reinstate findBinaryOnPath from https://github.com/AppImage/type2-runtime/pull/11/commits/f0e35b014bea9f7d704f7ac1977be90487cac595.

We cannot rely on the compile-time FUSERMOUNT_DIR at build time but have to look at the $PATH on the target system at runtime.

References: