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

Running RIE with Go-based Lambda + Delve debugger? #139

Open
skyzyx opened this issue Dec 30, 2024 · 0 comments
Open

Running RIE with Go-based Lambda + Delve debugger? #139

skyzyx opened this issue Dec 30, 2024 · 0 comments

Comments

@skyzyx
Copy link

skyzyx commented Dec 30, 2024

I'm currently using RIE to run my compiled Go binary.

#!/bin/sh

if [ -z "${AWS_LAMBDA_RUNTIME_API}" ]; then
    exec /usr/local/bin/aws-lambda-rie /var/runtime/bootstrap
else
    exec /var/runtime/bootstrap
fi

However, I also want to run Delve, the Go debugger, against my binary.

exec dlv exec --headless --listen :4040 /var/runtime/bootstrap

I've tried combining the commands in different ways to get both RIE and Delve to work, to no avail.

Example: Delve first

exec dlv exec --headless --listen :4040 /usr/local/bin/aws-lambda-rie /var/runtime/bootstrap

In this case, Delve tries to debug RIE.

Example: RIE first

exec /usr/local/bin/aws-lambda-rie dlv exec --headless --listen :4040 /var/runtime/bootstrap

In this case, RIE only seems to run Delve during the lifetime of a request to my Lambda function.

Example: Running in background and capturing PID

PID="$(exec /usr/local/bin/aws-lambda-rie /var/runtime/bootstrap &)"

dlv attach --headless --listen :4040 $PID

In this case, RIE doesn't move into the background. It stays in the foreground, and Delve never runs.

Any ideas would be welcome.

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

No branches or pull requests

1 participant