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

Add macOS ARM builds to CI #4727

Merged
merged 1 commit into from
Aug 17, 2021
Merged

Add macOS ARM builds to CI #4727

merged 1 commit into from
Aug 17, 2021

Conversation

chrisduerr
Copy link
Member

No description provided.

@christophwitzko
Copy link

The reason for the failing macos-11.0 checks: actions/runner-images#2486

@chrisduerr
Copy link
Member Author

@christophwitzko Thanks a lot for letting me know, that is very helpful. I'd personally much prefer if macos-latest would be macos-11.0 anyways, so I have no trouble with waiting a bit. Until then people can still build from this branch just fine should they need the binary.

@christophwitzko
Copy link

@chrisduerr I agree 👍

@osdiab
Copy link

osdiab commented Mar 31, 2021

hi, i'm looking forward to this! So I tried to build it myself, but ran into this issue:

  = note: ld: framework not found CoreServices
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Not sure if I'm being dense and didn't install something properly; I have XCode 12.4 installed and am on the latest beta release of Mac OSX, on an M1 Macbook Air. Is there something extra that needs to happen for builds to work?

After looking around a bit on the web, i was wondering if this issue is relevant: ronaldoussoren/pyobjc#309

Anyway, thanks and hope for this to get in sometime :)

@osdiab
Copy link

osdiab commented Apr 4, 2021

Update, I happened to switch to a different laptop and for some reason it worked when I did exactly the same thing here. Maybe something was weird about my environment lol

@mrjones2014
Copy link

Hi, I'm following the instructions in the changes here trying to compile for M1 Mac, but when I launch the built application, name -m still outputs x86_64 and sysctl -in sysctl.proc_translated still outputs 1 meaning the app is still running through Rosetta 2 and not natively on ARM.

Is there anything I need to do to tell the universal app to run the ARM version?

@cormacrelf
Copy link

cormacrelf commented Apr 25, 2021

Are you sure those two commands are referring to the alacritty process and not e.g. your shell?

You should be aware of the structure of processes' arm-ish-ness. Each can be running natively or under Rosetta, but also has a "arch preference for new child processes" which is either inherited or forced with the arch command. If any parent process of alacritty is run under Rosetta without forcing the preference back, then alacritty will run under Rosetta. If any process between alacritty and your shell is default Rosetta then so is your shell. Etc. Look at Activity Monitor, view all processes hierarchically, show the arch column, look at the tree involving the shell and alacritty.

For example you can have a setup as weird as this:

Apple Terminal (universal, checkbox in Get Info ticked, runs in Rosetta, default Rosetta)
--- starts shell (arm64 only => arm64, default Rosetta)
    --- starts `uname -m` (universal => Rosetta, default Rosetta)
        --- prints x86_64

@mrjones2014
Copy link

@cormacrelf actually, it was my mistake, sorry about that. I was in tmux and when I restarted the tmux server it started reporting correctly, since I had started it the first time from an x86 terminal emulator.

@kkharji
Copy link

kkharji commented May 9, 2021

Any updates on getting m1/arm version?

@chrisduerr
Copy link
Member Author

Any updates on getting m1/arm version?

ARM version for macOS will be made available as soon as GitHub has proper support for it. So asking for updates here is useless, since I can't do anything about that.

@kkharji
Copy link

kkharji commented May 9, 2021

Thanks so much for your time and effort @chrisduerr. Is it though possible to build an arm version from source?

@chrisduerr
Copy link
Member Author

Nothing should prevent you from building an ARM version from source.

@mhanberg
Copy link

mhanberg commented Jun 4, 2021

If you are interested in potentially getting earlier access to the macOS 11 runner, it looks like they're accepting requests via a form. actions/runner-images#2486 (comment)

@shaunsingh
Copy link

In the meantime, here's an apple-silicon native binary I compiled myself
Alacritty.app.zip

@kenips
Copy link

kenips commented Jun 13, 2021

In the meantime, here's an apple-silicon native binary I compiled myself
Alacritty.app.zip

@shaunsingh kind enough to recompile for macOS 11.x please? Right now it's targeted for 12. <3

@aminroosta
Copy link

@khoi Tells me it's damaged.

@mhanberg
Copy link

Looks like macOS 11 virtual environments will be opening to the public sometime next week: actions/runner-images#2486 (comment)

@kurko
Copy link

kurko commented Aug 2, 2021

For those who want to use this but aren't sure about the steps, here they are.

First, install rustup:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh && \
  source $HOME/.cargo/env

Then run the following to build Alacritty (edit to your liking, please notice it's cloning the repo). It should take a couple minutes total.

git clone git@github.com:alacritty/alacritty.git && \
  cd alacritty && \
  git checkout arm_ci && \
  rustup update && \
  rustup target add aarch64-apple-darwin && \
  cargo check --target=aarch64-apple-darwin && \
  make dmg-universal && \
  cp -r target/release/osx/Alacritty.app /Applications/

There you go, Alacritty is now on your Applications folder.

@shaunsingh
Copy link

Since the arm_ci branch is a few months outdated now, I would recommend

  1. cloning alacritty at the master branch
  2. copying over the /.github/workflows folder from the arm_ci branch to the master branch
  3. copying over the makefile from the arm_ci branch to the master branch
rustup update && \
  rustup target add aarch64-apple-darwin && \
  cargo check --target=aarch64-apple-darwin && \
  make dmg-universal && \
  cp -r target/release/osx/Alacritty.app /Applications/

That way you can get a universal binary with all the latest fixes from master

@tuannvm
Copy link

tuannvm commented Aug 10, 2021

Since the arm_ci branch is a few months outdated now, I would recommend

  1. cloning alacritty at the master branch
  2. copying over the /.github/workflows folder from the arm_ci branch to the master branch
  3. copying over the makefile from the arm_ci branch to the master branch
rustup update && \
  rustup target add aarch64-apple-darwin && \
  cargo check --target=aarch64-apple-darwin && \
  make dmg-universal && \
  cp -r target/release/osx/Alacritty.app /Applications/

That way you can get a universal binary with all the latest fixes from master

Thanks @shaunsingh

My approach:

  1. Clone Alacritty
  2. git checkout arm_ci
  3. git rebase master, and keep whatever new in arm_ci branch
  4. Profit!
rustup update && \
  rustup target add aarch64-apple-darwin && \
  cargo check --target=aarch64-apple-darwin && \
  make dmg-universal && \
  cp -r target/release/osx/Alacritty.app /Applications/

@shaunsingh
Copy link

Even better! I should learn github comments sometime soon

@mhanberg
Copy link

https://github.blog/changelog/2021-08-16-github-actions-macos-11-big-sur-is-generally-available-on-github-hosted-runners/

@chrisduerr
Copy link
Member Author

@mhanberg Thanks for the heads-up. Was expecting the linked issue to get updated but this works too.

@chrisduerr chrisduerr self-assigned this Aug 17, 2021
@diegodorado
Copy link

diegodorado commented Oct 7, 2021

Seems that since it is merged now, the steps that worked for me were:

git clone git@github.com:alacritty/alacritty.git && \
  cd alacritty && \
  rustup update && \
  rustup target add x86_64-apple-darwin && \
  rustup target add aarch64-apple-darwin && \
  cargo check --target=x86_64-apple-darwin && \
  cargo check --target=aarch64-apple-darwin && \
  make dmg-universal && \
  cp -r target/release/osx/Alacritty.app /Applications/

Thank you all!

@mitchellhuang
Copy link

@diegodorado those steps work great, thanks! Looking forward to the next official release with the universal app.

@unphased
Copy link

unphased commented Oct 29, 2021

  1. arm_ci branch no longer present on repo so earlier instructions fail
  2. If not interested in building x86_64 run make dmg instead.

Update: Holy crap M1 Max flies at compiling rust even compared to Ryzen 5950X, built app in under one minute. Not sure if having run cargo check --target=aarch64-apple-darwin eariler made it faster than it otherwise would have been.

@deybhayden
Copy link

Building from source worked for me! Curious if anyone knows about getting the M1 builds here into Homebrew? I'm definitely a bit past my skis to know if it's possible to support the multiple architectures in the brew formula.

@chrisduerr
Copy link
Member Author

Will likely be in homebrew once 0.10.0 is released. Which should be pretty soon-ish.

@jsekerez
Copy link

Hey, sorry but I'm having issues building the universal binary from source. I end up getting a whole bunch of errors as illustrated below when running make app-universal or make dmg-universal. I have no problem building the x86 version.

I've tried following the installation guide and following these comments' advice, including reinstalling tools like rustup and re-cloning the repo, but to no avail. Is there anywhere that I can find the M1 build somewhere else? I don't think it's in Homebrew.
Screen Shot 2022-08-18 at 2 53 57 PM

Any advice?

@kchibisov
Copy link
Member

The image from release page should work. In homebrew it's under cask.

If you want to build from source ensure that you have toolchain installed with the standard library, since it seems like it's missing. The target is aarch64-apple-darwin and you'd need rustup target add aarch64-apple-darwin and also have rustup target add x86_64-apple-darwin.

@jsekerez
Copy link

I downloaded it with Homebrew under cask. @kchibisov Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet