You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in compilepkg.go, when we invoke go tool compile, we are unconditionally adding -linkobj to create 2 separate artifacts: .x for downstream library compilation and .a for downstream binary linking.
This is efficient for go_library, but for the compilation which happens under go_test and go_binary, the output artifact(s) will not be used for any other downstream actions except GoLink for that test/binary to create the final Go executable.
So for the GoCompilePkg action under go_test and go_binary, it will be better if we remove -linkobj and only generate the .a file. In other words, we should only be using -linkobj when the downstream consumer of the artifact is unclear, such as for the GoCompilePkg action under go_library or go_proto_library.
The text was updated successfully, but these errors were encountered:
Currently in
compilepkg.go
, when we invokego tool compile
, we are unconditionally adding-linkobj
to create 2 separate artifacts:.x
for downstream library compilation and.a
for downstream binary linking.This is efficient for
go_library
, but for the compilation which happens undergo_test
andgo_binary
, the output artifact(s) will not be used for any other downstream actions except GoLink for that test/binary to create the final Go executable.So for the GoCompilePkg action under
go_test
andgo_binary
, it will be better if we remove-linkobj
and only generate the.a
file. In other words, we should only be using-linkobj
when the downstream consumer of the artifact is unclear, such as for the GoCompilePkg action undergo_library
orgo_proto_library
.The text was updated successfully, but these errors were encountered: