Trying to find info but coming up short. Is there ...
# general
d
Trying to find info but coming up short. Is there a way to pass ldflags to the Go backend like with pants v1?
1
f
What’s the use case? cgo?
d
cgo and passing variable overrides
but most importantly, trying to just create a statically linked binary
f
The v2 Go backend does not currently support cgo. https://github.com/pantsbuild/pants/issues/14338
d
ok
f
I had started work on cgo support, but all it is currently is a very messy in-progress local branch.
d
ah ok. Is there a way to create statically linked binaries?
f
And working on that branch has stalled since it is not currently a part of any of my current priorities.
Re linker flags, the Go backend does not currently provide a way to set them. Adding them is straight-forward enough to do for a suitably motivated contributor since it would just involve adding an option and then using that option in the applicable invocation of
go tool link
.
d
ok sounds good, thanks!
f
so if you want to be that “suitably motivated contributor”, let me know and I can point at what changes to Pants are necessary.
👍 2