You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature
Currently, there is an -ldflags argument that passes arguments directly to go build during compilation. This would aim to add a parallel for the gcflags build flags setting as well.
What problem does this feature address?
While there are probably other uses out there that I don't know about, the once instance of this that stands out to me is removing compiler optimizations from built code for debugging. Currently, trying to launch a compiled magefile binary using dlv results in often subpar information due to compiler optimizations, and the means of removing said optimizations require passing gcflags arguments.
Additional context
While a separate flag could be made to disable compiler optimizations, this would be a more general-purpose solution.
Another option would be adding a general "build" flag that passes on its arguments directly to go build, though that might pose backwards compatibility issues.
For the record, the debug setup I am using simply has mage handle compiling the binary and dlv run the finished product afterwards.
Describe the feature
Currently, there is an
-ldflags
argument that passes arguments directly to go build during compilation. This would aim to add a parallel for thegcflags
build flags setting as well.What problem does this feature address?
While there are probably other uses out there that I don't know about, the once instance of this that stands out to me is removing compiler optimizations from built code for debugging. Currently, trying to launch a compiled magefile binary using
dlv
results in often subpar information due to compiler optimizations, and the means of removing said optimizations require passinggcflags
arguments.Additional context
While a separate flag could be made to disable compiler optimizations, this would be a more general-purpose solution.
Another option would be adding a general "build" flag that passes on its arguments directly to
go build
, though that might pose backwards compatibility issues.For the record, the debug setup I am using simply has mage handle compiling the binary and
dlv
run the finished product afterwards.mage -compile ./magefile-debug dlv exec magefiles/magefile-debug
In the event this already exists, I will be very sad.
The text was updated successfully, but these errors were encountered: