Skip to content

[8.9.0] Only depend on the coverage wrapper when collecting coverage (#32015) - #32355

Merged
meteorcloudy merged 1 commit into
bazelbuild:release-8.9.0from
iancha1992:cp32013
Nov 3, 2026
Merged

meteorcloudy merged 1 commit into
bazelbuild:release-8.9.0from
iancha1992:cp32013

Conversation

@iancha1992

Copy link
Copy Markdown
Member

Description

Starlark test rules now only depend on @bazel_tools//tools/test:collect_coverage if --collect_code_coverage is set. The dependency is late-bound, matching how the other coverage tools are handled.

Motivation

Since #26603, @bazel_tools//tools/test:collect_coverage is an sh_binary, which fails analysis on Windows if no shell is available. Since every Starlark test rule had an unconditional implicit dependency on it, all tests failed analysis on Windows machines without Bash, even without coverage.

Fixes #32011

Build API Changes

No

Release Notes

RELNOTES: Tests on Windows no longer require Bash unless coverage is collected.

Closes #32015

COPYBARA_INTEGRATE_REVIEW=#32015 from fmeum:ccr-90e0c8f5-ic1d0m 1d0e2d4 PiperOrigin-RevId: 1010501355
Change-Id: I13117a753e72ddad155925e8254437f78c3e72f4

Description

Motivation

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: None

Commit d458fab

…ild#32015)

### Description

Starlark test rules now only depend on `@bazel_tools//tools/test:collect_coverage` if `--collect_code_coverage` is set. The dependency is late-bound, matching how the other coverage tools are handled.

### Motivation

Since bazelbuild#26603, `@bazel_tools//tools/test:collect_coverage` is an `sh_binary`, which fails analysis on Windows if no shell is available. Since every Starlark test rule had an unconditional implicit dependency on it, all tests failed analysis on Windows machines without Bash, even without coverage.

Fixes bazelbuild#32011

### Build API Changes

No

### Release Notes

RELNOTES: Tests on Windows no longer require Bash unless coverage is collected.

Closes bazelbuild#32015

COPYBARA_INTEGRATE_REVIEW=bazelbuild#32015 from fmeum:ccr-90e0c8f5-ic1d0m 1d0e2d4
PiperOrigin-RevId: 1010501355
Change-Id: I13117a753e72ddad155925e8254437f78c3e72f4
@iancha1992 iancha1992 added team-Configurability platforms, toolchains, cquery, select(), config transitions awaiting-review PR is awaiting review from an assigned reviewer labels Nov 2, 2026
@iancha1992
iancha1992 requested a review from a team as a code owner November 2, 2026 22:53
@iancha1992
iancha1992 enabled auto-merge November 2, 2026 22:54
@iancha1992

Copy link
Copy Markdown
Member Author

@c-mita @meteorcloudy
Cherry-pick of d458fab (#32015) into release-8.9.0.

The following files had merge conflicts or required manual adjustments for release-8.9.0 and should be reviewed more closely:

  • src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleClassFunctions.java: Used .cfg(ExecutionTransitionFactory.createFactory()) on :collect_coverage_script to match the other test attributes on release-8.9.0 (instead of ExecutionTransitionFactory.createFactory(DEFAULT_TEST_RUNNER_EXEC_GROUP_NAME) from master).
  • src/test/java/com/google/devtools/build/lib/analysis/test/TestActionBuilderTest.java: Updated the test runner from @RunWith(JUnit4.class) to @RunWith(TestParameterInjector.class) and imported TestParameter/TestParameterInjector for testCollectCoverageScriptOnlyDependedOnWithCoverage.

@meteorcloudy
meteorcloudy disabled auto-merge November 3, 2026 10:08
@meteorcloudy
meteorcloudy added this pull request to the merge queue Nov 3, 2026
Merged via the queue into bazelbuild:release-8.9.0 with commit 817839f Nov 3, 2026
43 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Configurability platforms, toolchains, cquery, select(), config transitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants