VSCode Debugger not working under Rosetta
Asked Answered
A

3

6

when trying to use the VSCode Debugger, I get an error message:

"Failed to launch: could not launch process: can not run under Rosetta, check that the installed build of Go is right for your CPU architecture"

some background context as I read solutions for similar questions:

  • I use foundationDB which does not work with GO arm64
  • For this reason, I am using GO amd64
  • Switching to arm64 would mean that foundationDB will not work, which is not an option

I tried downloading dlv, but it doesn't work. Also tried the solution proposed here to run VSCode integrated terminal in x86-64.

Is there a way for the debugger to work with Apple M1 using go1.18 darwin/amd64?

Accouterment answered 7/4, 2022 at 7:39 Comment(1)
Have you tried installing Homebrew in Rosetta mode (https://mcmap.net/q/167641/-how-to-run-the-homebrew-installer-under-rosetta-2-on-m1-macbook) and installing it through that?Froward
C
10

I just got this issue on my M1 and was able to resolve. Here are my steps:

  • go to the go download page, https://go.dev/dl/ and download the arm version of go installer. Specifically, go.darwin-arm64.pkg

  • install go, if it detects a previous version, agree to replace

  • open terminal and verify go version and it should say "go version go darwin/arm64"

  • On VSCode, click on plugins, find the installed Go plugin, and uninstall then reload VSCode.

  • When the plugin installation is complete, press Ctrl + Shift + P in VSCode to bring up the Command Palette, then type go: Install and select go: Install/Update Tools, then click the first checkbox to install all Tools.

  • When Go Tools install is complete, reload VSCode and retry breakpoint.

Congruity answered 18/7, 2022 at 22:57 Comment(0)
G
0

This is a popular issue on Mac. The solution is to install Golang and VSCODE in ARM-64 (not AMD64).

Here are some links for reference

https://github.com/go-delve/delve/issues/2604

Cannot run debug Go using VSCode on Mac M1

Garrulous answered 7/4, 2022 at 10:26 Comment(1)
It seems that switching to arm64 is not an option here. Any idea how to continue using the AMD Go lib?Helbonnas
P
0

I faced the same issue, Both Go and VSCode were ARM-64 version

The following steps resolved my issue,

  • Update Go to the latest version
  • Update VSCode
  • Uninstall Go extension
  • relaunch VSCode
  • Press command + shift + P
  • Run go: Install/Update Tools
  • Select all the tools
  • update
  • again relaunch VSCode
Pompidou answered 27/5 at 7:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.