Skip to content

Conversation

@KrishnaM256
Copy link
Contributor

Summary

This PR enables Java code coverage to work properly on Windows by adding the coverage_main_class to the launch_info metadata in bazel_java_binary.bzl. Without this addition, Bazel fails to properly instrument and run Java binaries with coverage enabled on Windows platforms.

Changes

  • Added coverage_main_class to launch_info in bazel_java_binary.bzl to explicitly define the main class used during coverage runs.

Motivation

  • Before this fix, attempts to run Java coverage tests on Windows would not produce proper coverage output.
  • This is a step toward resolving bazelbuild/bazel#18839.

@KrishnaM256 KrishnaM256 requested review from a team and comius as code owners August 6, 2025 09:39
Copy link
Contributor

@fmeum fmeum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copybara-service copybara-service bot closed this in 45061b3 Aug 7, 2025
@KrishnaM256
Copy link
Contributor Author

Hi! I’d like to kindly request a new release of rules_java that includes this fix, as we’re depending on it to enable Java code coverage on Windows in Bazel.
A tagged release would help us integrate the fix cleanly.

copybara-service bot pushed a commit that referenced this pull request Aug 7, 2025
Context: #311 (comment)

(ignore-relnotes)

PiperOrigin-RevId: 792147204
Change-Id: Ic881922527848bf51e785cf6d275eebcbe55ab7f
@hvadehra
Copy link
Member

hvadehra commented Aug 7, 2025

https://github.com/bazelbuild/rules_java/releases/tag/8.15.1

@KrishnaM256
Copy link
Contributor Author

https://github.com/bazelbuild/rules_java/releases/tag/8.15.1

Thank you! Appreciate the quick release 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants