Skip to content

Conversation

@copybara-service
Copy link

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

 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
@copybara-service copybara-service bot added the exported Issue was exported automatically label Oct 29, 2025
@copybara-service copybara-service bot closed this Nov 6, 2025
@copybara-service copybara-service bot deleted the test/cl825669734 branch November 6, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants