Running joplin on Apple silicon

I have an Apple Transition Development Kit - a mac mini with an arm processor.

I thought I'd try the various tools I use that are open source.

I found that rebuilding Joplin for this fails, not on Joplin but in Electron. I might look at that, but I have a few dependencies that need working on.

Anyone else on this journey?

4 Likes

Hi @scrumit thanks for your journey!
I want to ask, how far have you come by now?

I've read that Electron 11.0.0 supports M1 hardware now, so does this help you with your work an native joplin support on Apple silicon?

Pretty sure there was a thread of someone who successfully compiled for raspberry pi 400, which is an arm chip. Perhaps that thread (and his build tweaks) would apply here too

1 Like

Compiling for Arm helps, but it's the dependency on Electron. I raised the issue 3859 in the Joplin github repo.

I just tried the latest build 1.5.4. and Electron still crashes:

Thread 0 Crashed:: CrRendererMain Dispatch queue: com.apple.main-thread
0 com.github.Electron.framework 0x000000010a6b790c v8::internal::SetupIsolateDelegate::SetupHeap(v8::internal::Heap*) + 1337916

Ah ok! I see your issue #3859.
What i don't understand, is it the problem with draw.io (electron) or with electron in general?

However: i really think its wonderful, that you keep working on joplin for apple silicon:)

I'm tracking a number of open source projects, because I want to use them. I think Joplin is using a binary of Electron and that might not be translated to Arm.

I haven't tried with a stand alone Electron.

Who could help with the binary translation?

Intel binary should be translated to arm code on loading. As I said I wonder if electron is somehow not being translated.

I currently build an Electron app that I ship as a universal binary for x64 and arm64 macOS builds. I see that Joplin uses Electron Builder which supports creating universal binaries if the Electron app is v11+.

Config for builder:

"mac": {
   "target": {
     "target": "'default",
      "arch": "universal"
}

Electron:
"electron": "^12.0.1"
Builder version:
"electron-builder": "22.10.5"

This pulls both the x64 and arm64 binaries for Electron and bundles in a DMG

1 Like

To be honest, I was quite happy that we were finally done with this universal binary crap. They probably wouldn't work on Mojave. But right now we are still using Electron 10, so we'd have to wait until we move to Electron 11.

Is there a way to create both in parallel and get 2 separate DMGs?

Yup. Just do as with Windows just set 2 targets each with the separate arch.

{
  target: 'dmg',
  arch: 'arm64'
},
{
  target: 'dmg',
  arch: 'x64'
}

Would need testing and what not, but it's doable for sure.

1 Like

awesome, thanks for the info.

1 Like

BTW, loving Joplin. Great app! :grinning:

Wonderful, now I try building on the Apple silicon and a raspberry Pi.

I just want to bump this thread, now that we're using Electron 15, we should be able to offer a Mac Arm version?

1 Like

We are using Electron 14. But yes, theoretically we could provide M1 binaries, but...

  • I don't think any of us has an M1 (we can't test it)
  • you should be able to run the x64 version without issues
  • I'm sick and tired of Apple's BS

But the decision lies with Laurent.

1 Like

I agree on your comment about Apple. Although I do like their build quality and general ease of use, they treat developers like rubbish, never keeping to standards, always changing APIs, not a team player in the developer space.

Definitely if it's not an easy thing to automate an M1 build, then I wouldn't bother. This is just a quiet question bump to see if it was now easy to do or not :relaxed:

2 Likes

I gave my TDK (M1 test box) back and have a voucher to buy a M1 device that I need to use by end of year. I will be able to try building again in a month.

3 Likes

Where do I put these options to build the arm64 dmg?

Hi,
If someone in the dev team is interested, I am selling my MacBook Pro M1 RAM 8Gb Disk 512Gb w/ qwerty keyboard bought in USA in May 2021 (MacBook Pro 13-inch - Technical Specifications - Apple). It's fully functional, but with a few scratches on the case (screen is 100% ok).
Laptop is in Paris.
Best Regards,
Bruno