Golang AWS SAM lambda Function debugging is not working on M1 Mac
When trying to debug simple SAM, I'm receiving the following error:
could not launch process: fork/exec /var/task/hello: function not implemented
Is anyone knows how to solve it?
The full log is:
Mounting /Users/.../HelloWorld as /var/task:ro,delegated inside runtime container
START RequestId: 87012bed-214a-4603-8f3c-675ce1551167 Version: $LATEST
API server listening at: [::]:60198
2022-01-18T17:21:55Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2022-01-18T17:21:55Z info layer=debugger launching process with args: [/var/task/hello]
could not launch process: fork/exec /var/task/hello: function not implemented
2022/01/18 17:21:55 exit status 1
18 Jan 2022 17:21:55,118 [ERROR] (rapid) Init failed error=Runtime exited with error: exit status 1 InvokeID=
API server listening at: [::]:60198
2022-01-18T17:21:55Z warning layer=rpc Listening for remote connections (connections are not authenticated nor encrypted)
2022-01-18T17:21:55Z info layer=debugger launching process with args: [/var/task/hello]
could not launch process: fork/exec /var/task/hello: function not implemented
2022/01/18 17:21:55 exit status 1
END RequestId: 473c16f3-4562-40aa-9a9f-1528fe87aaaa
REPORT RequestId: 473c16f3-4562-40aa-9a9f-1528fe87aaaa Init Duration: 1.18 ms Duration: 1041.97 ms Billed Duration: 1042 ms Memory Size: 128 MB Max Memory Used: 128 MB
Here's a related issue for the AWS VS Code Toolkit: https://github.com/aws/aws-toolkit-vscode/issues/2020
From what I remember, the issue is that the container is being emulated as x86 which Delve cannot handle. So I believe we'd need ARM support for Go images from SAM CLI.
@rli Can you try to help?
Still needs SAM CLI support https://github.com/aws/aws-sam-cli/issues/3283
Is there any progress on this? Getting this err on M1 as well
Any update on this issue?
This is blocked by https://github.com/aws/aws-sam-cli/issues/3283 . Consider upvoting 👍 that issue!