electron-userland / electron-builder-binaries

172 stars 60 forks source link

cache/electron-builder/appimage/appimage-9.1.0/runtime-armv7l: no such file or directory #20

Closed dj-at-work closed 5 years ago

dj-at-work commented 5 years ago

I'm building an electron on a Raspberry Pi. On my old Raspberry Pi 3 everything works fine, but now on my new Raspberry Pi 3 b+ it shows the following error:

open /home/pi/.cache/electron-builder/appimage/appimage-9.1.0/runtime-armv7l: no such file or directory

The appimage-9.1.0 directory is empty on the new Pi, while on my old Pi the directory contains the expected app images.

Shouldn't Electron Builder take care to download the images?

develar commented 5 years ago

Hmmm.... try to delete cache dir and build again. What electron-builder version do you use? If still no such file, download it from https://github.com/electron-userland/electron-builder-binaries/blob/master/AppImage/runtime-armv7l

dj-at-work commented 5 years ago

Hi @develar thank you for your prompt reply!

I'm using electron-builder version 20.36.1

I had already run into the problem "AppImage/armv7l mksquashfs? #14" before and therefore created the folder (.cache/electron-builder/appimage/appimage-9.1.0/...) manually and set a link to mksquashfs.

The existence of the folder/path seems to prevent Electron Builder from downloading the images. After I deleted the cache folder, all images were downloaded again.

However, my build aborted again with the error message:

error: fork/exec /home/pi/.cache/electron-builder/appimage/appimage-9.1.0/linux-arm/mksquashfs: no such file or directory

After I had set the link to mksquashfs again, the project could be built again completely.

All in all a somewhat unpleasant situation. It would be better if Electron Builder would check if images actually exist and download them in case of doubt.

develar commented 5 years ago
  1. Why do you need AppImage for ARM? I want to know because I work for interest.
  2. "the project could be built again completely." How could it be possible ... OUCH... OMG... we do provide for ARM — https://github.com/electron-userland/electron-builder-binaries/blob/master/AppImage/linux-arm64/mksquashfs but path is not correct.
  3. How do I can emulate your ARM arch on macOS to verify fix?
develar commented 5 years ago

armv7l it is 64bit? It seems https://github.com/electron-userland/electron-builder-binaries/tree/master/AppImage/linux-arm64 working for you or did you use another file?

develar commented 5 years ago

BTW, if your project doesn't have native node modules, you can build AppImage for arm on your dev machine.

dj-at-work commented 5 years ago

@develar

  1. Why do you need AppImage for ARM? I want to know because I work for interest.

I'm developing an app that runs on different types of systems, including Rasperry Pi, which is based on ARM.

  1. "the project could be built again completely." How could it be possible ... OUCH... OMG... we do provide for ARM — https://github.com/electron-userland/electron-builder-binaries/blob/master/AppImage/linux-arm64/mksquashfs but path is not correct.

:o)

  1. How do I can emulate your ARM arch on macOS to verify fix?

You can't without an ARM (afaik). Let me know if I can support you.

armv7l it is 64bit? It seems https://github.com/electron-userland/electron-builder-binaries/tree/master/AppImage/linux-arm64 working for you or did you use another file?

Yes and no. The ARM itself supports 64bit, but the operating system does not. Which makes sense if you consider the limited resources of a Raspberry Pi 3b+ (1 GB RAM).

BTW, if your project doesn't have native node modules, you can build AppImage for arm on your dev machine.

Thanks for the tip, but unfortunately it has... ¯\_(ツ)_/¯

develar commented 5 years ago

Is mksquashfs from arm-64 works for you or do use another file?

dj-at-work commented 5 years ago

@develar Sorry for my delayed response. Due to the operating system, I have to use the 32bit version. And I have to rebuild the latest version to run a version that offers support of the offset option (as mentioned here by @hirokiht)

    cd /usr/src
    git clone https://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools.git

    cd mksquashfs/squashfs-tools/squashfs-tools 

    sudo make install 

Afterwards I have to create the linux-arm folder and add the link to mksquashfs:

    mkdir -p  ~/.cache/electron-builder/appimage/appimage-9.1.0/linux-arm
    cd ~/.cache/electron-builder/appimage/appimage-9.1.0/linux-arm
    ln -s /usr/local/bin/mksquashfs mksquashfs  
noisymime commented 5 years ago

For anyone coming across this and trying to build squashfs-tools on a recent OS version, glibc version 2.28 moves a number of macros out of <sys/types.h> and in to <sys/sysmacros.h>. Therefore the version of squashfs-tools on git (https://git.kernel.org/pub/scm/fs/squashfs/squashfs-tools) will not compile out of the box with glibc 2.28 or above.

The fix is relatively straightforward, you simply need to add #include <sys/sysmacros.h> into the mksquashfs.c and unsquashfs.c files and the compile will work.

I've also attached a 32-bit ARM binary of mksquashfs in case it helps anyone. Even better would be if this binary can be included by default rather than only the arm64 binary being supplied. mksquashfs.zip

develar commented 5 years ago

@noisymime Thanks, I included your binary.

hesparza commented 4 years ago

Thanks, this is very useful information, worked for me.