bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.37k stars 651 forks source link

Don't ignore the return value of runfiles.merge_all() #3918

Closed EdSchouten closed 5 months ago

EdSchouten commented 5 months ago

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

I'm running into an issue where data dependencies of C/C++ libraries don't end up being placed in the input roots of Go based tests that depend on these libraries via cgo. It turns out that this is caused by emit_archive() not properly merging runfiles from all GoArchive dependencies.

I tried to make a small reproduction case of this under tests/core/cgo, but for the life of me I can't seem to reproduce this purely within the confines of io_bazel_rules_go. Maybe this can only be observed when cross compiling or using custom C++ toolchains?

Which issues(s) does this PR fix?

Couldn't find any.

Other notes for review