Skip to content

Commit

Permalink
Don't ignore the return value of runfiles.merge_all() (#3918)
Browse files Browse the repository at this point in the history
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. Maybe this can
only be observed when cross compiling or using custom C++ toolchains?
  • Loading branch information
EdSchouten authored Apr 11, 2024
1 parent a5bc531 commit c40b336
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/private/actions/archive.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def emit_archive(go, source = None, _recompile_suffix = "", recompile_internal_d
files.append(a.runfiles)
if a.source.mode != go.mode:
fail("Archive mode does not match {} is {} expected {}".format(a.data.label, mode_string(a.source.mode), mode_string(go.mode)))
runfiles.merge_all(files)
runfiles = runfiles.merge_all(files)

importmap = "main" if source.library.is_main else source.library.importmap
importpath, _ = effective_importpath_pkgpath(source.library)
Expand Down

0 comments on commit c40b336

Please sign in to comment.