[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 Feb 26, 2026
Merged
Conversation
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
gregestren
approved these changes
Feb 25, 2026
Merged
via the queue into
bazelbuild:release-9.1.0
with commit Feb 26, 2026
00039de
46 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The execution OS is determined by the specified test exec group, which can differ from the
testexec 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 upConstraintConstantsto support themacosalias for thedarwinOS 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_executableinBuildIntegrationTestfor a Windows host.Closes #28038.
PiperOrigin-RevId: 874626714
Change-Id: Icae167c5e58309258b3c73bac99796a512d2f26d
Commit 79fb843