{"record":{"id":"753272289944d2e0","repo":"go-delve/delve","slug":"can-not-run-under-rosetta-check-that-the-installe","errorCode":null,"errorMessage":"can not run under Rosetta, check that the installed build of Go is right for your CPU architecture","messagePattern":"can not run under Rosetta, check that the installed build of Go is right for your CPU architecture","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/proc/macutil/rosetta_darwin.go","lineNumber":16,"sourceCode":"package macutil\n\nimport (\n\t\"errors\"\n\t\"syscall\"\n)\n\n// CheckRosetta returns an error if the calling process is being translated\n// by Apple Rosetta.\nfunc CheckRosetta() error {\n\tpt, err := syscall.Sysctl(\"sysctl.proc_translated\")\n\tif err != nil {\n\t\treturn nil\n\t}\n\tif len(pt) > 0 && pt[0] == 1 {\n\t\treturn errors.New(\"can not run under Rosetta, check that the installed build of Go is right for your CPU architecture\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":1,"sourceCodeEnd":20,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/pkg/proc/macutil/rosetta_darwin.go#L1-L20","documentation":"CheckRosetta detects when a Go binary compiled for amd64 is being transparently translated by Apple's Rosetta on Apple Silicon. Delve requires ptrace-level access that does not work reliably under Rosetta translation, so it refuses to run rather than misbehave. The error tells the developer their Go toolchain/build does not match the actual CPU architecture.","triggerScenarios":"Running an amd64 delve (or delve process launched under translation) on an arm64 Mac; the sysctl 'sysctl.proc_translated' returns 1 indicating Rosetta translation.","commonSituations":"Downloading an amd64 delve release or Homebrew x86_64 build on an M1/M2/M3 Mac; Go toolchain installed as x86_64 under Rosetta; running through a terminal emulator in x86 mode.","solutions":["Install native arm64 builds of both Go and delve (go.dev/dl arm64 package, darwin/arm64 delve release)","Check with 'file $(which dlv)' and 'go env GOARCH' that both are arm64","Reinstall the Go toolchain natively (remove Rosetta-installed versions)","Run from a native arm64 terminal, not one running under Rosetta"],"exampleFix":"// before (Rosetta shell)\n$ go install github.com/go-delve/delve/cmd/dlv@latest  # GOARCH=amd64\n// after\n$ arch -arm64 /bin/zsh\ngo install github.com/go-delve/delve/cmd/dlv@latest   # GOARCH=arm64","handlingStrategy":"validation","validationCode":"// preflight in a script before launching dlv\nif [ \"$(sysctl -n sysctl.proc_translated 2>/dev/null || echo 0)\" = \"1\" ]; then\n  echo \"Running under Rosetta - reinstall native arm64 Go and delve\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":"if err := macutil.CheckRosetta(); err != nil {\n    fmt.Fprintf(os.Stderr, \"refusing to start: %v\\n\", err)\n    os.Exit(1)\n}","preventionTips":["Install darwin/arm64 builds of Go and delve on Apple Silicon","Verify with 'file $(which dlv)' and 'go version' that both are arm64","Avoid installing Go via Rosetta-targeted package managers","Use native terminals (not x86_64 terminal emulators) for debugging sessions"],"tags":["darwin","rosetta","arm64","architecture-mismatch"],"backgroundTag":"rosetta-translation","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}