bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.38k stars 656 forks source link

Rewrite `//go:cgo_ldflag` comments to relative paths in stdlib action #4005

Closed fmeum closed 2 months ago

fmeum commented 2 months ago

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

The linker flags passed to the stdlib action need to contain absolute paths to work in Go's own build environment, but should not pollute the resulting archives with absolute paths. Since cgo persists the linker flags in //go:cgo_ldflag comments, those are now rewritten by the (renamed) filterbuildid command.

Which issues(s) does this PR fix?

Fixes #3994

Other notes for review

fmeum commented 2 months ago

4009 is a more general solution