-
Notifications
You must be signed in to change notification settings - Fork 99
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
Apple Silicon/M1 Support #357
Comments
The recent app release is based on Electron v11.1.0. I can't guarantee proper work on Apple Silicon hardware nor on macOS in general since I don't possess sold-by-apple devices. The released app versions go through the e2e/spectron tests executed on Linux/macOS/Windows systems which is the way I used to verify that the app is functioning on the macOS system. |
Ideally, I need GitHub Actions to support Apple-Silicon-based environment (which unlikely to happen any time soon), so I could compile the native dependencies and test the basic app functionality on the system close to end-user systems. Although it appears that Xcode 12.2+ is already supported there so I guess things might go well if I just compile arm arch using the recent electron-builder version which supports @electron/universal thing. |
This will be wontfix for now since I won't be able to verify things when/if I play around the issue. |
I know you don't plan to support officially M1, but by curiosity I tried to build an arm64 version of Electronmail on my M1 Macbook and it succeed. Then I tried to do the same build procedure on an Intel Mac. The build succeed, but I wasn't able to run on my M1 Mac (crashed immediately). I have not yet investigated further. If someone has an idea, I'm interested. |
@badwulfy thanks for the report. Yes, the process should not be complex but I still tend to avoid adding support for M1 primarily because I'd like to be able to test things at my side at least initially.
There are native dependencies involved that get compiled from code sources during the app package assembling process. That might be the cause.
|
For people interested, I published an M1 build of the version 4.12.8 in the release page on my "fork" (used only to build the app). https://github.com/badwulfy/ElectronMail/releases/tag/v4.12.8 I plan to automate build with github actions when I'll have time. |
I'd recommend to wait for #443 resolving in 4.12.9. |
I had not seen the issue. I just built the new version 4.12.9 : https://github.com/badwulfy/ElectronMail/releases/tag/v4.12.9 |
I applied the patch, but the build of current version still fails, as some script is missing...
|
Anyone having any luck here yet with Apple Silicon build automation? |
Came to check on M1/arm64 support for macOS, and subscribing (even though this is closed). Hoping some traction can be made here, as Electron apps running under Rosetta 2 are nowhere near as performant as Electron apps for M1/arm64. |
Too true. Electron and Chromium based apps are indeed horrible on Rosetta. |
Oh well, same problem here 😉 |
@vladimiry any chance you might be able to look over the situation more closely and offer an updated estimate of where things stand now? (eg, does this help?: https://github.com/electron/universal/releases) |
I'm generally avoiding macOS-specific tasks, primarily because not able to test stuff at my side. But I could pull the trigger on this one if you will be ready to test the build. |
More than happy to test anytime you're ready @vladimiry. |
The test build is uploaded here. The file to test is |
Thanks so much @vladimiry! The x64 (electron-mail-5.0.2-mac-x64.dmg) works fine - just as always without any noticeable changes. It does indeed show up as "Intel" mode in Activity Monitor. When I attempt to run the Universal version (electron-mail-5.0.2-mac-universal.dmg), I receive the following error:
I do, however, see the app still running as an "Apple" mode app within Activity Monitor, so you do appear to be close. When in
It appears that other frameworks show similar results via Any additional details I might provide? |
If you have a non-M1 laptop, but Intel-based, try
Just asked
So the only thing I could try for now is disabling |
I did indeed ask for some feedback from someone with an Intel Mac, should hear back soon. Hmmmmmmm.... It seems perhaps there is something going on with the |
Besides, I guess it's impossible to properly compile arm64 native modules on non-M1 system (currently using |
Hmm, this is interesting/strange. I'll need to check with another project I work with to see how the CI guys are generating their Apple Silicon binaries on GH Actions runner... I suppose one option could be to just outline an "Apple Silicon Build Instructions" sections on the front page and I could test that out and we could iterate and refine it to get it working such that any Apple Silicon users that want it could build our own with a clean process (and I could probably get someone to make a MacPorts formula to make it simpler). |
It should be almost the same process as currently listed in the readme expect for the final/packaging step where you set
If you want to skip building the @ProtonMail stuff (I'd recommend), foremost unpack the You could also skip the |
sodium should def work on m1. Are you sure electron-rebuild isn’t rebuilding it? That’s normally what goes wrong for users, instead of using the prebuild |
A new build to test is uploaded here.
All the native deps in this project by design get compiled on the packaging stage (triggered by |
Btw, there are other sodium bindings available, including rust-based. So the last resort is replacing "sodium-native" with something else (I'd prefer a native module vs wasm-based solution). But it's successfully used in the project from day one (~5 years), and it's confirmed as working on arm64 arch, so I'd like to keep it here. |
Sorry, another crash report: |
Thanks. It looks the same, I've just compared |
sodium is already prebuilt for all platforms, all in the installed bundle. I’d strongly suggest just not to rebuild it, you’ll probably only run into trouble. |
@mafintosh yep, I know that it's coming with prebuilds, and thanks for the warning. Still going to keep fighting it for a while (it works well on x64 arch after all without troubles). It generally feels better when I know how and can replicate the compiling at my side. It's about better control on things. For example, there were cases when prebuilds of some native deps were shipped in a sort of doubtful state, so I had to improve things a little (like specifying MACOSX_DEPLOYMENT_TARGET and lowering the Linux version to get as many old systems as possible compatible with "glibc" lib). |
For sure. We do all of that already 🙂 Are you rebuilding for arm and x64 on the same macbook? |
Yep, I know (briefly looked into it before). I didn't mean your lib.
I don't have any apple laptops (none of intel/m1 based). So it's just GH CI system, and then I ask guys to test stuff 😓 Yes, this sounds like a terrifying dev experience, so I normally avoid handling the macOS-specific tasks 😄 |
I had tons of trouble building for arm on GH so we actually do those manually with an macbook mini in our office. The sodium build is downloading the sodium static lib from the official sodium site when building. Maybe it's pulling down the wrong static build? How are you building it for arm? |
Same way for all builds, via
Yep, I've noticed that |
How does electron-builder signal that it wants to rebuild for arm64 when running on x64? |
It has an arg for this purpose and the log says that arm64 build takes place. I've noticed in the log, though, that the |
Could you try setting the PREBUILD_ARCH=arm64 env var when building for arm64? That is used here https://github.com/sodium-friends/sodium-native/blob/master/deps/bin.js#L29 |
Ok, I've set PREBUILD_ARCH=arm64 and also npm_config_arch=npm_config_target_arch=arm64 just in case and triggered the CI build (maybe it should have been just npm_config_target_arch, without npm_config_arch). Let's see if it helps. |
Just an FYI, it seems that a lot of Chinese users are using the |
It appears that I might need to append the |
I got the |
It runs well without issues ! 🎉 The only thing I had to do before being able to run it was the command "xattr -r -d com.apple.quarantine /Applications/ElectronMail.app". Before MacOS said it was "corrupted", but I think it is because your build is not notarised. |
Ok, this is what I did to make it work. The issue was about compiling
@mafintosh, so with some effort, the cross compiling works for the |
WOWOWOWOW @vladimiry! The difference is night and day. I am now going to be able to use ElectronMail again without grunting and agonizing about needing to do it for 5 minutes before even clicking the icon to start it up! Smooth as butter now!!!!! ❤️❤️❤️❤️❤️❤️❤️❤️❤️ |
I don't believe M1 hardware is so slow in a virt. mode. Anyway, thanks for testing this smooth butter stuff. Closing as resolved then. Next release coming with 2 macos builds. |
Thank you again. I have a pretty heavy load with a lot of apps open and pushing the limits of max mem config for my system model. There's an enormous speed difference in these burdened configurations. You might be right for lower load systems, but for folks like me this makes all the difference @vladimiry. |
Well, yes, I understand that squeezing more juice from the same hardware always causes a good feeling. PS I already know what it's like to use slow hardware on a daily basis. But I'm going to refresh this feeling since going to try switching to an ancient but fanless laptop. |
It would be fantastic if we could get a version compiled and optimized for Apple Silicon.
(I believe this would require an upgrade to Electron 11.)
The text was updated successfully, but these errors were encountered: