Skip to content

Commit 5518954

Browse files
podtserkovskiyfacebook-github-bot
authored andcommitted
Ignore race flag if cgo disabled when doing go list
Summary: That's a suboptimal fix, but unfortunately we have to manually disable CGO for some of third-party libraries. This fix can be removed if we get rid of `override_cgo_enabled` flag on `go_library` rule Differential Revision: D83657025 fbshipit-source-id: f733728325e6c0e33e6f1d8018d2ea89f450d0f3
1 parent 70c9216 commit 5518954

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prelude/go/go_list.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def go_list(ctx: AnalysisContext, pkg_name: str, srcs: list[Artifact], package_r
8181
"-e",
8282
"-json=" + ",".join(required_felds),
8383
["-tags", ",".join(all_tags) if all_tags else []],
84-
["-race"] if go_toolchain.race else [],
85-
["-asan"] if go_toolchain.asan else [],
84+
["-race"] if go_toolchain.race and cgo_enabled else [],
85+
["-asan"] if go_toolchain.asan and cgo_enabled else [],
8686
".",
8787
]
8888

0 commit comments

Comments
 (0)