Commit 0186dc5f authored by Zain Asgar's avatar Zain Asgar
Browse files

[Fix Master] Fix coverage between go/cpp code

Summary:
This is currently breaking master, likely because of the Go 1.13 upgrade. With this upgrade it
seems that we need to explicitly pass in gcov flags.

Test Plan: bazel test //... and bazel coverage //src/...

Reviewers: oazizi, philkuz, #engineering

Reviewed By: oazizi, #engineering

Differential Revision: https://phab.corp.pixielabs.ai/D1916

GitOrigin-RevId: 83631e5bf6c51fdc78e6068f42635ee05991c4ba
parent 82ab122e
Showing with 13 additions and 1 deletion
+13 -1
......@@ -86,6 +86,7 @@ build --cxxopt -std=c++17
coverage --cxxopt -fprofile-arcs
coverage --cxxopt -ftest-coverage
coverage --instrument_test_targets
coverage --define PL_COVERAGE=true
# Use stable GIT build tag by default.
build --define BUNDLE_VERSION={STABLE_BUILD_TAG}
......
......@@ -9,3 +9,11 @@ config_setting(
name = "debug_tcmalloc",
values = {"define": "tcmalloc=debug"},
)
config_setting(
name = "coverage_enabled",
values = {
"define": "PL_COVERAGE=true",
},
visibility = ["//visibility:public"],
)
......@@ -251,7 +251,10 @@ def tcmalloc_external_deps(repository):
def pl_cgo_library(**kwargs):
if "cgo" in kwargs and kwargs["cgo"] and "clinkopts" not in kwargs:
kwargs["clinkopts"] = pl_linkopts()
kwargs["clinkopts"] = pl_linkopts() + select({
"@pl//bazel:coverage_enabled": ["-lgcov --coverage"],
"//conditions:default": [],
})
kwargs["toolchains"] = ["@bazel_tools//tools/cpp:current_cc_toolchain"]
go_library(**kwargs)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment