I got an M1 mac at work recently and hit a strange issue trying to run the Goland debugger:
Error running '<my test>': Debugging programs compiled with go version go1.17.8 darwin/amd64 is not supported. Use go sdk for darwin/arm64.
Wait, amd64
? I had installed the arm64 go package after the switch to M1, so why did it think I was running on amd64?
Turns out I had used homebrew on my old Intel Mac to install and use a newer version of my shell (bash). Because amd64 homebrew installs amd64 binaries the shell itself was running under amd64 and any app it ran would think the CPU architecture was also amd64. Running arch
in the shell confirmed my suspicion.
The solution was to switch to the Mac’s built-in bash shell, reinstall homebrew, reinstall bash, and set iTerm to use /opt/homebrew/bin/bash
instead of the default /bin/bash
. I followed these instructions for switching to arm64 homebrew and kept the old Intel homebrew around aliased to oldbrew
as suggested to still have access to amd64-only apps.