AppImageCrafters / appimage-builder

GNU/Linux packaging solution using the AppImage format
MIT License
316 stars 58 forks source link

Could not find 'mksquashfs' on $PATH. #271

Open Evelios opened 2 years ago

Evelios commented 2 years ago

I am getting the following error

  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/utils/shell.py", line 23, in require_executable
    raise CommandNotFoundError("Could not find '{exe}' on $PATH.".format(exe=tool))
appimagebuilder.utils.shell.CommandNotFoundError: Could not find 'mksquashfs' on $PATH.

I have tried several variations within the AppImageBuilder.yml file and some in the github actions file to get mksquashfs available. I tried adding the squashfs-tools in both the AppImageBuilder.yml and the workflow file and neither seem to give the program access to the executable. The program to the best of my knowledge will be installed into /usr/bin/mksquasfs and adding that directory to the path just to make sure doesn't solve the problem either.

I am not finding any issues that relate well to my problem but it seems no mater what I try, app-image builder isn't able to pick up the program to package the app-image. I wasn't sure if this was a bionic/jammy issue either, and trying both of those for sources didn't change the issue.

My workflow is pretty simple, and I only left out some lines for brevity

.github/workflows/publish.yml

      - name: Build AppImage
        uses: AppImageCrafters/build-appimage-action@master
        with:
          recipe: AppImageBuilder.yml

AppImageBuilder.yml

version: 1

script:
  # Remove any previous build
  - rm -rf AppDir | true

  # Build directory structure
  - >
    mkdir -p 
    AppDir/usr/bin
    AppDir/usr/lib
    AppDir/usr/lib64
    AppDir/usr/local/share/bloom 
    AppDir/usr/sbin
    AppDir/usr/share/applications
    AppDir/usr/share/icons 
    AppDir/usr/share/metainfo 
    AppDir/usr/share/pixmaps

  # Copy application files over to the AppDir directory
  - cp -r publish/* AppDir/usr/local/share/bloom
  - ln AppDir/usr/local/share/bloom/Gui AppDir/usr/bin/bloom
  - cp publish/Geil-64.svg AppDir/usr/share/pixmaps/Geil-64.svg
  - cp publish/icon* AppDir/usr/share/icons/

AppDir:
  path: ./AppDir
  app_info:
    id: org.geil.bloom
    name: Bloom
    icon: icon.png
    version: latest
    exec: usr/bin/bloom
    exec_args: $@

  apt:
    arch: [ amd64 ]
    sources:
      - sourceline: 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted'
        key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xf6ecb3762474eda9d21b7022871920d1991bc93c'

    include: []
    exclude: []

  runtime:
    arch: [ x86_64 ]

  files:
    include: [ ]
    exclude: [ ]

AppImage:
  arch: x86_64
  update-information: gh-releases-zsync|Geil-X|bloom-gui|latest|Bloom*x86_64.AppImage.zsync
  sign-key: None

Trace log from github actions

INFO:main:Running AppImage creation
INFO:root:Downloading: https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-x86_64
Traceback (most recent call last):
  File "/usr/local/bin/appimage-builder", line 8, in <module>
    sys.exit(__main__())
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/__main__.py", line 50, in __main__
    invoker.execute(commands)
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/invoker.py", line 29, in execute
    command()
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/commands/create_appimage.py", line 27, in __call__
    self.primer.prime()
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/modules/prime/appimage_primer.py", line 46, in prime
    payload_path = self._make_squashfs(self.context.app_dir)
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/modules/prime/appimage_primer.py", line 77, in _make_squashfs
    mksquashfs_bin = shell.require_executable("mksquashfs")
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/utils/shell.py", line 23, in require_executable
    raise CommandNotFoundError("Could not find '{exe}' on $PATH.".format(exe=tool))
appimagebuilder.utils.shell.CommandNotFoundError: Could not find 'mksquashfs' on $PATH.
aurelienpierre commented 1 year ago

Same error here, on Github actions with ubuntu-22.04. I tried to install squashfs-tools and libfuse2 on the instances, but it doesn't help.

aurelienpierre commented 1 year ago

I ended up forking https://github.com/AppImageCrafters/appimage-demo-qt5 to https://github.com/aurelienpierre/appimage-demo-qt5 to see if it was an error on my side. It fails just the same on Ubuntu 20.04 : https://github.com/aurelienpierre/appimage-demo-qt5/actions/runs/3713713274/jobs/6296694776

INFO:main:Running AppImage creation
INFO:root:Downloading: https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-x86_64
Traceback (most recent call last):
  File "/usr/local/bin/appimage-builder", line 8, in <module>
    sys.exit(__main__())
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/__main__.py", line 50, in __main__
    invoker.execute(commands)
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/invoker.py", line 29, in execute
    command()
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/commands/create_appimage.py", line 27, in __call__
    self.primer.prime()
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/modules/prime/appimage_primer.py", line 46, in prime
    payload_path = self._make_squashfs(self.context.app_dir)
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/modules/prime/appimage_primer.py", line 77, in _make_squashfs
    mksquashfs_bin = shell.require_executable("mksquashfs")
  File "/usr/local/lib/python3.8/dist-packages/appimagebuilder/utils/shell.py", line 23, in require_executable
    raise CommandNotFoundError("Could not find '{exe}' on $PATH.".format(exe=tool))
appimagebuilder.utils.shell.CommandNotFoundError: Could not find 'mksquashfs' on $PATH.
fang64 commented 1 year ago

This apparently has left quite a few builds broken, I wonder how it's searching the PATH variable or maybe it's expecting it to be explicitly defined? I assume it'd be using the distros default.

yurijmikhalevich commented 1 year ago

Any update on this one?

yurijmikhalevich commented 1 year ago

@fang64, @aurelienpierre, @Evelios, there is a bug in the appimage-builder docker image, the mksquashfs is missing from it. The workaround is to install squashfs-tools into this image. You can do this in the GHA by adding apt install squashfs-tools as the first line of your AppImage builder script:

script:
  # Ensure that the mksquashfs tool is installed (workaround for the AppImageCrafters/build-appimage GHA)
  - which mksquashfs || apt install squashfs-tools

The full appimage-builder.yml with the fix applied: https://github.com/yurijmikhalevich/rclip/blob/0ded434ee826dae2823a897813a21d8012d7ed9b/appimage-builder.yml#L3-L4

which mksquashfs || makes it execute apt install squashfs-tools only if mksquashfs is missing.