Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop: attempt to fix #6052: Create arm64 function for cross-compile support #8452

Merged
merged 4 commits into from Jul 13, 2023

Conversation

noah-nash
Copy link
Contributor

@noah-nash noah-nash commented Jul 11, 2023

(hopefully) Resolves #6052

The network errors referenced in the issue were caused by not downloading the prebuilt keytar module. Creating a separate electron-rebuild command should make it act similar to prebuild-install and make it fetch the proper prebuilt keytar module when building from source is not possible (different architectures). This should also hopefully work towards making a Linux arm64 build as well.

If this does not solve the issue, it may have to be pushed back earlier in the CI build process, before yarn install.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@noah-nash noah-nash changed the title Create arm64 function for cross-compile support Desktop: attemp to fix #6052: Create arm64 function for cross-compile support Jul 11, 2023
@noah-nash noah-nash changed the title Desktop: attemp to fix #6052: Create arm64 function for cross-compile support Desktop: attempt to fix #6052: Create arm64 function for cross-compile support Jul 11, 2023
@noah-nash
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jul 11, 2023
@laurent22
Copy link
Owner

Thanks @noah-nash. Looks like it builds, but there's an unrelated problem with signing the app which I'll check first before merging this. By the way do you understand how keytar could affect the network lib? As I understand, the request headers somehow were not being passed around anymore but I don't see how that could be related to keytar

@laurent22
Copy link
Owner

@noah-nash, you have some linter errors. Could you run yarn run linter ./ from the root please?

@noah-nash
Copy link
Contributor Author

My bad. I just linted the code and it should be good now.

@dreness
Copy link

dreness commented Jul 13, 2023

By the way do you understand how keytar could affect the network lib? As I understand, the request headers somehow were not being passed around anymore but I don't see how that could be related to keytar

Looks like keytar's job is to manage Joplin credentials by storing and loading them with the appropriate platform-native credential store. HTTP credentials are typically communicated in the form of HTTP headers, so failure to fetch credentials could certainly yield broken headers.

On macOS, a running application is authorized to access items in the keychain (or not) based on the identity in the code signature of that application. The code signature identity is derived from the developer certificate used to do the signing, which is bound to a specific Apple developer account (or the signature is an ad-hoc signature, which is effectively "anonymous and guaranteed unique"). Ad-hoc signatures are really only useful for development purposes, for reasons I'm about to explain.

Any app is allowed to store new items to the keychain, however only the app that stored a keychain item is allowed to retrieve that item (the exception is when using keychain access groups). Updated versions a given app - i.e. with the same bundle ID and signed by the same developer ID - are authorized to access keychain items stored by other versions of that app. Even if it's the exact same software, if the app is signed by a different identity, Keychain considers it to be a distinct app, which is good, otherwise it would be super easy to steal another app's credentials.

@laurent22
Copy link
Owner

Any app is allowed to store new items to the keychain, however only the app that stored a keychain item is allowed to retrieve that item (the exception is when using keychain access groups). Updated versions a given app - i.e. with the same bundle ID and signed by the same developer ID - are authorized to access keychain items stored by other versions of that app. Even if it's the exact same software, if the app is signed by a different identity, Keychain considers it to be a distinct app, which is good, otherwise it would be super easy to steal another app's credentials.

Indeed that's probably what is is. We store secrets in the keychain using keytar, and since it was broken they weren't being saved anymore. Hopefully this pull request should fix this.

All tests are passing now, thanks @noah-nash, let's see if we can build this arm64 app!

@laurent22 laurent22 merged commit 16b7969 into laurent22:dev Jul 13, 2023
10 checks passed
jscodecleaner pushed a commit to jscodecleaner/joplin that referenced this pull request Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ARM build for mac os M1 processor
3 participants