Delve builds its binaries using -gcflags='-N -l' to disable inlining and optimizations. This works well until the user separately does a go install or a go build -i at which point any subsequent build will pick up the cached version of all unchanged dependencies, built with optimizations turned on, leading to surprising behavior.
Attempting to circumvent this problem by passing -a to build fail because of #18774.
Considering that #18774 has existed for a while (the first reference I found is #12055) would it be possible to make build pick up cached packages only when compiler flags match, making an exception for runtime?
Delve builds its binaries using
-gcflags='-N -l'to disable inlining and optimizations. This works well until the user separately does ago installor ago build -iat which point any subsequent build will pick up the cached version of all unchanged dependencies, built with optimizations turned on, leading to surprising behavior.Attempting to circumvent this problem by passing
-ato build fail because of #18774.Considering that #18774 has existed for a while (the first reference I found is #12055) would it be possible to make build pick up cached packages only when compiler flags match, making an exception for runtime?