From 9b13e100254b65f7b3e19f81e41d4df65071a3f6 Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Fri, 9 Jan 2026 15:18:11 -0500 Subject: [PATCH] [bazel] Enable windows builds? --- .bazelrc | 3 ++- .github/workflows/bazel.yml | 14 +++++--------- MODULE.bazel | 10 ++++++---- MODULE.bazel.lock | 7 ++++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.bazelrc b/.bazelrc index 7f561aa9ee..ba77441a00 100644 --- a/.bazelrc +++ b/.bazelrc @@ -7,7 +7,7 @@ common --disk_cache=~/.cache/bazel-disk-cache common --repo_contents_cache=~/.cache/bazel-repo-contents-cache common --repository_cache=~/.cache/bazel-repo-cache common --remote_cache_compression -startup --experimental_remote_repo_contents_cache +#startup --experimental_remote_repo_contents_cache common --experimental_platform_in_output_dir @@ -17,6 +17,7 @@ common --noenable_runfiles common --enable_platform_specific_config common:linux --host_platform=//:local_linux common:windows --host_platform=//:local_windows + common --@rules_cc//cc/toolchains/args/archiver_flags:use_libtool_on_macos=False common --@toolchains_llvm_bootstrapped//config:experimental_stub_libgcc_s diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index b5e91d7f22..49bf449762 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -10,11 +10,6 @@ on: - main workflow_dispatch: -concurrency: - # Cancel previous actions from the same PR or branch except 'main' branch. - # See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info. - group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}} - cancel-in-progress: ${{ github.ref_name != 'main' }} jobs: test: strategy: @@ -36,9 +31,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 @@ -95,7 +91,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: diff --git a/MODULE.bazel b/MODULE.bazel index f12eeb8884..015e4369a5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,5 +1,5 @@ bazel_dep(name = "platforms", version = "1.0.0") -bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.5.3") +bazel_dep(name = "toolchains_llvm_bootstrapped", version = "0.5.4") single_version_override( module_name = "toolchains_llvm_bootstrapped", patch_strip = 1, @@ -38,9 +38,9 @@ bazel_dep(name = "rules_rs", version = "0.0.23") # Special toolchains branch archive_override( module_name = "rules_rs", - integrity = "sha256-YbDRjZos4UmfIPY98znK1BgBWRQ1/ui3CtL6RqxE30I=", - strip_prefix = "rules_rs-6cf3d940fdc48baf3ebd6c37daf8e0be8fc73ecb", - url = "https://github.com/dzbarsky/rules_rs/archive/6cf3d940fdc48baf3ebd6c37daf8e0be8fc73ecb.tar.gz", + integrity = "sha256-C5nTK7oyhrP+qWGx+AXHlWk4hz6PlC2F9sTvO/gM77g=", + strip_prefix = "rules_rs-7a47423f9f52de881b82beda8b1d8a76968775aa", + url = "https://github.com/dzbarsky/rules_rs/archive/7a47423f9f52de881b82beda8b1d8a76968775aa.tar.gz", ) rules_rust = use_extension("@rules_rs//rs/experimental:rules_rust.bzl", "rules_rust") @@ -68,10 +68,12 @@ crate.from_cargo( "aarch64-unknown-linux-musl", "aarch64-apple-darwin", "aarch64-pc-windows-gnullvm", + "aarch64-pc-windows-msvc", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-apple-darwin", "x86_64-pc-windows-gnullvm", + "x86_64-pc-windows-msvc", ], ) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 7e43f74cbf..07415816f9 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -49,7 +49,8 @@ "https://bcr.bazel.build/modules/bazel_features/1.9.0/MODULE.bazel": "885151d58d90d8d9c811eb75e3288c11f850e1d6b481a8c9f766adee4712358b", "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", "https://bcr.bazel.build/modules/bazel_lib/3.0.0/MODULE.bazel": "22b70b80ac89ad3f3772526cd9feee2fa412c2b01933fea7ed13238a448d370d", - "https://bcr.bazel.build/modules/bazel_lib/3.0.0/source.json": "895f21909c6fba01d7c17914bb6c8e135982275a1b18cdaa4e62272217ef1751", + "https://bcr.bazel.build/modules/bazel_lib/3.2.0/MODULE.bazel": "39b50d94b9be6bda507862254e20c263f9b950e3160112348d10a938be9ce2c2", + "https://bcr.bazel.build/modules/bazel_lib/3.2.0/source.json": "a6f45a903134bebbf33a6166dd42b4c7ab45169de094b37a85f348ca41170a84", "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", @@ -217,8 +218,8 @@ "https://bcr.bazel.build/modules/tar.bzl/0.6.0/MODULE.bazel": "a3584b4edcfafcabd9b0ef9819808f05b372957bbdff41601429d5fd0aac2e7c", "https://bcr.bazel.build/modules/tar.bzl/0.6.0/source.json": "4a620381df075a16cb3a7ed57bd1d05f7480222394c64a20fa51bdb636fda658", "https://bcr.bazel.build/modules/toolchains_llvm_bootstrapped/0.5.2/MODULE.bazel": "f7c822cea99caef928d7cbe695498096e53c4b2c0ea45997e9a64bf6b77b43b0", - "https://bcr.bazel.build/modules/toolchains_llvm_bootstrapped/0.5.3/MODULE.bazel": "902ab5c2bc9eff04df45d17aac3c5c642afaad2d4569dcfdc86d0256f68f18e0", - "https://bcr.bazel.build/modules/toolchains_llvm_bootstrapped/0.5.3/source.json": "8c03ccd25188ecf8baf4a97a8b42c507ff592d917bcbc06333b9c82d18c7ef13", + "https://bcr.bazel.build/modules/toolchains_llvm_bootstrapped/0.5.4/MODULE.bazel": "a23e1b57a4deac3d8bd617f3bbdb1e88198a5a7dfeadd7a4f2a43e87f419ad2a", + "https://bcr.bazel.build/modules/toolchains_llvm_bootstrapped/0.5.4/source.json": "335ee2e79e7338a2941121a2cbeafe5eed28a6e309c96f8ab66324b5aa906d13", "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", "https://bcr.bazel.build/modules/with_cfg.bzl/0.12.0/MODULE.bazel": "b573395fe63aef4299ba095173e2f62ccfee5ad9bbf7acaa95dba73af9fc2b38", "https://bcr.bazel.build/modules/with_cfg.bzl/0.12.0/source.json": "3f3fbaeafecaf629877ad152a2c9def21f8d330d91aa94c5dc75bbb98c10b8b8",