I've been yanking my hair out the last couple of days trying to understand why I couldn't get appimage-builder to build and run properly on a newer OS and with updated Python.
Turns out, the updates to python or whatever else don't really have anything to do with the issue, which was AppRun failing to load due to an ENOENT somewhere I couldn't quite figure out.
But, I finally did. The problem is AppRun. After much trial and error, I realized it specifically wasn't finding ld-linux-x86-64.so.2
Played with it for a pretty long while until I realized the following:
According to USAGE.md, the file layout should be something like the following:
# Compat runtime
AppDir/runtime/compat/lib64/ld-linux-x86-64.so.2
AppDir/runtime/compat/lib/x86_64-linux-gnu/libtinfo.so.6
AppDir/runtime/compat/lib/x86_64-linux-gnu/libc.so.6
AppDir/runtime/compat/lib/x86_64-linux-gnu/libdl.so.2
AppDir/runtime/compat/usr/bin/bash # links to: ../../../../usr/bin/bash
# Default runtime
AppDir/runtime/default/lib64/ld-linux-x86-64.so.2 # links to: /lib64/ld-linux-x86-64.so.2
AppDir/runtime/compat/usr/bin/bash # links to: ../../../../usr/bin/bash
Except for the fact that the AppDir is missing AppDir/runtime/compat/lib64.
Now, I don't know why it's not picking up the absolute /lib64/ld-linux-x86-64.so.2 reference report by ldd but it just isn't.
The final nail on the coffin is the following,
|
if (compare_version_strings(system_ld_version, appdir_ld_version) > 0) { |
|
runtime_path = resolve_runtime_path("runtime/default"); |
|
configure_system_libc(); |
|
} else { |
|
runtime_path = resolve_runtime_path("runtime/compat"); |
|
configure_embed_libc(); |
|
} |
Which results in AppRun selecting the compatibility runtime when both the bundle and the system have the same libc version.
There are several potential ways to fix it:
- Make sure the
compat runtime has the appropriate linker under lib64/.
- Symlink
compat/lib64 pointing to the default runtime or wherever the file is inside the compat runtime, although this would entirely defeat the purpose.
The third option (which I think is the correct one), is to not use the compat runtime if the libc version matches the system, or:
- if (compare_version_strings(system_ld_version, appdir_ld_version) > 0) {
+ if (compare_version_strings(system_ld_version, appdir_ld_version) >= 0) {
runtime_path = resolve_runtime_path("runtime/default");
configure_system_libc();
} else {
runtime_path = resolve_runtime_path("runtime/compat");
configure_embed_libc();
}
Doing that results in my copy of AppRun going for the default runtime and thus loading normally.
I've been yanking my hair out the last couple of days trying to understand why I couldn't get appimage-builder to build and run properly on a newer OS and with updated Python.
Turns out, the updates to python or whatever else don't really have anything to do with the issue, which was
AppRunfailing to load due to anENOENTsomewhere I couldn't quite figure out.But, I finally did. The problem is
AppRun. After much trial and error, I realized it specifically wasn't findingld-linux-x86-64.so.2Played with it for a pretty long while until I realized the following:
According to USAGE.md, the file layout should be something like the following:
Except for the fact that the
AppDiris missingAppDir/runtime/compat/lib64.Now, I don't know why it's not picking up the absolute
/lib64/ld-linux-x86-64.so.2reference report bylddbut it just isn't.The final nail on the coffin is the following,
AppRun/src/apprun/runtime_interpreter.c
Lines 207 to 213 in 407700c
Which results in
AppRunselecting the compatibility runtime when both the bundle and the system have the same libc version.There are several potential ways to fix it:
compatruntime has the appropriate linker underlib64/.compat/lib64pointing to the default runtime or wherever the file is inside thecompatruntime, although this would entirely defeat the purpose.The third option (which I think is the correct one), is to not use the
compatruntime if the libc version matches the system, or:Doing that results in my copy of
AppRungoing for the default runtime and thus loading normally.