TheAssassin / AppImageLauncher

Helper application for Linux distributions serving as a kind of "entry point" for running and integrating AppImages
https://assassinate-you.net/tags/appimagelauncher/
MIT License
5.59k stars 264 forks source link

AppImageLauncher no longer builds on Arch Linux #574

Open FabioLolix opened 1 year ago

FabioLolix commented 1 year ago

Pre-submit checks

Describe the bug

Hello, AUR appimagelauncher-git pkgbuild maintainer here, the program no longer build from the latest commit This is using system's libappimage at v1.0.4.5, I've started to work on a pkgbuild that bundle libappimage but it have other issues

btw the cpr fork as submodule used is 4+ years and 902 commits behind upstream https://github.com/AppImageCommunity/cpr

[ 34%] Automatic MOC and UIC for target translationmanager
patching ELF file 'libbinfmt-bypass-preload.so'
clearing symbol version for dlsym
writing libbinfmt-bypass-preload.so
patching ELF file 'libbinfmt-bypass-preload_32bit.so'
clearing symbol version for dlsym
writing libbinfmt-bypass-preload_32bit.so
[ 34%] Built target translationmanager_autogen
Error: found symbol version markers newer than 2.4:
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 w __cxa_finalize@GLIBC_2.2.5
                 U __errno_location@GLIBC_2.2.5
                 w __gmon_start__
                 U __stack_chk_fail@GLIBC_2.4
                 U __vfprintf_chk@GLIBC_2.3.4
                 U calloc@GLIBC_2.2.5
                 U dlsym
                 U exit@GLIBC_2.2.5
                 U free@GLIBC_2.2.5
                 U getenv@GLIBC_2.2.5
                 U malloc@GLIBC_2.2.5
                 U memcpy@GLIBC_2.14
                 U stderr@GLIBC_2.2.5
                 U strdup@GLIBC_2.2.5
                 U strerror@GLIBC_2.2.5
                 U strlen@GLIBC_2.2.5
                 U strncmp@GLIBC_2.2.5
                 U strncpy@GLIBC_2.2.5
                 U unsetenv@GLIBC_2.2.5
make[2]: *** [src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/build.make:114: src/binfmt-bypass/libbinfmt-bypass-preload.so] Error 1
make[2]: *** Deleting file 'src/binfmt-bypass/libbinfmt-bypass-preload.so'
make[1]: *** [CMakeFiles/Makefile2:1850: src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 36%] Linking C static library libzsync.a
[ 36%] Built target binfmt-bypass-preload_32bit
[ 37%] Linking CXX static library hashlib.a

and

[ 37%] Linking CXX static library ../../../../../../libcpr.a
[ 37%] Built target cpr
make: *** [Makefile:156: all] Error 2
==> ERROR: A failure occurred in build().

build() function log appimagelauncher-git-r1251.71e8e32-1-x86_64-build.log

Expected behavior

Package build fine

Steps to reproduce the issue

sudo pacman -S --needed git base-devel git clone https://aur.archlinux.org/appimagelauncher-git.git cd appimagelauncher-git makepkg -s

Screenshots

No response

Distribution and desktop environment

Arch Linux Cinnamon 5.8.1 Kernel 6.1.33 GCC 13.1.1 Glibc 2.37 Qt5 5.15.9+kde+r155

Installed AppImageLauncher version

N/A

List of AppImages you tried

No response

Additional context

No response

TheAssassin commented 1 year ago

Feel free to use upstream CPR.

MaheshNat commented 1 year ago

+1

legremz commented 1 year ago

Hi, i have a similar problem. I'm on Arch too using AUR.

[ 76%] Linking CXX shared library libbinfmt-bypass-preload.so
patching ELF file 'libbinfmt-bypass-preload.so'
clearing symbol version for dlsym
writing libbinfmt-bypass-preload.so
Error: found symbol version markers newer than 2.4:
                 U calloc@GLIBC_2.2.5
                 w __cxa_finalize@GLIBC_2.2.5
                 U dlsym
                 U __errno_location@GLIBC_2.2.5
                 U exit@GLIBC_2.2.5
                 U free@GLIBC_2.2.5
                 U getenv@GLIBC_2.2.5
                 w __gmon_start__
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
                 U malloc@GLIBC_2.2.5
                 U memcpy@GLIBC_2.14
                 U __stack_chk_fail@GLIBC_2.4
                 U stderr@GLIBC_2.2.5
                 U strdup@GLIBC_2.2.5
                 U strerror@GLIBC_2.2.5
                 U strlen@GLIBC_2.2.5
                 U strncmp@GLIBC_2.2.5
                 U strncpy@GLIBC_2.2.5
                 U unsetenv@GLIBC_2.2.5
                 U __vfprintf_chk@GLIBC_2.3.4
make[2]: *** [src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/build.make:114: src/binfmt-bypass/libbinfmt-bypass-preload.so] Error 1
make[2]: *** Deleting file 'src/binfmt-bypass/libbinfmt-bypass-preload.so'
make[1]: *** [CMakeFiles/Makefile2:1850: src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
:: Unable to build appimagelauncher-git - makepkg exited with code: 4

Arch Linux x86_64 Kernel 6.3.8-arch1-1 GNOME 44.2 gcc version 13.1.1 20230429

TheGamerCanine commented 1 year ago

I can vouch that I'm running into the same issue with a nearly identical error.

[ 76%] Linking CXX shared library libbinfmt-bypass-preload.so
/home/gamerdog/.cache/yay/appimagelauncher-git/src/AppImageLauncher/src/binfmt-bypass/fix-preload-library.sh: line 26: patchelf: command not found
make[2]: *** [src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/build.make:114: src/binfmt-bypass/libbinfmt-bypass-preload.so] Error 127
make[2]: *** Deleting file 'src/binfmt-bypass/libbinfmt-bypass-preload.so'
make[1]: *** [CMakeFiles/Makefile2:1850: src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
 -> error making: appimagelauncher-git-exit status 4
checking dependencies...

Packages (8) jsoncpp-1.9.5-2  rhash-1.4.3-1  vim-runtime-9.0.1676-1
             boost-1.81.0-7  chrpath-0.16-4  cmake-3.26.4-1  gvim-9.0.1676-1
             qt5-tools-5.15.10+kde+r3-1

Total Removed Size:  298.10 MiB

:: Do you want to remove these packages? [Y/n] 
:: Processing package changes...
(1/8) removing cmake                               [######################] 100%
(2/8) removing rhash                               [######################] 100%
(3/8) removing jsoncpp                             [######################] 100%
(4/8) removing gvim                                [######################] 100%
(5/8) removing vim-runtime                         [######################] 100%
(6/8) removing chrpath                             [######################] 100%
(7/8) removing qt5-tools                           [######################] 100%
(8/8) removing boost                               [######################] 100%
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Updating the MIME type database...
(3/4) Updating icon theme caches...
(4/4) Updating the desktop file MIME type cache...
 -> Failed to install the following packages. Manual intervention is required:
appimagelauncher-git - exit status 4
Arch Linux x86_64
Kernel 6.4.2-arch1-1
GNOME 44.3
TheGamerCanine commented 1 year ago

I should mention that this problem went away by downloading appimagelauncher by itself from the AUR instead of the appimagelauncher-git package, seems to fix the problem entirely.

lvisb commented 1 year ago

+1

FabioLolix commented 1 year ago

I should mention that this problem went away by downloading appimagelauncher by itself from the AUR instead of the appimagelauncher-git package, seems to fix the problem entirely.

@TheGamerCanine that is an older version, I try VCS build to catch this kind of problems before the next release come out


Feel free to use upstream CPR.

Trying v1.10.5 fail with

-- CXX standard of parent project: 11
CMake Error at lib/AppImageUpdate/lib/zsync2/lib/cpr/CMakeLists.txt:27 (message):
  cpr 1.10.5 does not support 11.  Please use cpr <= 1.9.x

-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().

Trying v1.9.7 fail with

-- Configuring done (30.9s)
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
  "translationmanager" of type SHARED_LIBRARY
    depends on "shared" (weak)
    depends on "trashbin" (weak)
    depends on "translationmanager_autogen" (strong)
  "translationmanager_autogen" of type UTILITY
    depends on "shared" (strong)
  "trashbin" of type STATIC_LIBRARY
    depends on "shared" (weak)
    depends on "translationmanager" (weak)
  "shared" of type STATIC_LIBRARY
    depends on "translationmanager" (weak)
    depends on "trashbin" (weak)
    depends on "shared_autogen" (strong)
  "shared_autogen" of type UTILITY
    depends on "translationmanager" (strong)
At least one of these targets is not a STATIC_LIBRARY.  Cyclic dependencies are allowed only among static libraries.
CMake Generate step failed.  Build files cannot be regenerated correctly.
==> ERROR: A failure occurred in build().
ThatOneCalculator commented 10 months ago

Interestingly, I was able to get it to work with the appimagelauncher AUR package v2.2.0-6

4amMusic commented 9 months ago

Interestingly, I was able to get it to work with the appimagelauncher AUR package v2.2.0-6

Thanks. That version worked

vivekpal1 commented 3 months ago

I was also getting same issue also tried changing versions

:: Processing package changes...
(1/4) removing squashfuse                                  [################################] 100%
(2/4) removing cmake                                       [################################] 100%
(3/4) removing rhash                                       [################################] 100%
(4/4) removing cppdap                                      [################################] 100%
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Updating the MIME type database...
(3/4) Updating icon theme caches...
(4/4) Updating the desktop file MIME type cache...
 -> Failed to install the following packages. Manual intervention is required:
appimage-git - exit status 4
trinitronx commented 1 month ago

Cross-posting here for visibility to those affected who are not checking the AUR package comments:

I managed to make a patch, add a few makedepends, and disable some compiler warnings to workaround the FTBFS issues with current appimagelauncher-git AUR package + submodules. Pushed the PKGBUILD changes up on my fork here.

Note that it's not intended that this bandaid-patch workaround be used in any production-grade capacity, but if anyone needs to get latest sources for appimagelauncher to build for some reason, maybe this helps?[^1]

EDIT: Adding these custom-built packages here

Note: These were built on a system running Manjaro unstable branch, which is roughly equivalent to vanilla Arch Linux.

[^1]: Disclaimer: These packages are provided as is, your mileage may vary, to set expectations same as the MIT license does here. [^2]: Signed by my GPG key

FabioLolix commented 1 month ago

Hi @trinitronx you're welcome to make a PR here https://github.com/FabioLolix/PKGBUILD-AUR_fix/tree/master/a/appimagelauncher-git for the pkgbuild

trinitronx commented 1 month ago

@FabioLolix Thanks! I've pushed up FabioLolix/PKGBUILD-AUR_fix#45 for the zsync2-git package build errors.

It looks like most of the changes including makedepends and CFLAGS were already applied to this version. However, now I'm able to reproduce the error mentioned above. :thinking:

Expand for error details

```console patching ELF file 'libbinfmt-bypass-preload.so' clearing symbol version for dlsym writing libbinfmt-bypass-preload.so [ 23%] Building C object lib/AppImageUpdate/lib/zsync2/lib/zlib/CMakeFiles/zsync2_libz.dir/trees.c.o [ 23%] Linking CXX shared library libbinfmt-bypass-preload_32bit.so [ 24%] Building CXX object lib/AppImageUpdate/lib/zsync2/lib/cpr/cpr/CMakeFiles/cpr.dir/payload.cpp.o [ 24%] Building C object lib/AppImageUpdate/lib/zsync2/lib/zlib/CMakeFiles/zsync2_libz.dir/gzio.c.o Error: found symbol version markers newer than 2.4: U calloc@GLIBC_2.2.5 w __cxa_finalize@GLIBC_2.2.5 U dlsym U __errno_location@GLIBC_2.2.5 U exit@GLIBC_2.2.5 U free@GLIBC_2.2.5 U getenv@GLIBC_2.2.5 w __gmon_start__ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable U malloc@GLIBC_2.2.5 U memcpy@GLIBC_2.14 U __stack_chk_fail@GLIBC_2.4 U stderr@GLIBC_2.2.5 U strdup@GLIBC_2.2.5 U strerror@GLIBC_2.2.5 U strlen@GLIBC_2.2.5 U strncmp@GLIBC_2.2.5 U strncpy@GLIBC_2.2.5 U unsetenv@GLIBC_2.2.5 U vfprintf@GLIBC_2.2.5 make[2]: *** [src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/build.make:121: src/binfmt-bypass/libbinfmt-bypass-preload.so] Error 1 make[2]: *** Deleting file 'src/binfmt-bypass/libbinfmt-bypass-preload.so' make[1]: *** [CMakeFiles/Makefile2:2194: src/binfmt-bypass/CMakeFiles/binfmt-bypass-preload.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... ```

I notice that the current PKGBUILD @ 4cb4a04 up on the AUR has some slight differences to this version in the PKGBUILD-AUR_fix repo. It includes the changes here, as well as some of those I needed to fix based on the AUR one, plus extra CFLAGS and new dependency on appimageupdate-git also. That pulls in the zsync2-git and some other library packages. I had to patch the zsync2-git PKGBUILD with CFLAGS to ignore the compiler errors (FabioLolix/PKGBUILD-AUR_fix#45). Then, I tried to rebuild after getting dependencies installed and was able to reproduce the error mentioned above. Here's the diff between those two PKGBUILDs, taken from a point on master for both repos without my changes applied:

Expand for diff

`$ diff -Naur ~/src/pub/pkgbuild/appimagelauncherd-fixes/appimagelauncher-git/PKGBUILD ~/src/pub/pkgbuild/appimagelauncherd-fixes/PKGBUILD-AUR_fix/a/appimagelauncher-git/PKGBUILD`: ```diff --- /home/exampleusr/src/pub/pkgbuild/appimagelauncherd-fixes/appimagelauncher-git/PKGBUILD 2024-09-15 05:59:37.585801810 -0600 +++ /home/exampleusr/src/pub/pkgbuild/appimagelauncherd-fixes/PKGBUILD-AUR_fix/a/appimagelauncher-git/PKGBUILD 2024-09-15 06:00:58.854605927 -0600 @@ -3,21 +3,21 @@ # Contributor: TheAssassin pkgname=appimagelauncher-git -pkgver=r1251.71e8e32 +pkgver=r1257.0013516 pkgrel=1 pkgdesc="A Helper application for running and integrating AppImages." arch=(x86_64) url="https://assassinate-you.net/tags/appimagelauncher/" license=(MIT) depends=(qt5-base fuse2 squashfuse libappimage libxpm) -makedepends=(git cmake boost qt5-tools qt5-declarative lib32-glibc lib32-gcc-libs xxd chrpath) +makedepends=(git cmake boost qt5-tools qt5-declarative lib32-glibc lib32-gcc-libs xxd chrpath patchelf appimageupdate-git) provides=(appimagelauncher) conflicts=(appimagelauncher) source=("git+https://github.com/TheAssassin/AppImageLauncher.git" "git+https://github.com/AppImageCommunity/AppImageUpdate.git" - #"git+https://github.com/AppImageCommunity/libappimage.git" - "git+https://github.com/TheAssassin/zsync2.git" - "git+https://github.com/TheAssassin/fltk-1.3.4.git" + #"git+https://github.com/AppImage/libappimage.git" + "git+https://github.com/AppImageCommunity/zsync2.git" + "git+https://github.com/AppImageCommunity/fltk-1.3.4.git" "git+https://github.com/TheAssassin/libdesktopenvironments.git" "git+https://github.com/arsenm/sanitizers-cmake.git" "git+https://github.com/google/googletest.git" @@ -41,6 +41,8 @@ #git describe --long --tags --exclude continuous | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' } +CFLAGS="$CFLAGS -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-implicit-function-declaration -Wno-incompatible-pointer-types" + prepare() { cd AppImageLauncher @@ -74,12 +76,16 @@ build() { cd AppImageLauncher - cmake . -Wno-dev \ + cmake . \ + -Wno-dev \ -DCMAKE_INSTALL_PREFIX=/usr/ \ -DUSE_SYSTEM_LIBAPPIMAGE=ON \ -DBUILD_TESTING=OFF + make libappimageupdate libappimageupdate-qt + cmake . + make } @@ -95,3 +101,7 @@ #chrpath --delete "${pkgdir}/usr/bin/ail-cli" #chrpath --delete "${pkgdir}/usr/bin/appimagelauncherd" } + +# USE_SYSTEM_GTEST=ON don't have effect on zsync2 submodule + +# problems with system's libappimageupdate (not recognized) ```

For some reason, I'm able to build the AUR version with my changes on top, but not this one. :shrug:

FabioLolix commented 1 month ago

I notice that the current [PKGBUILD @ 4cb4a04][2] up on the AUR has some slight differences to this version in the PKGBUILD-AUR_fix repo

AUR pkgbuild was slightly outdated because I develop the pkgbuilds on github and then sync them, make some tests there etc.., and IMO there isn't much hurry to push changes if the program is broken

Cleaned up some things, so the program build fine with devtools (See https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot#Convenience_way)

Still have the error reported in the first post when building with makepkg don't know what is causing that

trinitronx commented 1 month ago

AUR pkgbuild was slightly outdated because I develop the pkgbuilds on github and then sync them, make some tests there etc.., and IMO there isn't much hurry to push changes if the program is broken

Makes sense :+1:, it seems that even old builds of this package (at least on Arch-based distros) has been broken for at least 2 years and is causing a lot of coredumps + disk space usage buildup due to SystemD restarting it.

Still have the error reported in the first post when building with makepkg don't know what is causing that

I think that I just found what the source of the error is. It's due to the changes in c810e707, which seems to be to "improve compatibility" for old CentOS <= 7 docker containers.

Specifically, it's from lines 31-33 which output the message: Error: found symbol version markers newer than 2.4 (set by glibc_ok_version), and exit with error status: exit 1. That causes the build to fail after that step.

Edit: The function find_too_new_symbols checks for the newest glibc symbols, and compares them to glibc_ok_version. If it finds any newer than that, then the script exits with nonzero status, failing the build. Details below:

Expand for shell script trace of function: find_too_new_symbols

```bash + find_too_new_symbols libbinfmt-bypass-preload.so + glibc_symbols=("$(nm --dynamic --undefined-only --with-symbol-versions "$1" | grep "GLIBC_")") ++ grep GLIBC_ ++ nm --dynamic --undefined-only --with-symbol-versions libbinfmt-bypass-preload.so + for glibc_symbol in "${glibc_symbols[@]}" ++ sed 's|.*GLIBC_\([\.0-9]\+\)$|\1|' + glibc_symbol_version='2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.14 2.4 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5' ++ echo -e '2.4\n2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.14 2.4 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5 2.2.5' ++ sort -V ++ tail -n1 + newest_glibc_symbol_version=2.14 + [[ 2.14 == \2\.\4 ]] + return 0 + echo 'Error: found symbol version markers newer than 2.4:' Error: found symbol version markers newer than 2.4: + echo ' U calloc@GLIBC_2.2.5 w __cxa_finalize@GLIBC_2.2.5 U dlsym U __errno_location@GLIBC_2.2.5 U exit@GLIBC_2.2.5 U free@GLIBC_2.2.5 U getenv@GLIBC_2.2.5 w __gmon_start__ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable U malloc@GLIBC_2.2.5 U memcpy@GLIBC_2.14 U __stack_chk_fail@GLIBC_2.4 U stderr@GLIBC_2.2.5 U strdup@GLIBC_2.2.5 U strerror@GLIBC_2.2.5 U strlen@GLIBC_2.2.5 U strncmp@GLIBC_2.2.5 U strncpy@GLIBC_2.2.5 U unsetenv@GLIBC_2.2.5 U vfprintf@GLIBC_2.2.5' U calloc@GLIBC_2.2.5 w __cxa_finalize@GLIBC_2.2.5 U dlsym U __errno_location@GLIBC_2.2.5 U exit@GLIBC_2.2.5 U free@GLIBC_2.2.5 U getenv@GLIBC_2.2.5 w __gmon_start__ w _ITM_deregisterTMCloneTable w _ITM_registerTMCloneTable U malloc@GLIBC_2.2.5 U memcpy@GLIBC_2.14 U __stack_chk_fail@GLIBC_2.4 U stderr@GLIBC_2.2.5 U strdup@GLIBC_2.2.5 U strerror@GLIBC_2.2.5 U strlen@GLIBC_2.2.5 U strncmp@GLIBC_2.2.5 U strncpy@GLIBC_2.2.5 U unsetenv@GLIBC_2.2.5 U vfprintf@GLIBC_2.2.5 + exit 1 ```

I just tested commenting out some lines in CMakeLists.txt that runs that script:

Expand for diff

```diff diff --git a/src/binfmt-bypass/CMakeLists.txt b/src/binfmt-bypass/CMakeLists.txt index 87773fd..e443863 100644 --- a/src/binfmt-bypass/CMakeLists.txt +++ b/src/binfmt-bypass/CMakeLists.txt @@ -58,13 +58,13 @@ function(make_preload_lib_target target_name) ) # a bit of a hack, but it seems to make binfmt bypass work in really old Docker images (e.g., CentOS <= 7) - add_custom_command( - TARGET ${target_name} - POST_BUILD - COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/fix-preload-library.sh $ - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - VERBATIM - ) +# add_custom_command( +# TARGET ${target_name} +# POST_BUILD +# COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/fix-preload-library.sh $ +# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +# VERBATIM +# ) endfunction() make_preload_lib_target(${preload_lib}) ```

Then, the makepkg succeeded! So, we have a way to fix or work around it now... but maybe at the expense of whatever the issue was with CentOS 7 and prior (now discontinued & EoL, thanks to RedHat's recent decisions).

I'm not sure how comfortable I am with using elfpatch during a build, especially with hardcoded version numbers involved... seems fragile. 🤔 There is also this comment... :shrug:

# a bit of a hack, but it seems to make binfmt bypass work in really old Docker 

Maybe @TheAssassin knows more about the context and rationale for doing this? :shrug:

trinitronx commented 1 month ago

@FabioLolix: Until we hear back, I've prepped a PR #662 which reverts those changes and fixes the FTBFS issue. If this merges, we may be able to drop patchelf from the makedepends too.