AppImageCrafters / appimage-builder

GNU/Linux packaging solution using the AppImage format
MIT License
298 stars 55 forks source link

fakeroot: preload library `libfakeroot-sysv.so' not found, aborting. #309

Closed solsticedhiver closed 1 year ago

solsticedhiver commented 1 year ago

I am trying to use a custom AppImageBuilder.yml (taken from https://appimage-builder.readthedocs.io/en/latest/examples/flutter.html and modified to run with pacman):

# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
script:
 - rm -rf AppDir || true
 - cp -r build/linux/x64/release/bundle AppDir
 - mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
 - cp flutter-mark-square-64.png AppDir/usr/share/icons/hicolor/64x64/apps/
AppDir:
  path: ./AppDir
  app_info:
    id: org.appimagecrafters.flarte
    name: Flarte
    icon: flutter-mark-square-64
    version: latest
    exec: flarte
    exec_args: $@
  pacman:
    Architecture: x86_64
    repositories:
      core:
        - http://ymir:9129/repo/archlinux_x86_64/$repo/os/$arch
    include:
      - bash
    exclude:
      - perl
    options:
      # don't check package signatures
      SigLevel: "Optional TrustAll"
  files:
    exclude:
    - usr/share/man
    - usr/share/doc/*/README.*
    - usr/share/doc/*/changelog.*
    - usr/share/doc/*/NEWS.*
    - usr/share/doc/*/TODO.*
  test:
    fedora:
      image: appimagecrafters/tests-env:fedora-30
      command: ./AppRun
      use_host_x: true
    debian:
      image: appimagecrafters/tests-env:debian-stable
      command: ./AppRun
      use_host_x: true
    arch:
      image: appimagecrafters/tests-env:archlinux-latest
      command: ./AppRun
      use_host_x: true
    centos:
      image: appimagecrafters/tests-env:centos-7
      command: ./AppRun
      use_host_x: true
    ubuntu:
      image: appimagecrafters/tests-env:ubuntu-xenial
      command: ./AppRun
      use_host_x: true
AppImage:
  arch: x86_64
  update-information: guess
  sign-key: None

and this throws this error:

fakeroot: preload library `libfakeroot-sysv.so' not found, aborting.

the complete log of the run of appimage-builder:

$ appimage-builder 
INFO:main:Running main script
rm -rf AppDir || true
cp -r build/linux/x64/release/bundle AppDir
mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/
cp flutter-mark-square-64.png AppDir/usr/share/icons/hicolor/64x64/apps/
INFO:main:Running pacman deploy
WARNING:pacman:Setting option: SigLevel = Optional TrustAll
INFO:pacman:Using system keyrings
OK Pleased to meet you
fakeroot: preload library `libfakeroot-sysv.so' not found, aborting.
ERROR:root:"['/tmp/.mount_appimauK3bdd/usr/bin/fakeroot', '/usr/bin/pacman-key', '--config', '/tmp/appimage-build/pacman/pacman.conf', '--init']" execution failed
Traceback (most recent call last):
  File "/tmp/.mount_appimauK3bdd/usr/bin/appimage-builder", line 8, in <module>
    sys.exit(__main__())
  File "/tmp/.mount_appimauK3bdd/usr/lib/python3.8/site-packages/appimagebuilder/__main__.py", line 50, in __main__
    invoker.execute(commands)
  File "/tmp/.mount_appimauK3bdd/usr/lib/python3.8/site-packages/appimagebuilder/invoker.py", line 29, in execute
    command()
  File "/tmp/.mount_appimauK3bdd/usr/lib/python3.8/site-packages/appimagebuilder/commands/pacman_deploy.py", line 42, in __call__
    venv = Venv(
  File "/tmp/.mount_appimauK3bdd/usr/lib/python3.8/site-packages/appimagebuilder/modules/deploy/pacman/venv.py", line 60, in __init__
    self._configure_keyring()
  File "/tmp/.mount_appimauK3bdd/usr/lib/python3.8/site-packages/appimagebuilder/modules/deploy/pacman/venv.py", line 183, in _configure_keyring
    self._run_command("{fakeroot} {pacman-key} --config {config} --init")
  File "/tmp/.mount_appimauK3bdd/usr/lib/python3.8/site-packages/appimagebuilder/modules/deploy/pacman/venv.py", line 234, in _run_command
    shell.assert_successful_result(_proc)
  File "/tmp/.mount_appimauK3bdd/usr/lib/python3.8/site-packages/appimagebuilder/utils/shell.py", line 35, in assert_successful_result
    raise RuntimeError(
RuntimeError: "['/tmp/.mount_appimauK3bdd/usr/bin/fakeroot', '/usr/bin/pacman-key', '--config', '/tmp/appimage-build/pacman/pacman.conf', '--init']" execution failed with code 1

on archlinux with appimage-builder: 1.1.1.dev32+g2709a3b using the AppImage version installed in /opt via appimage-builder-bin pacakge

solsticedhiver commented 1 year ago

Works better by using the python version installed via pip in a virtualenv. Ends up in another (unrelated error)

FileExistsError: [Errno 17] File exists: 'usr/lib' -> '/tmp/AppDir/lib'
skcin commented 1 year ago

I ran into the same issue with the AUR appimage-builder-bin package. Using the appimage-builder installed via pip works just fine with my python project. So this might be a packaging issue.

The AUR package is based on the AppImage-file provided here. It tries to load libraries named in the Debian way. So if you create the corresponding links some errors go away. But it still does not work properly, as it requires root access.

cd /usr/lib/libfakeroot
sudo ln -s libfakeroot-0.so libfakeroot-sysv.so

cd /usr/bin
sudo ln -s faked faked-sysv
sudo ln -s fakeroot fakeroot-sysv
azubieta commented 1 year ago

@skcin it's a packaging issue, the fakeroot in the bundle is not compatible with the libfakeroot on the system. If I bundle that lib too it doesn't work either (or at least I wasn't able to make it work).

Luciogi commented 1 year ago

I proposed solution to package maintainer, lets wait until he accepts

Luciogi commented 1 year ago

@solsticedhiver this issue can be closed safely

cabiste-dev commented 9 months ago

I ran into the same issue with the AUR appimage-builder-bin package. Using the appimage-builder installed via pip works just fine with my python project. So this might be a packaging issue.

The AUR package is based on the AppImage-file provided here. It tries to load libraries named in the Debian way. So if you create the corresponding links some errors go away. But it still does not work properly, as it requires root access.

cd /usr/lib/libfakeroot
sudo ln -s libfakeroot-0.so libfakeroot-sysv.so

cd /usr/bin
sudo ln -s faked faked-sysv
sudo ln -s fakeroot fakeroot-sysv

I tried this and it sort of works but now i get another error

==> Updating trust database...
gpg: no need for a trustdb check
gpg: starting migration from earlier GnuPG versions
gpg: can't connect to the agent: File name too long
gpg: error: GnuPG agent unusable. Please check that a GnuPG agent can be started.
gpg: migration aborted
==> ERROR: There is no secret key available to sign with.

I tried running pacman-key --init on my system but it didn't work and i tried adding it as a script in the top of the file and it also didn't work

script:
  - pacman-key --init

does this tool just doesn't work on Arch?