Skip to content

[9.1.0] Fix test and shell execution OS logic (https://github.com/bazelbuild/bazel/pull/28038)#28801

Merged
iancha1992 merged 1 commit intobazelbuild:release-9.1.0from
bazel-io:cp28038-9.1.0
Feb 26, 2026
Merged

[9.1.0] Fix test and shell execution OS logic (https://github.com/bazelbuild/bazel/pull/28038)#28801
iancha1992 merged 1 commit intobazelbuild:release-9.1.0from
bazel-io:cp28038-9.1.0

Conversation

@bazel-io
Copy link
Member

The execution OS is determined by the specified test exec group, which can differ from the test exec group as well as the test rule's default execution group. Also renames some helper methods to make this class of bugs less likely and clean up ConstraintConstants to support the macos alias for the darwin OS constraint value.

As a consequence of this refactoring, it became clear that the shell path was determined by the host OS when the execution OS is Linux or macOS, resulting in a Windows host trying to use the Windows shell path when running e.g. a genrule on Linux. In a surprising turn of events, this behavior is what holds Bazel's own Java integration tests together on Windows - for now. As a result, the fix is accompanied by a manual override on --shell_executable in BuildIntegrationTest for a Windows host.

Closes #28038.

PiperOrigin-RevId: 874626714
Change-Id: Icae167c5e58309258b3c73bac99796a512d2f26d

Commit 79fb843

The execution OS is determined by the specified test exec group, which can differ from the `test` exec group as well as the test rule's default execution group. Also renames some helper methods to make this class of bugs less likely and clean up `ConstraintConstants` to support the `macos` alias for the `darwin` OS constraint value.

As a consequence of this refactoring, it became clear that the shell path was determined by the host OS when the execution OS is Linux or macOS, resulting in a Windows host trying to use the Windows shell path when running e.g. a genrule on Linux. In a surprising turn of events, this behavior is what holds Bazel's own Java integration tests together on Windows - for now. As a result, the fix is accompanied by a manual override on `--shell_executable` in `BuildIntegrationTest` for a Windows host.

Closes bazelbuild#28038.

PiperOrigin-RevId: 874626714
Change-Id: Icae167c5e58309258b3c73bac99796a512d2f26d
@bazel-io bazel-io requested a review from a team as a code owner February 25, 2026 19:24
@bazel-io bazel-io added team-Configurability platforms, toolchains, cquery, select(), config transitions awaiting-review PR is awaiting review from an assigned reviewer labels Feb 25, 2026
@bazel-io bazel-io requested a review from gregestren February 25, 2026 19:24
@iancha1992 iancha1992 enabled auto-merge February 25, 2026 19:26
@iancha1992 iancha1992 added this pull request to the merge queue Feb 25, 2026
Merged via the queue into bazelbuild:release-9.1.0 with commit 00039de Feb 26, 2026
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Feb 26, 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.

4 participants