Here are some notes I am keeping on how I set up a development environment on my M1 mac.
softwareupdate --install-rosettaarch -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 -vIf 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.bashYour 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 betaSince 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/