bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.39k stars 664 forks source link

Linking cgo binaries fails. #4135

Open filmil opened 1 month ago

filmil commented 1 month ago

What version of rules_go are you using?

Top-of-tree.

What version of gazelle are you using?

What version of Bazel are you using?

0.34.0

Does this issue reproduce with the latest releases of all the above?

I think so.

What operating system and processor architecture are you using?

Linux on x86_64

Any other potentially useful information about your toolchain?

What did you do?

Attempted to build a binary that requires a C++ .a static library.

What did you expect to see?

Things link just fine.

What did you see instead?

Unresolved symbols during link.

See discussion at: https://groups.google.com/g/bazel-discuss/c/XOERsY0-ceU

I was able to build after adding: https://github.com/bazelbuild/rules_go/pull/4134 and modifying the client code as: https://github.com/thx123/bazel-cgo/pull/1/

Once done, things compile as one would expect. Video proof: https://photos.app.goo.gl/FeVhkqHNnngMQTv77