Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having AppImage Launcher installed makes AppImages created with the Go runtime fail to start #242

Open
quyykk opened this issue Jan 22, 2023 · 10 comments

Comments

@quyykk
Copy link

quyykk commented Jan 22, 2023

AppImages created with this runtime fail to start if the AppImage Launcher is installed, which is less than ideal: endless-sky/endless-sky#7476

> chmod +x ./endless-sky-x86_64-v0.9.16.1.AppImage 
> ./endless-sky-x86_64-v0.9.16.1.AppImage 
execv error: No such file or directory

yet another log:

(process:33191): GLib-CRITICAL **: 17:39:35.719: g_file_test: assertion 'filename != NULL' failed
execv error: No such file or directory

Uninstalling the AppImage Launcher makes the AppImage runnable again. A lot of distros ship with the launcher installed by default, so this is pretty problematic.

Thanks!

@probonopd
Copy link
Owner

probonopd commented Jan 22, 2023

@TheAssassin do you have an idea why this might be? Does AppImageLauncher make any particular assumptions about the runtime? E.g., does it make the assumption that the runtime is dynamically linked?

@TheAssassin
Copy link

Most likely an issue caused by static linking. Please tell me what the actual differences are to the one appimagetool embeds.

@TheAssassin
Copy link

In any case, @quyykk please open an issue over at AppImageLauncher and link it to this one. We can always close it.

@probonopd
Copy link
Owner

probonopd commented Jan 22, 2023

The runtime used in go-appimage is statically linked and hence does not like to be invoked through ld-linux.

@TheAssassin
Copy link

I know, but is this really the only change?

@probonopd
Copy link
Owner

It also uses zstd compression and may not have all --appimage-... command line options implemented which the default runtime has.

@TheAssassin
Copy link

Please provide a link to the code and, if separate, the build infra. I'll have a look.

Short technical background: AppImageLauncher's bypass-binfmt helper needs to explain to the runtime where the AppImage really is. All "released" types (1 and 2) lack a specified way to do so. The current technique to inject those data is to LD_PRELOAD a library that hooks into a set of common glibc tools. Linking everything including libc statically prevents us from hacking the paths.
(Yes, I know that's not a great method and is prone to errors, but it's been by far the most reliable way (!) so far...)
It is all explained in detail here.
Should we make the static runtime the default in the near future (and I'd like to collaborate on that, maybe on some hackweek(end)), we should specify a better bypass way. I guess TARGET_APPIMAGE could be reactivated and later be standardized.

@probonopd
Copy link
Owner

Please provide a link to the code and, if separate, the build infra.

https://github.com/probonopd/static-tools/tree/master/src/runtime

Should we make the static runtime the default in the near future (and I'd like to collaborate on that, maybe on some hackweek(end))

Yes, let's do that!

@TheAssassin
Copy link

So the quick fix is to quit linking libc statically. You can link libraries statically by selection. I think in your Makefile case (for the record, plain Makefiles are annoying and just create additional work even when using tools like pkgconf), you'd have to pass the paths of your libraries and remove the corresponding -l<lib> parameter. It'd be easier to use pkgconf --static [...].

@quyykk
Copy link
Author

quyykk commented Jan 23, 2023

TheAssassin/AppImageLauncher#518 this issue seems to exist already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants