Here are some notes I am keeping on how I set up a development environment on my M1 mac.
softwareupdate --install-rosetta
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
cd /opt
sudo mkdir homebrew
sudo chown $USER: homebrew
git clone https://github.com/Homebrew/brew homebrew
cd homebrew
./brew install ....
git clone https://github.com/golang/go
cd go/src
GOOS=darwin GOARCH=arm64 GODEBUG=asyncpreemptoff=1 ./bootstrap.bash -v
If you don't use GODEBUG=asyncpreemptoff=1
, you will get hanging background processes eating up your cores.
Make sure to keep an eye on activity monitor, and pkill
any processes that spin on 100% CPU.
Now that we have a bootstrap, we can build a real toolchain using these commands: (Thanks @cherrymui for the hint)
GOROOT_BOOTSTRAP=$(pwd)/../../go-darwin-arm64-bootstrap ./make.bash
Your native go installation will have its GOROOT at ../
. The binaries will be in ../src/
Put it in your path, or copy it somewhere you like.
Install rustup with homebrew.
/opt/homebrew/bin/brew install rustup-init
rustup update beta
Since alacritty/alacritty#4530 is resolved, we can simply build the latest version from source!
git clone https://github.com/alacritty/alacritty
cd alacritty
make app
rm -rf /Applications/Alacritty.app || :
cp -r target/release/osx/Alacritty.app /Applications/