Skip to content

Commit d70d18c

Browse files
avagingvisor-bot
authored andcommitted
pkg/coverage: adopt new coverage interface for kcov
This change updates the kcov implementation to use the new Go coverage interface provided by the `internal/coverage` package. The previous implementation relied on `coverdata.Blocks`, which is part of the older coverage tooling. The new implementation uses `runtime/coverage.WriteCounters` to get the raw coverage data and then decodes it using `decodecounter.NewDecoder`. This approach is aligned with the modern Go coverage infrastructure. This change requires a patched Go compiler that allows importing internal packages. This is a temporary measure until the golang team provides a public API. More details can be found here: golang/go#51430 FUTURE_COPYBARA_INTEGRATE_REVIEW=#12256 from avagin:kcov-v2-main 33081ed PiperOrigin-RevId: 825669734
1 parent 9095071 commit d70d18c

File tree

2 files changed

+198
-116
lines changed

2 files changed

+198
-116
lines changed

pkg/coverage/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ go_library(
1111
visibility = ["//:sandbox"],
1212
deps = [
1313
"//pkg/hostarch",
14+
"//pkg/log",
1415
"//pkg/sync",
1516
"@io_bazel_rules_go//go/tools/coverdata",
1617
],

0 commit comments

Comments
 (0)