Skip to content

Support Windows-hosted Bazel builds with Linux remote execution - #30121

Draft
dzbarsky wants to merge 14 commits into
bazelbuild:masterfrom
dzbarsky:zbarsky/windows
Draft

Support Windows-hosted Bazel builds with Linux remote execution#30121
dzbarsky wants to merge 14 commits into
bazelbuild:masterfrom
dzbarsky:zbarsky/windows

Conversation

@dzbarsky

@dzbarsky dzbarsky commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • replace shell-dependent copy, archive, packaging, and external dependency actions with declared tools or Bazel actions
  • resolve bootstrap tools and paths for the execution platform when Bazel runs on Windows and actions run remotely on Linux
  • run automatic test XML generation through the resolved test shell
  • build the Xcode locator only with platform-compatible targets
  • add a Windows 2025 workflow that builds Bazel with Linux remote execution and exercises automatic XML generation

Motivation

A Bazel invocation hosted on Windows could select Linux remote execution but still pass Windows host paths to actions, launch Unix scripts as Windows executables, or depend on undeclared Unix utilities. These failures prevented //src:bazel from building reliably and broke automatic XML generation for remotely executed shell tests that did not write junit.xml.

Build API Changes

No.

Validation

  • git diff --check origin/master...HEAD
  • python3 -m json.tool MODULE.bazel.lock
  • python3 -m json.tool maven_install.json
  • the added windows-remote-exec.yml workflow exercises the original Windows-host/Linux-execution failure mode in CI

The rules_python executable-zip fix is also proposed upstream in
bazel-contrib/rules_python#3890.

Release Notes

RELNOTES: None

rickeylev added a commit to rickeylev/rules_python that referenced this pull request Jul 3, 2026
…t windows building (bazel-contrib#3890)

The legacy self-executable zip action invokes `cat` through `run_shell`.
The
action does not declare `cat`, and a Windows-hosted Bazel invocation
cannot use
that action reliably when the selected execution platform is Linux.

Run the existing `exe_zip_maker` through `actions_run` instead. This
selects the
helper and Python runtime from the execution configuration, preserves
the
prelude-plus-zip output format, and removes the ambient shell utility
dependency. A news entry documents the fix.

The Bazel integration that motivated this fix is

[bazelbuild/bazel#30121](bazelbuild/bazel#30121).

---------

Co-authored-by: Richard Levasseur <richardlev@gmail.com>
github-actions Bot pushed a commit to bazel-contrib/rules_python that referenced this pull request Jul 3, 2026
…t windows building (#3890)

The legacy self-executable zip action invokes `cat` through `run_shell`.
The
action does not declare `cat`, and a Windows-hosted Bazel invocation
cannot use
that action reliably when the selected execution platform is Linux.

Run the existing `exe_zip_maker` through `actions_run` instead. This
selects the
helper and Python runtime from the execution configuration, preserves
the
prelude-plus-zip output format, and removes the ambient shell utility
dependency. A news entry documents the fix.

The Bazel integration that motivated this fix is

[bazelbuild/bazel#30121](bazelbuild/bazel#30121).

---------

Co-authored-by: Richard Levasseur <richardlev@gmail.com>
(cherry picked from commit 1d99f70)

Work towards #3867
copybara-service Bot pushed a commit that referenced this pull request Jul 10, 2026
## Summary

Replace the `builtins_bzl.zip` shell `genrule` with a dedicated `builtins_zip` Starlark rule.

This focused change is extracted from [#30121](#30121) for independent review.

## Motivation

The existing `genrule` discovers its source root with shell commands and invokes `zip_builtins.sh`, which depends on shell path handling. `builtins_zip` declares the zipper tool and source inputs directly, preserving the `builtins_bzl/<relative path>` archive layout without shell path handling.

## Build API Changes

No.

## Validation

- `buildifier -mode=check src/main/starlark/builtins_bzl/BUILD src/builtins_zip.bzl`
- `bazel build --jobs=2 //src/main/starlark/builtins_bzl:builtins_bzl_zip`
- compared `unzip -Z1` output to the sorted `**/*.bzl` source list; entries matched exactly
- `bazel aquery` confirmed `_zipper` is an execution-configured declared tool and all archive mappings are correct

## Release Notes

RELNOTES: None

Closes #30123.

PiperOrigin-RevId: 945822546
Change-Id: I493f53dcd6422cb52300cb859d92c1d498534b41
@dzbarsky
dzbarsky force-pushed the zbarsky/windows branch 7 times, most recently from 105826d to f1ea28d Compare August 6, 2026 05:11
@dzbarsky
dzbarsky force-pushed the zbarsky/windows branch 2 times, most recently from 58c7505 to 4b008e5 Compare August 17, 2026 04:19
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.

1 participant