Repository navigation
Delve Debugger in Golang Lambda Container - #97
Conversation
|
Hmmm, yeah the only thing I don't like is that there are extra binaries as That said, I'm not really sure what other options there are – when I was initially working on Go support, I asked @sanathkr, David Nasi and @bmoffatt about debugging approaches, including delve, but I don't think we got anywhere beyond "users will need to add it themselves". Is there any way we can bundle delve together with the mock into a single |
|
Hm, not sure. We could probably bring it in as an import to |
|
It seems like it'd be pretty gnarly to bring in delve as a library and start the debugging service out of the Another option would be to have a completely separate container tag - something like |
|
Alright, I spent a little more time poking at this problem and here's the three paths forward -
@mhart thoughts on which option is preferable? I think the third is probably the most elegant and preserves the 'production-like' nature of the container. |
590a7dc to
595446f
Compare
|
I got into it and decided that the third one was the best and refactored things a bit. Good:
Less Good:
I think the pros outweigh the cons. |
|
Yeah, totally agree – that sounds like the best option. I'll look over it and see if any of the AWS ppl want to weigh in. |
| rand.Seed(time.Now().UTC().UnixNano()) | ||
|
|
||
| debugMode := flag.Bool("debug", false, "enables delve debugging") | ||
| delvePath := flag.String("delvePath", "/var/debug/dlv", "path to delve") |
There was a problem hiding this comment.
/var/debug seems too generic. I don't want the container to break when official Lambda runtime suddenly makes use of this path in the future.
Instead, can you make it something explicit (ugly?) like /tmp/lambci_debug_files
| RUN dep ensure | ||
| RUN GOARCH=amd64 GOOS=linux go build aws-lambda-mock.go | ||
|
|
||
|
|
change default for local delve path to something more explicit revert whitespace removal
5176ea6 to
bb858d5
Compare
|
addressed all of the outstanding comments, squashed + pushed. |
|
Awesome, merging |
|
Hmmm, this seems to have broken some things. I suspect it's the move from |
|
Fixed in a4a89a5 (I think) |
|
@austinlparker Was Delve flag |
|
At the time VSC didn't support Delve API v2, so I forced it to 1, that's the only reason IIRC. I'm sure they'd accept a PR for changing it. |
This change does the following:
dlvto the go lambda container image.This change is in support of aws/aws-sam-cli#281.
Please let me know if you'd prefer a different approach to this or have any other comments, thanks!