We switched to a manual approval system for registration on this forum, as this makes it easier to keep bots out of the forum. We'll approve everybody who doesn't look like a bot!

Build for Raspberry Pi

I just tried to build Zettlr on my Raspi 4. I have installed both node.js and yarn. If I try to run yarn install, I get this error and it quits (I have yarn installed):
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'

If I use npm, it seems to build (both in Zettlr and in source), but when I go to run make.sh, I get this:

00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'less'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'handlebars'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'reveal:build'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'wp:prod'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'lang:refresh'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'release:win'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'release:mac'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'release:linux'
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'release:app-image'

(output from the nmp install)

zettlr@1.6.0 postinstall /home/pi/Zettlr
electron-builder install-app-deps

  • electron-builder  version=22.4.1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

As a test, I did the exact same thing on my Mac--clone, go to the Zettler folder and do a "yarn install" it works, and everything works, including getting a working Mac app, packages, etc.

But on my Raspi, nothing but the above errors. Is it not possible to compile on arm7? or am I missing something?

Comments

  • So if I got you right:
    Have you changed the possible build targets in electron builder?
    They currently are defined as:

    const linuxTargets = [{ target: 'AppImage', arch: [ 'x64', 'ia32' ] }, 'deb', 'rpm' ]
    const win32Targets = [{ target: 'nsis', arch: [ 'x64', 'ia32' ] }]

    Which means you have to define an own target for your raspi build.
    target: 'appimage', arch: ['armv7l']

    You could probably try to change the value of linuxTargets in _Zettlr/scripts/build-app.js to that. I guess it's worth trying this change but it might get you some other trouble with build platforms not supported for a variety of reasons.

    Also make sure: git clone into the repo. Use npm install in both directories (Zettlr and Zettlr/source), then run the build-script. (Actually I don't remember there's any need for running make directly.) If there's some other errors, like the one you got at 00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'less' then it's probably also a good idea to build that stuff manually.

    $ yarn less # Or npm run less, this recompiles the stylesheets
    $ yarn handlebars # Or npm run handlebars, this recompiles the templates
    $ yarn wp:dev # Or npm run wp:dev, this recompiles the Vue components
    $ yarn reveal:build # Or npm run reveal:build, needs to be run once

  • Thanks for your input!

    At some point, I finally got past the earlier errors--turns out I needed to use a newer version of yarn than what the Raspi had installed by default. I got it to the point of build, and found out that arch arm is not supported. I just went and followed your directions, and still get the same result:

    CWD is: /home/pi/Zettlr Starting build process Building for: linux • electron-builder version=22.4.1 os=4.19.97-v7l+ • writing effective config file=release/builder-effective-config.yaml Build failed! Error: Unsupported arch arm

    And for the record, in make.sh, I have commented out all the other build targets (mac, win, appimage) only linux deb and rpm files.

    It seems to me that somehow, Zettlr doesn't like arm? Is that possible? Or am I missing something else.

    Here's what I did in the build-app.js script

    const linuxTargets = [{ target: 'AppImage', arch: [ 'x64', 'ia32', 'arm64' ] }, 'deb', 'rpm' ]

    I first tried with arm7l as you suggested, and got the same result.

    btw, I'm not a programmer, so don't know how to change build targets in electron builder. I just modified the build-app.js

    And once again, thanks for your help.

  • Commenting out shouldn't be necessary, and as long as electron-builder supports ARM builds, it shooooouuuuld work — maybe double check the necessary configuration for that build target!

  • I commented them out because when I built on my Mac, it built all of the various platforms. Now, it's a relatively fast and capable machine. The Pi, on the other hand... Just it case it tried to build everything, I don't want to waste my time waiting for all that. :-)

    As I said, I'm not a programmer, and electron is entirely new to me. Any guidance as to where to look and what to look for? TIA

  • edited April 18

    Egg on my face!

    I finally got smart and built on my Mac, adding the arm options to the build file, and then looked in my release folder on my Mac, and there were both unpacked files and appimage files. (the deb files refused to build for some reason)

    i copied them to my Pi, set the executable of th arm7l image and doubleclicked--and there's Zettler running on my Pi! Anybody want a copy? :-)

    Thanks for your help folks. i couldn't have done it without your help.
    proof.

  • Thank you for letting us know! Nice you got Zettlr to build for raspberry pi.

    So, what exactly was the change necessary to build it finally? I mean, you tried to build on another platform (directly on the pi itself) at first where it didn't build? And then putting the arm target into the build-app.js file on mac and building there did the job?
    Have I got this right?

  • No. I never got it to build on the Pi itself. I built on my Mac with the armv7l added to the targets in the build-app.js file on the Mac. When I did that, the deb failed to build, but I got both the unpacked app and appimage for both armv7l and arm64. I was then able to copy the files over my network to my Pi, and ended up deciding to put the unpacked files into their proper locations in the system. I may regret that, due to the fact that I will always have to update the app by building it, and an appimage is a lot easier to deal with than loose files scattered through a dozen folder. Most, of course, I can leave, but still...

    I don't know why it won't build on the Pi. I do know I can't use yarn, and have to use npm to get anywhere, but why it gives up on the build itself, I don't know. I suppose there are issues with my yarn install, but as I said, I'm not a programmer, and yarn and electron are new to me. I have built apps on GCC and such for ages, but this is my first attempt at an electron app, and I'm getting too old to learn new tricks. ;-)

  • OK, thank you for clarifying this!

    I guess I know where the issue might be. Have a look at this: https://github.com/electron/electron/issues/16205

    So electron seems to run well on Raspbian when it's already prebuilt. But I cannot be build because of an incompatible glibc I guess. So you'd probably always have to use another machine to build. Probably .deb file creation does not work on your machine because the script requires some deb-tools to create that - which likely aren't available on your macOS device?

  • Hm. I don't know about either. I will check the glibc issue, but that post is 2018. Buster is now on the Pi. It'd be weird if there wasn't a newer version of it.

    As to the Mac, I also don't know. the deb for x86 built fine, just not for the arm.

    In any case, I'm not gonna complain. I've got a working build, and, in the end, I'm fine with that. :-)

  • OK, happy when you are it! :smile:

    Nevertheless a working build for arm/raspbian that's ready for release would be very nice so I'll be checking this issue and let you know if I get anything new. Just had no time to set up my pi and check this :disappointed: but rest assured, I will do.

Sign In or Register to comment.