Files
Andrei VaginandgVisor bot ce28a021f8 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: https://github.com/golang/go/issues/51430

PiperOrigin-RevId: 828145693
2025-11-04 14:55:59 -08:00

22 lines
411 B
Python

load("//tools:defs.bzl", "go_library")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
go_library(
name = "coverage",
srcs = [
"coverage.go",
"coverage_unsafe.go",
],
visibility = ["//:sandbox"],
deps = [
"//pkg/hostarch",
"//pkg/log",
"//pkg/sync",
"@io_bazel_rules_go//go/tools/coverdata",
],
)