Hi Team,
I am using cdktf Go bindings to create some Dashboards on Datadog. While the code is working fine if I try to do the debugging using VS code and Delve debugger it fails with below error:
cdk.tf/go/stack/generated/DataDog/datadog/dashboard
:1: internal compiler error: NewBulk too big: nbit=85658 count=827225 nword=2677 size=2214481325
I was able to resolve this issue by creating an executing binary and then debugging directly which is optimized binary but this is a hassle as every time we need to create a binary for debugging to happen and also optimized binaries are not recommended since they may have missing or wrong variable values. I also saw this issue on Go’s github forum: cmd/compile: "internal compiler error: NewBulk too big" while running a program with dlv · Issue #56120 · golang/go · GitHub. This issue talks about similar condition but for AWS.
I would like to know if there is a way around here because this makes using Go quite unreliable for CDKTF. It seems this issue is coming because Delve runs the build command with a command like this go build --gcflags="all=-N -l" main.go
. Because of the gcflags -N -l it creates non-optimized binary and it fails because code in dashboard package for datadog cdktf go provider is just too big.
We are also considering using cdktf Go for AWS infra but this issue makes me think if we should do that?