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

Apple Silicon Native Builds #4

Open
jimeh opened this issue May 9, 2021 · 17 comments
Open

Apple Silicon Native Builds #4

jimeh opened this issue May 9, 2021 · 17 comments

Comments

@jimeh
Copy link
Owner

jimeh commented May 9, 2021

Update (2023-11-23): Native Apple Silicon builds are now available. However, due to the high cost of M1-based GitHub-hosted Actions Runners at the moment, they are limited to stable releases, one nightly build per month (on the 1st of each month).

Ways to install native Apple Silicon builds:

  • Latest 29.1 release, which can be installed manually, or via homebrew: brew install --cask jimeh/emacs-builds/emacs-app
  • New monthly Homebrew Cask that only tracks nightly builds from the 1st of each month: brew install --cask jimeh/emacs-builds/emacs-app-monthly

Looking forward, I want to do Apple Silicon builds more frequently, and I'm hoping M1-based runners come down in price, or even become free like the base Intel-based macOS runners are. Until then though, I plan to look into GitHub's sponsorship feature, to see if I could use that to cover build costs, and start doing weekly or maybe even daily Apple Silicon builds.


Update (2021-11-30): Apple Silicon builds now purely depends on GitHub Actions having Apple Silicon based GitHub-hosted runners:

actions/runner-images#2187


Main blocker for this right now is the lack of Apple Silicon support in GitHub Actions, as from what I understand it's not possible to build Emacs for Apple Silicon on an Intel machine. There is always the option of buying a Apple Silicon machine, but that'd go against my goal of keeping everything public and transparent, as I would be producing builds from custom self-hosted hardware, instead of GitHub hosted runners.

The secondary semi-blocker is that GCC and libgccjit are as of writing not yet available for Apple Silicon, meaning even if I had a Apple Silicon environment to produce builds from, native-comp would not be available.

@jimeh jimeh added the blocked Blocked by external factors label May 9, 2021
@shaunsingh
Copy link

Although this isn't possible because of gccjit right now, in the future I can compile native apple silicon builds on my machine when it becomes available.

@shaunsingh
Copy link

Just for anyone wondering, the current intel builds do not work under rosetta

@jimeh
Copy link
Owner Author

jimeh commented May 13, 2021

@shaunsingh Thanks for the offer, but if possible I want to create builds on public and reproducible hardware to keep the whole process as transparent as possible.

And good point about the current Intel builds not even launching on M1 machines. I’ll update the readme to mention it.

@shaunsingh
Copy link

Looks like libgccjit is supported on Apple Silicon now. I'm currently building emacs-plus with it, looks good so far, I think emacs-build should work just fine too!

Of course it still isn't possible right now due to the whole GitHub actions issue, but I thought I should let you know.

@shaunsingh
Copy link

actions/runner-images#2486 (comment) sorry for the late notice, macOS 11 runners are available now on request.

@jimeh
Copy link
Owner Author

jimeh commented Jun 13, 2021

@shaunsingh I've submitted the form for access to macOS 11 runners, let's see what happens. Though until they also bring out M1-based runners for macOS 11 (or 12), it's sadly not going to help all that much. But let's hope access to macOS 11 gets me access to M1-runners faster :)

@jimeh
Copy link
Owner Author

jimeh commented Nov 30, 2021

Apple Silicon builds now purely depends on GitHub Actions having Apple Silicon
based GitHub-hosted runners:

actions/runner-images#2187

Right now I would like to avoid having to resort to a self-hosted runner, as I'd
like all builds to be as transparent as possible with full build logs available,
running on standardized non-custom hardware, ensuring nothing has been tempered
with.

My hesitance to self-hosted runners might fade when I eventually get a Apple
Silicon machine myself, and if it's looking like it will be years before
GitHub-hosted runners become available.

But for now, I'm simply gonna keep fingers crossed for the GitHub-hosted runners
:)

@jimeh jimeh changed the title Builds for Apple Silicon Apple Silicon Native Builds Nov 30, 2021
@garyo
Copy link

garyo commented Oct 11, 2023

These are now available -- any interest in reviving this?

@jimeh jimeh removed the blocked Blocked by external factors label Nov 14, 2023
@jimeh
Copy link
Owner Author

jimeh commented Nov 14, 2023

@garyo Definitely. I'm hoping to have this sorted within the next couple of weeks, both due to, and because of, the fact that I now have an Apple Silicon machine myself. So testing ARM builds is much easier, and I personally would like to install nightly builds with Homebrew :)

@jimeh
Copy link
Owner Author

jimeh commented Nov 15, 2023

Ha. One kinda big snag for now, the M1 runners are only available in X-Large variants, which cost $0.16/minute to run, unlike the normal sized macOS runners which are free for public repos.

I'll be doing some experiments to see just how much each Apple Silicon build might cost. On my 11-core M3 Pro a build takes about 8 minutes. The GitHub Actions Runner is a 6-core M1 machine, so I'm expecting somewhere around $2.50-4.00 per build. This rules out nightly builds.

I'll definitely be doing stable builds, but master builds may need to limited to once a week or even once a month. At least until there's a free M1 runner available.

@garyo
Copy link

garyo commented Nov 15, 2023

Weekly master builds seem fine to me at least. Also I bet there are other folks like me who'd donate a small amount monthly for this. (Note: I do a set of monthly master emacs builds for Windows and Ubuntu/Debian; see https://github.com/garyo/emacs-build/releases)

@jimeh
Copy link
Owner Author

jimeh commented Nov 15, 2023

Yeah, once I get builds working and I have some idea of average cost for a build, and what can be improved, I'll consider opening up donations on this repo to cover some of the costs.

Last night I burned through $5 worth in about 30 minutes just trying to see if I could get a build to run, without success... lol

@jimeh
Copy link
Owner Author

jimeh commented Nov 19, 2023

Small update. I have Apple Silicon builds working, and I've managed to minize the use of the M1-based xlarge runners to only the essentials. This seems to yield roughly 17 minutes of billable runner time for each build, or around $3 USD per build.

In the short term, I believe I'll do Apple Silicon builds from master once a month, and have a look at the ins and outs of enabling sponsorships for this repo as a potential means of covering the costs for doing builds more frequently.

I'm about to investigate the most reasonable way to integrate this alternative schedule for Apple Silicon builds into the homebrew tap.

If anyone wants to try a native Apple Silicon build I've produced so far, you can grab the dmg asset from this GitHub Actions run: https://github.com/jimeh/emacs-builds/actions/runs/6917677489

@sawan
Copy link

sawan commented Nov 21, 2023

Small update. I have Apple Silicon builds working, and I've managed to minize the use of the M1-based xlarge runners to only the essentials. This seems to yield roughly 17 minutes of billable runner time for each build, or around $3 USD per build.

In the short term, I believe I'll do Apple Silicon builds from master once a month, and have a look at the ins and outs of enabling sponsorships for this repo as a potential means of covering the costs for doing builds more frequently.

I'm about to investigate the most reasonable way to integrate this alternative schedule for Apple Silicon builds into the homebrew tap.

If anyone wants to try a native Apple Silicon build I've produced so far, you can grab the dmg asset from this GitHub Actions run: https://github.com/jimeh/emacs-builds/actions/runs/6917677489

Please let us know sponsorship path, this is a valuable service you are providing.

Any chance we can have the monthly build be the stable branch (29.1 as of now) as opposed to master?

@jimeh
Copy link
Owner Author

jimeh commented Nov 21, 2023

@sawan Stable builds will definitely include both Intel and ARM builds. They're infrequent enough that the cost is acceptable. I will be updating the existing 29.1 release with an ARM build, along with a rebuilt Intel build to resolve #25 within the next few days. And I'll also try and make ARM builds for older stable releases when I have time.

With the nightly builds, my current plan is to include ARM builds on the 1st of the month, and add a new emacs-app-monthly Homebrew cask for it that would always support both Intel and ARM systems. The nightly cask will support ARM automatically if an ARM variant is available on that day.

Currently the 2023-11-19 nightly includes an ARM build, and is the starting point of the monthly cask. I'll be sorting out the final issues around the cask changes today, and updating READMEs as needed.

Over time I will be adjusting the frequency of ARM builds as costs allow thanks to sponsorships and/or changes to costs for the M1 runners.

@jimeh
Copy link
Owner Author

jimeh commented Nov 23, 2023

I've updated the main issue description with the current state of affairs with Apple Silicon builds. Though builds are available now, the situation is still not ideal, so I'll leave this issue open for now.

@jesse-c
Copy link

jesse-c commented Nov 25, 2023

I've been following this along, and just wanted to say, thank you! It's working smoothly for me on my M1.

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

No branches or pull requests

5 participants