laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
46k stars 5k forks source link

ARM build for mac os M1 processor #6052

Closed rafjaf closed 10 months ago

rafjaf commented 2 years ago

Hello, apparently Joplin 2.6.10 for macos is only optimized for intel-based Mac. Yet buiding Electron apps compatible with ARM proessors seems possible, see https://www.electronjs.org/blog/apple-silicon. Is there any plan to implement this? Thank you in advance for considering this issue.

wzzrd commented 1 year ago

I just installed the latest 2.12.4 for m1 and all is a-ok!

I'm running a private Joplin server, maybe that matters, and I had to re-input the encryption keys / sync passwords, but after that, all went smooth as silk.

Thanks @laurent22 !!!

vikingtoby commented 1 year ago

Just installed 2.12.4 for an M1 Pro, everything "looked" okay, could see notes.

But sync was broken, I'm using S3, the errors was: Completed: 2023/07/08 21:38 (43s) Last error: SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your Secret Access Key and signing method. For more information, see REST Authentication and SOAP Authentication for details. Here's the full log: https://pastebin.com/raw/Qugq46PW

I tried to retype my sync details like above, still didn't work though-

I've been using https://github.com/noah-nash/joplin-arm64-darwin-guide for now, where the S3 sync is working btw.

rafjaf commented 1 year ago

I tried and it could sync with Dropbox after I re-entered the master password, but then it quickly crashed with the following error:

Error
Joplin encountered a fatal error and could not continue.

To report the error, please copy the *entire content* of this page and post it on Joplin forum or GitHub.

If the error persists you may try to [restart in safe mode](https://github.com/laurent22/joplin/issues/6052#), which will temporarily disable all plugins.

Message
Cannot read properties of undefined (reading 'removeEventListener')

Version info
Joplin for Desktop

Copyright © 2016-2023 Laurent Cozic
Joplin 2.12.4 (prod, darwin)

Client ID: 4ea03c46ec3e48949fb2eba541fd8362
Sync Version: 3
Profile Version: 43
Keychain Supported: Yes

Revision: dabcd3d (dev)

JSheets: 1.1.3
Note list and sidebar toggle buttons: 1.0.3
Note Tabs: 1.4.0
Outline: 1.3.1
Plugins
[
    {
        "id": "outline",
        "name": "Outline",
        "enabled": true,
        "version": "1.3.1"
    },
    {
        "id": "org.joplinapp.plugins.ToggleSidebars",
        "name": "Note list and sidebar toggle buttons",
        "enabled": true,
        "version": "1.0.3"
    },
    {
        "id": "joplin.plugin.note.tabs",
        "name": "Note Tabs",
        "enabled": true,
        "version": "1.4.0"
    },
    {
        "id": "com.joplin.JSheets",
        "name": "JSheets",
        "enabled": true,
        "version": "1.1.3"
    }
]
Stack trace
TypeError: Cannot read properties of undefined (reading 'removeEventListener')
    at /private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/services/plugins/hooks/useSubmitHandler.js:34:38
    at safelyCallDestroy (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:22932:5)
    at commitHookEffectListUnmount (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:23100:11)
    at commitPassiveUnmountInsideDeletedTreeOnFiber (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:25098:11)
    at commitPassiveUnmountEffectsInsideOfDeletedTree_begin (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:25048:5)
    at commitPassiveUnmountEffects_begin (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:24956:11)
    at commitPassiveUnmountEffects (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:24941:3)
    at flushPassiveEffectsImpl (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:27038:3)
    at flushPassiveEffects (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:26984:14)
    at commitRootImpl (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/react-dom/cjs/react-dom.development.js:26935:5)
Component stack

    at UserWebview (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/services/plugins/UserWebview.js:42:28)
    at div
    at I (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/styled-components/dist/styled-components.cjs.js:1:19269)
    at div
    at Resizable (/private/var/folders/x4/kj9xq29d1md2qn8gm4jjx1bc0000gn/T/AppTranslocation/E7051667-B92D-4A3C-86C6-A5CDF89B5301/d/Joplin.app/Contents/Resources/app.asar/node_modules/re-resizable/lib/index.es5.js:211:28)

Thank you very much for your efforts!

boli commented 1 year ago

can we do anything to assist you @laurent22?

laurent22 commented 1 year ago

Not really unfortunately. The network errors in particular are annoying because networking should be handled by Electron and we're already getting the ARM64 version, so if it doesn't work it means something's not being compiled properly. I get a sense we'll have to wait until GitHub provide Apple Silicon VMs so that we don't have to rely on probably buggy cross-compilation.

marcolaux commented 1 year ago

@laurent22 perhaps a newer Electron version could help? 19.1.4, that is currently in use, is from 2022-11-02 which seems quite old.

Support also ended for the 19 line by 2022-11-30.

laurent22 commented 1 year ago

Right, we need to upgrade this and perhaps that would indeed help

noah-nash commented 1 year ago

Thanks, that looks like it's the reason. I did see it build a "something-unknown" package, which was weird. @noah-nash, have you experienced this issue before and do you know how to fix it?

Sorry, I was away for the weekend, so I couldn't help troubleshoot. But glad to see you were able to fix (some) of the issues though!

Not really unfortunately. The network errors in particular are annoying because networking should be handled by Electron and we're already getting the ARM64 version, so if it doesn't work it means something's not being compiled properly. I get a sense we'll have to wait until GitHub provide Apple Silicon VMs so that we don't have to rely on probably buggy cross-compilation.

When I first started building Joplin locally on my M1 Mac a year or so ago, I remember reading that there were some issues with cross-compiling for Apple Silicon, though maybe that has changed as I haven't kept up with updates since then. I'll look at 2.12.4 later tonight when I get a chance and see if there is anything else I can comment on.

noah-nash commented 1 year ago

I believe I have narrowed down the problem. Now I just have to verify that it is not some tertiary thing causing the issues. For those experiencing sync issues, could you share some logs and try starting from scratch in order to re-authenticate with your provider and re-download your notes?

To do so:

Temporarily move Joplin's profile folder, this will start Joplin in a fresh state with no notes on next launch. mv ~/.config/joplin-desktop ~/.config/BACKUP_joplin-desktop

Then try setting up sync again and report back any errors in the console log.

Once you've downloaded a handful of notes, you can restore your old downloaded notes, so you don't have to wait for things to download from the cloud. To do so, close the app and then run this command: rm -r ~/.config/joplin-desktop && mv ~/.config/BACKUP_joplin-desktop ~/.config/joplin-desktop

Once I can see the logs and make sure my hypothesis is correct, I can submit a proposed fix =)

wzzrd commented 1 year ago

You do know how to build up tension, @noah-nash 😂

DreamDevourer commented 1 year ago

It's curious that I'm currently using the latest version 2.12.4, and when syncing with Dropbox it works completely fine on my end, the sync happens between the Joplin app on my phone and this Joplin running in a Mac M1 machine. The only thing I see is this keytar error:

Cannot load keytar - keychain support will be disabled Error: dlopen(/var/folders/sp/ycfr9v956zn4v04nd_532vf80000gn/T/.net.cozic.joplin-desktop.JN3IES, 0x0001): tried: '/var/folders/sp/ycfr9v956zn4v04nd_532vf80000gn/T/.net.cozic.joplin-desktop.JN3IES' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/var/folders/sp/ycfr9v956zn4v04nd_532vf80000gn/T/.net.cozic.joplin-desktop.JN3IES' (no such file), '/var/folders/sp/ycfr9v956zn4v04nd_532vf80000gn/T/.net.cozic.joplin-desktop.JN3IES' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/private/var/folders/sp/ycfr9v956zn4v04nd_532vf80000gn/T/.net.cozic.joplin-desktop.JN3IES' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/sp/ycfr9v956zn4v04nd_532vf80000gn/T/.net.cozic.joplin-desktop.JN3IES' (no such file), '/private/var/folders/sp/ycfr9v956zn4v04nd_532vf80000gn/T/.net.cozic.joplin-desktop.JN3IES' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1812) at Module._extensions..node (node:internal/modules/cjs/loader:1203:18) at Object.func [as .node] (node:electron/js2c/asar_bundle:5:2039) at Module.load (node:internal/modules/cjs/loader:988:32) at Module._load (node:internal/modules/cjs/loader:829:12) at c._load (node:electron/js2c/asar_bundle:5:13343) at i._load (node:electron/js2c/renderer_init:33:356) at Module.require (node:internal/modules/cjs/loader:1012:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/Applications/Joplin.app/Contents/Resources/app.asar/node_modules/keytar/lib/keytar.js:1:169) (anonymous) @ main-html.js:90

laurent22 commented 1 year ago

Hi everyone, a new ARM64 release is available here: https://github.com/laurent22/joplin/releases/tag/v2.12.7

rafjaf commented 1 year ago

Thank you very much @laurent22 for the efforts put into solving this issue!

lethargosapatheia commented 1 year ago

In my case the sync is still not working. I get the same error as before, a difference that stands out now is that it does say "Completed":

Completed: 13/07/2023 17:51 (22s)

Which is misleading, because it doesn't actually synchronise anything.

This is the full error in the console (very similar if not identical to the previous ones):

Synchronizer: Error: GET info.json: No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured (Exception Sabre\DAV\Exception\NotAuthenticated) (401): <?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>Sabre\DAV\Exception\NotAuthenticated</s:exception>
  <s:message>No public access to this resource., No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured</s:message>
</d:error>

    at newError (/Applications/Joplin.app/Contents/Resources/app.asar/node_modules/@joplin/lib/WebDavApi.js:414:11)
    at WebDavApi.exec (/Applications/Joplin.app/Contents/Resources/app.asar/node_modules/@joplin/lib/WebDavApi.js:441:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async FileApiDriverWebDav.get (/Applications/Joplin.app/Contents/Resources/app.asar/node_modules/@joplin/lib/file-api-driver-webdav.js:166:21)
laurent22 commented 1 year ago

@lethargosapatheia, could you try this please?

Does it work?

lethargosapatheia commented 1 year ago

It does work :) This is starting to look really good.

In my case I saw that the password was (seemingly) empty actually. After entering the actual password directly, it started working.

I don't remember exactly what it looked like in the intel-based version, but I'm guessing the passwords dots are there, just like there are dots now after entering the password.

So I guess something to catch the error now when the wrong password is entered would be great to have at some point, but I don't mind it as long as it works.

Actually, no, entering the wrong password explicitly does give out a somewhat better error:

Last error: Error: GET info.json: No public access to this resource., Username or password was incorrect, No 'Authorization: Bearer' header found. 

So it's only that initial stage which is weird.

Thank you, I'll continue to test it and see if anything weird pops up!

vikingtoby commented 1 year ago

Can confirm, download 2.12.7 on an M1, S3 sync did not work initially.

Thanks a lot! <3

cablespaghetti commented 1 year ago

Hi everyone, a new ARM64 release is available here: https://github.com/laurent22/joplin/releases/tag/v2.12.7

This is SO MUCH FASTER on my M1 Air. Thank you!

laurent22 commented 1 year ago

Brilliant, thanks for confirming. What happens is that the new app is looking for the auth info in the wrong place in the keychain, so changing the password makes it save it back to the right place. But we indeed need to handle this better!

ctoa commented 1 year ago

Can confirm this is working great with Dropbox sync on M1 Macbook Pro!

laurent22 commented 1 year ago

@ctoa, great! Did it work right away or did you also have issues with authentication initially?

personalizedrefrigerator commented 1 year ago

It does work :) This is starting to look really good.

In my case I saw that the password was (seemingly) empty actually. After entering the actual password directly, it started working.

I don't remember exactly what it looked like in the intel-based version, but I'm guessing the passwords dots are there, just like there are dots now after entering the password.

So I guess something to catch the error now when the wrong password is entered would be great to have at some point, but I don't mind it as long as it works.

Actually, no, entering the wrong password explicitly does give out a somewhat better error:

Last error: Error: GET info.json: No public access to this resource., Username or password was incorrect, No 'Authorization: Bearer' header found. 

So it's only that initial stage which is weird.

Thank you, I'll continue to test it and see if anything weird pops up!

@lethargosapatheia Could you please check whether there is a line containing KeychainService: could not set test password in Joplin's log? (To open the log file, click Help > Open Profile Directory, then open log.txt in a text editor). If such a line is present, Joplin may not be using the system's keychain (and may instead be storing the WebDAV password in plaintext).

ctoa commented 1 year ago

@ctoa, great! Did it work right away or did you also have issues with authentication initially?

It worked right away. Nothing needed to be done.

boli commented 1 year ago

working for me too - thanks @noah-nash and @laurent22

laurent22 commented 1 year ago

@boli, nice to hear it works! What sync method do you use?

boli commented 1 year ago

@boli, nice to hear it works! What sync method do you use?

using webdav here. i took the opportunity to upgrade auth on my webdav from 'simple pw' to ldap - so i cant tell you if i needed to reset the password or not - as my other changes necessitated a password change anyway.

tthnu commented 1 year ago

Nice work! It works very well when I entered the right password after entered some random characters and applied it. I use S3 as the sync method.@laurent22

lethargosapatheia commented 1 year ago

@personalizedrefrigerator Hi,

I think this is all I get in relation to "KeyChainService":

2023-07-14 11:11:47: "KeychainService: checking if keychain supported"
2023-07-14 11:11:47: "KeychainService: check was already done - skipping. Supported:", "1"
2023-07-14 11:11:47: e2ee/utils: "Master password is not set - trying to get it from the active master key..."
2023-07-14 11:11:47: handleSyncStartupOperation: "Processing operation:", "0"
2023-07-14 11:11:47: App: "Client ID: 72bda5ca2d784296b60bde5060ab350f"
2023-07-14 11:11:47: models/Setting: "Applying default migrations..."
2023-07-14 11:11:47: e2ee/utils: "Trying to load 0 master keys..."
gaffneyd4 commented 1 year ago

v2.12.7 works on my 2020 M1 13.4.1 OS macbook. First time install using arm64.dmg. Set up sync from scratch with s3 against minio backend works too. Thanks to those who helped troublehoot the arm errors to bring us a working version!

gaffneyd4 commented 1 year ago

Downloading v2.12.7 was my first upgrade in awhile and after syncing I saw this error message on my other Joplin installations: "Some items cannot be decrypted." The solution to that problem was to upgrade my other Joplin installations, following the instructions in this post: https://discourse.joplinapp.org/t/if-you-have-an-issue-with-encryption-please-read-this/31552.

Just thought I'd pass along in case this saves someone else the google.

predmijat commented 1 year ago

I've installed 2.12.7 a few days ago and just noticed that I can no longer copy to system clipboard using the ViM mode ("+y).

amandamcg commented 1 year ago

Posting what I saw and how I got syncing to work since my case seemed slightly different than what's discussed above:

(Haven't been active lately in forum, but I am still a happy Joplin user. Thanks as always for all of your hard work!)

laurent22 commented 10 months ago

We now support M1 processors