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
arm64 support for macOS (Apple Silicon, M1 CPU) #293
Comments
Hi @asmod3us, this is a good question and one I've been thinking about, as I can't wait to get my hands on an M1 Mac. However, this probably is not coming terribly soon, as there are some significant issues I need to overcome. The main problem is that Brave is not released as a "universal" app, meaning they are releasing two separate versions, one for Intel and one for M1. That would mean I'd either need to include both in Epichrome, which would nearly double the size of the package and require me to figure out how to auto-sense which architecture it's being run on, or I'd need to branch and release two separate versions with each release, which is its own logistical problem, as my auto-update code would need to be completely rewritten to handle that. So the short answer is, I haven't figured out how to do it elegantly yet. Once I've released 2.4.0, it's on my list to grapple with, but it may be several months. Sorry for that delay. I've heard good things about the Rosetta 2 translation, so I hope that will suffice for you lucky M1 users for now... |
The browsers really benefit from native support compared to Rosetta, I'll support work on this best as I can. I have access to an M1 Mac and I'm happy to provide feedback. Would using the Chrome engine make it easier to offer initial support? The binary available at https://www.google.com/chrome/ for M1 Macs is actually a universal binary:
|
Hi @asmod3us, Thank you for the tip! I never even downloaded the ARM version of Brave as I just assumed it would be ARM-only. After your comment, I tried it, and it too is universal. I was worried it would have other differences that would cause headaches in incorporating it, but it appears to work just fine. But of course, I only have an Intel system to test it on. Anyway, I'm about to release 2.3.27 with the universal Brave engine, but wanted to post it here first so just in case it doesn't work well on your M1 Mac I can pull it until we can figure it out. Would you please give it a try and let me know how it goes? Thanks! Here's the link: https://www.dropbox.com/s/hgnl6i46ima9b3l/epichrome-2.3.27.pkg?dl=1 |
Hi @dmarmor,
Oh that's great, I had no idea about Brave being universal too!
Thank you, I took it for a test ride, so far I have mixed results:
LMK what logs and other details I can provide. |
That's very puzzling. I'm not sure what logs would be helpful for me. Having no experience with running on an M1, I don't even know how you determine which architecture a process is running. Is that something that the The real problem is that I have no idea if I can do anything to change what you're seeing. Most of Epichrome is based on shell scripts, which don't have any architecture, so I don't understand how non-browser processes can be running as Intel. I'll try to do some research and see if there's anything I can do to try to hint that the entire Epichrome system should be considered universal... |
I'm going to go ahead and release 2.3.27, as it appears to at least run as well as the previous Intel versions for you. Meantime, we can keep working on this. The only other compiled code I have in an app is the small launch app, which is Intel-only. I've just built my own custom universal build of Platypus, which is what I use for the launch app. I'll make a beta using that and post it here for you to try. I'm not super hopeful it'll help, but it's the only idea I have at present. Hopefully tomorrow sometime... |
Indeed. Activity Monitor shows the architecture of running apps: On the shell, I think ps shows a flag for the process. Apple Docs suggests it's the
has
is A snippet from https://cutecoder.org/software/detecting-apple-silicon-shell-script/ allows to detect the architecture as as well as emulation:
I looked into the Epichrome package and the binaries in Engine are still Intel binaries. Could that be the reason? Here are a couple of screenshots from Activity Monitor:
Hope this helps! I'll gladly try the beta with the Platypus universal binary. |
This is very helpful to see! Yes, the behavior of Bar (on first run anyway) is what I'd have expected. That first instance is the Platypus launch app, which has been Intel-only. The second one should be the Brave engine, running native. What I don't understand is why it then runs Intel on subsequent runs. I'm hoping that maybe if the launch app is native too, that will help, but we'll see. To that end, here's a 2.3.28 beta with the universal Platypus binary. Could you give it a try and see if it helps at all? Thank you! https://www.dropbox.com/s/tpofl88447otoqw/epichrome-2.3.28b1.pkg?dl=1 |
This is so confusing to me. I can't understand why it would work correctly on the first run, and then fail on subsequent runs. I've scanned an app bundle and now can't find any code in there that's not universal. I'm assuming Baz launches and runs correctly on both the first and subsequent runs? My only working theory is that somehow the native code isn't running properly, so then the system falls back to the Intel code on the next run. But I figured you'd see some evidence of that somewhere. For now, I'm out of ideas, unfortunately. I'll keep poking around the internet to see if I can find anything out, but without my own M1 device to experiment on, I'm not sure what else I can try now... |
I agree, it's very confusing. I reattempted this with only the Epichrome beta installed version but got the same result. If I delete the engine from
I understand it's not ideal, but I am happy to poke around further if you can provide some directions :) |
I've been poking around to see what I might be able to do. Have you looked at the Get Info window for both the launch app (the one you created) and the engine app (the one in EpichromeEngines.noindex)? Do they show an option to run under Rosetta or native? I can't see this option on my system, but of course I'm on Intel. If you see that, does changing it to turn of Rosetta for those apps help? It wouldn't be ideal to have to do that for every app, but if that option is at least there it might point me toward a solution I could try. Thanks! |
I forgot to mention that the flag does not change during or after the first launch. |
OK, that's useful to know. I'm going to post a new beta for you in a little bit. Menatime, I forgot to ask: have you tried to create any Chrome-based apps? If not, could you try one? I'd like to know if they also run under Rosetta, or if they manage to run natively. |
Good news - just tried a Chrome-based app and they start as and stay a Apple SIlicon binary! |
Another update: after running the Apple Silicon Chrome-based app for a while, there's again a bash process running as Intel:
If we could find out what launches this process...? |
Thank you for this info! Promising that Chrome-based apps at least run natively. And thank you for the report on Epichrome Helper. I'd forgotten about that process (it's gone in 2.4.0, which I've mostly been working on), and need to make a quick update to the beta I was about to send you. Will post that as soon as it's ready... |
OK, here's 2.3.28b2. I've added a key to the Info.plist files that Apple suggests might encourage M1 systems to run everything natively, but we shall see. Looking forward to hearing how it goes. Thanks! https://www.dropbox.com/s/kjbgv23iah2hdlm/epichrome-2.3.28b2.pkg?dl=1 |
Success! With this version apps created with Brave engine stay Apple Silicon apps on second (and subsequent) launches. |
2.3.28b2 works very well for me on an M1 MacBook Air. I tried both the Brave and the Chrome engine, and all processes are listed as Apple in the Architecture column of Activity Monitor. Complete startup time using the Chrome engine is around 1.5 sec quicker for 2.3.28b2 (~3 sec) compared to 2.3.26 (~4.5 sec). |
That's great, @asmod3us & @richard-vd ! Thank you for the reports, and for the impressive benchmark. I'm jealous of you M1 folks! I've just posted the release version of 2.3.28 with this fix in it, so you should be good to go with all subsequent releases. Closing for now, but if more problems occur, please let me know and we can reopen. |
Heads-up that starting with Epichrome 2.4.16 (which I'll be releasing shortly), Epichrome apps will no longer run natively on Apple Silicon. As of Brave 1.27.111, Brave is (for reasons I can't fathom) no longer being released as a universal package, but only as separate packages for Intel and M1. So I now have no clean way of bundling it for both architectures. Since M1 Macs can run the Intel version, that's the version I will be packaging going forward until and unless they change this stupid way of doing things. Sorry about this... |
Thanks for the heads-up. I only use the Chrome engine with Epichrome, so I will stay on 2.4.15. I disabled checking for updates by replacing value
|
Hi @richard-vd, Two things: First, if you use the Chrome engine with Epichrome, then there's no reason not to update to 2.4.16. Whatever version of Chrome you have installed on your system, which presumably works, will continue to be the engine. This change only affects apps that use the built-in Brave engine. Second, if you do want to set an app not to prompt for updates, changing epichrome.plist will not do that. That only sets the default value for new apps you create in Epichrome (and it gets automatically set by whatever is the last way you created an app in Epichrome). If you want to change the setting for an app you already have you need to edit the app in Epichrome, either by drag-and-dropping it on Epichrome.app, or running Epichrome.app and clicking the Edit button and then choosing the app. Click through until you get to Step 8, then click Advanced Settings and go to Advanced Setting 2. Then click Other Options and choose Never Update. Click on through and save the app and then it won't ask to update itself any more. |
I now edited the apps as per your instructions. Thanks for clearing this up! |
What would be the steps to swap the bundled Brave Engine manually? I upgraded to 2.4.16. and all my apps are now Intel binaries again... |
Hi @asmod3us, sorry, I tried to do this on my system and it doesn't work. It breaks the codesigning, as you end up trying to run an originally-signed version of Brave with a modified Info.plist, which causes it to refuse to run. |
Did anyone come to some solid end results in getting Apple Silicon running reliably? Would like to keep this project going - albeit maybe via a fork with a native coded app and perhaps an easy(ish) interface for code signing if necessary... There just don't seem to be any other real drop in replacements for Epichrome at this point. |
Apple Silicon used to work, but then maybe 6 months ago, Brave stopped distributing as a universal app. I didn't want to put two whole distributions of Brave into the package, which would've bloated it too much, and didn't have the bandwidth to start delivering two versions of Epichrome. So as of 2.4.16 (2021-08-05), the Brave engine is no longer native on Apple Silicon... |
I understand. I spent some time today attempting to yank out the Intel Brave engine and replace it with the ARM64 (Apple Silicon) version, but for some reason each time I start an app it simply still uses the older Brave engine. I was thinking that the At this point my thought / goal is to get Brave-AS(ARM64) working before doing doing some significant reworking with a compiled version to replace all of the compiled scripting componentry just to eke out some more life/time. Presently the Intel execution of Brave is murdering some of my use cases due to the additional heaviness that might not be noticed by "lighter" users. |
Have you gotten your own build working? That would be the real way to make an ARM build. You'd just need to put the latest ARM version in the |
Hi, should I assume you're meaning cloning the repo and I guess I need to read through the I'm sorry it's taken me (and @ylluminarious) some time to circle back to this. We've had some things that have taken up an inordinate amount of time the last few months. |
Yeah, you should be able to build on your own system once you get a few dependencies in place. You'd need a full Brave installer package or DMG (however they're distributing it now--the Makefile will work with either) in the |
FYI, current download from Strangely I thought the version numbers before (eg, last build) used 96.xxx vs 1.xxx and so I was thinking it was using the Chromium version instead...? |
@dmarmor I set some time aside, finally, to start to dig into this situation. I was initially thinking it might be either: A) a matter of doing as you instructed and (my interpretation) just push the B) perhaps simply change the URL for The script is a little muddy at points and I need to really trace it better and/or begin rewriting things. I had HOPED I would be able to get Brave updated to an arm64 build to tide me over as I started working through the rewrite, but I'm guessing that's not going to be possible at this point. I think, sanity wise, I might start with either rewriting each script at a time and replacing it while retaining your general logic... But I might need to essentially rewrite everything with a textual UI initially and then migrate to a GUI after I have things working. To be honest, a TUI for Epichrome is perfectly acceptable for me and probably many, but I'd eventually convert that to a GUI... Anyway, just some musings here as I poke about. |
Hmm...as I recall, option A should've worked. I think the naming convention |
Well this is very interesting. I just tried it again - with the modified engine line:
And it actually pulled the new browser down this time. The only differential between when I last tried it and now is an Xcode update and time... Perhaps something was off at the time with something on the Brave site or otherwise. Well hmm - I guess this is good. So I did get a bit further, obviously:
I ran it again and got this:
Not worried about the codesign line at the moment, but apparently |
Hmm. That is odd. I just used the default version of One warning--if you build a version without codesigning it, you will likely run into some issues running those apps. I had trouble getting the Apple Keychain to accept credentials from those apps and I think ended up having to unlock the keychain every time I ran those apps (or something like that--it's been a long time), which is why I started re-codesigning the Brave engine... Anyway, if you can give me any more detail on what's going on with the |
When I run the command manually from the shell it does seem to execute:
And a subsequent build of course fails:
I guess I'm not yet following why The mystery is why on earth Thanks for the codesigning warning - I'm going to cross that bridge soon (I need to renew my ADC account; kinda been frustrated with Apple and let it run out some months ago due to the way they seem to ignore my bug reports anymore or take VERY long times to address even very important ones. In the past they were quite timely, but the last few years have become horrible). |
Continuing on the Putting an extra
|
I think I'm close to the finish line here @dmarmor... You mentioned something before about a custom build of Ran into a problem with
So then tried to reset this:
and got a
If I do go into
Perhaps I could / should just use Homebrew or MacPorts and just link the script up to that (new path) on line 50:
I should, however, indicate that Platypus was built properly and does live in Hmm, I did also notice that there is a build of it in the |
After some more fiddling around, I think the final issue even with Platypus I may be facing here may be codesign. I'd like to really get this to build and run before paying Apple so what is the preferred method for the disabling codesign identity? I thought it should be just a matter of changing the value to
|
Sorry for the long delay--did you get this working? I remember adding codesigning to everything mostly defensively as apps simply wouldn't run without it, so I never built in an official mechanism to build without signing. It might require editing the Makefile, but at this point I really can't remember how deeply entwined in the build the codesigning was... |
Now that Brave has Apple Silicon support, would it be possible to use this engine on Apple Silicon instead of the Intel version used now?
The text was updated successfully, but these errors were encountered: