[bazel] Enable windows builds?

This commit is contained in:
David Zbarsky
2026-01-20 10:32:28 -05:00
parent 6a57d7980b
commit e20cb6c259
6 changed files with 546 additions and 66 deletions
+13 -4
View File
@@ -36,9 +36,10 @@ jobs:
target: aarch64-unknown-linux-musl
- os: ubuntu-24.04
target: x86_64-unknown-linux-musl
# TODO: Enable Windows once we fix the toolchain issues there.
#- os: windows-latest
# target: x86_64-pc-windows-gnullvm
# Windows
- os: windows-latest
target: x86_64-pc-windows-gnullvm
runs-on: ${{ matrix.os }}
# Configure a human readable name for each job
@@ -61,6 +62,14 @@ jobs:
shell: pwsh
run: Copy-Item (Get-Command dotslash).Source -Destination "$env:LOCALAPPDATA\Microsoft\WindowsApps\dotslash.exe"
- name: Where is git (pwsh)
if: runner.os == 'Windows'
shell: pwsh
run: |
Get-Command git | Format-List *
(Get-Command git).Source
where.exe git
# Install Bazel via Bazelisk
- name: Set up Bazel
uses: bazelbuild/setup-bazelisk@v3
@@ -95,7 +104,7 @@ jobs:
shell: pwsh
run: |
# Use a very short path to reduce argv/path length issues.
"BAZEL_STARTUP_ARGS=--output_user_root=C:\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"BAZEL_STARTUP_ARGS=--output_user_root=D:\" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: bazel test //...
env:
+9
View File
@@ -2,6 +2,15 @@ common --remote_download_minimal
common --nobuild_runfile_links
common --keep_going
# By default runfiles directories are disabled on Windows but we
# don't read runfiles manifests, so force them on.
common --enable_runfiles
# Rearrange caches on Windows so they're on the same volume as the checkout.
common:windows --disk_cache=D:/a/.cache/bazel-disk-cache
common:windows --repo_contents_cache=D:/a/.cache/bazel-repo-contents-cache
common:windows --repository_cache=D:/a/.cache/bazel-repo-cache
# We prefer to run the build actions entirely remotely so we can dial up the concurrency.
# We have platform-specific tests, so we want to execute the tests on all platforms using the strongest sandboxing available on each platform.