Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does aws-sam-cli not support debug mode on os runtime (provided.al2 / provided.al2023)? #7291

Open
HLN177 opened this issue Jul 26, 2024 · 4 comments
Labels

Comments

@HLN177
Copy link

HLN177 commented Jul 26, 2024

Hey,

As the title said, why does aws-sam-cli not support debug mode on os runtime (provided.al2 / provided.al2023)?

Currently I'm trying to use Golang to write lambda functions, and the current aws support for go is linux os runtime (provided.al2023).

And yes, aws-sam-cli does serve the Go lambda function by mocking a api gateway environment (using command like 'start-api').

I was trying to investigate is a way to debug Go lambda with 'Step-Through' break point stuff, and I was imagining is like maybe I could achieve this by using debug mode of sam-cli and delve debugger.

But it seems sam-cli doesn't support debug mode on os runtime. Why sam-cli doesn't have this feature and what is the difficulty?

Btw, does anyone know a way to make the 'step-through' break point debug for Golang at this case?

@HLN177 HLN177 added the stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. label Jul 26, 2024
@hnnasit
Copy link
Contributor

hnnasit commented Aug 1, 2024

Hi @HLN177, thanks for opening the issue. I do see in the vscode toolkits docs page that debugging is supported for go1.x. Are you looking for a particular IDE to perform step-through debugging?

@hnnasit hnnasit added type/question and removed stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Aug 1, 2024
@HLN177
Copy link
Author

HLN177 commented Aug 2, 2024

Hi @HLN177, thanks for opening the issue. I do see in the vscode toolkits docs page that debugging is supported for go1.x. Are you looking for a particular IDE to perform step-through debugging?

Hi @hnnasit, thanks for you reply.

At the moment, I am using vscode to develop go lambda function now. I did see this vscode toolkits and it seems this tool still only supports deprecated go1.X runtime, but the aws lambda only provide al2023 os runtime environment for Go now.

And yes, we could still use the old go1.X runtime for development and then use al2023 os runtime for production. However, this can lead to some follow-up problems due to inconsistency between the development and production environments.

And this isn't just a problem with go. Other languages that use the OS runtime in aws lambda, like C and rust, may also experience this problem as well.

Do you have any solution for this case?

@hnnasit
Copy link
Contributor

hnnasit commented Aug 2, 2024

Thanks @HLN177, I see what you mean. I'm marking this as a feature request.

@HLN177
Copy link
Author

HLN177 commented Aug 2, 2024

Thanks @HLN177, I see what you mean. I'm marking this as a feature request.

Thanks for your help. May I ask when would this kind of feature be implemented in general? Actually I am trying to customize the source code of aws-sam-cli to achieve my requirement atm. I am think if I could build the docker image with a kind of debugger server and expose a debug port. Do you think it is a appropriate approach for this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants