-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
MacOS 11.0 Big Sur and/or m1 Apple Silicon support? #589
Comments
Hi! Using the workarounds for Rosetta 2 this script runs without issue on Big Sur and Apple Silicon. I personally used this workaround and set up a new computer from scratch last night and didn't run into any trouble. I think it would be good if we update the readme to say as much. The above workaround I used, runs all of Homebrew and all installed software under Rosetta 2. There is another workaround I have not personally tested that instead of duplicating terminal as Intel, installs a Rosetta 2 version of Homebrew and an Intel version of Homebrew so that some software that supports it can be native for the M1. Using that workaround it will be more complex for this script to install and stay up to date with what is likely to change a lot over the next few months. |
One note is that Homebrew installs to |
@jdbann You should use I've got this completely un-battle-tested bit in my local fork:
|
@jamesgecko Thanks for sharing the script. Some adjustments are still needed and in particular, the following section runs before Homebrew gets installed on a new computer: Lines 49 to 59 in c3d5a26
|
This has been working well for me across an M1 and an Intel macOS laptops: set -eux
# arm64 or x86_64
arch="$(uname -m)"
# Homebrew
if [ "$arch" = "arm64" ]; then
BREW="/opt/homebrew"
else
BREW="/usr/local"
fi
if [ ! -d "$BREW" ]; then
sudo mkdir -p "$BREW"
sudo chflags norestricted "$BREW"
sudo chown -R "$LOGNAME:admin" "$BREW"
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C "$BREW"
fi
export PATH="$BREW/bin:$PATH"
brew analytics off
brew update-reset
brew bundle --no-lock --file=- <<EOF
brew "gh"
brew "git"
# ...
EOF
# zsh
update_shell() {
sudo chown -R $(whoami) "$BREW/share/zsh" "$BREW/share/zsh/site-functions"
chmod u+w "$BREW/share/zsh" "$BREW/share/zsh/site-functions"
shellpath="$(command -v zsh)"
if ! grep "$shellpath" /etc/shells > /dev/null 2>&1 ; then
sudo sh -c "echo $shellpath >> /etc/shells"
fi
chsh -s "$shellpath"
}
case "$SHELL" in
*/zsh)
if [ "$(command -v zsh)" != "$BREW/bin/zsh" ] ; then
update_shell
fi
;;
*)
update_shell
;;
esac
# ... https://github.com/croaky/laptop/blob/main/laptop.sh |
Looks like Homebrew 2.6.0 solves the M1 issues. |
@brennenawana I think its really Homebrew 3.0 where this all got to the point where it's ready. 2.6 only had partial functionality. With homebrew 3.0 things are working well now, but there are still some packages that don't yet have ARM packages. Though that number continues to go down. I've currently installed 3.0 arm version alongside an Intel version. It's unclear to me whether Homebrew will automatically use Rosetta 2 or whether running them alongside each other is going to be the standard way of operating until hopefully it is no longer necessary? I think that will influence how we want the laptop script to set things up. @croaky are you also running it side by side? Have you found the need to keep an Intel version of brew around? Overall, things continue to work very well for me with this setup though. |
I'm not running side-by-side on the same machine, only Intel Homebrew on Intel machine and Apple Silicon Homebrew on M1 machine. |
Based on this, I went back through everything and confirmed I didn't actually have anything that I actually use that was still dependent on Intel builds either. |
The existing pull request #597 actually ends up removing the code which is causing problems with Apple Silicon. I'm planning on merging that PR to close that issue unless anyone objects. |
Closes #589 This adds support for properly installing Homebrew on either Apple Silicon or Intel machines to the correct Homebrew location on macOS. Also changes to: * Using `HEAD` instead of `master`, which comes from the Homebrew home page. * Use the new `shellenv` recommended by Homebrew post-install next steps.
I know Homebrew, in particular, has some issues running on Apple Silicon (but there are workarounds with Rosetta 2), but I'm just wondering what the status is of this script supporting Big Sur and/or the m1 Macs? Thanks!
The text was updated successfully, but these errors were encountered: