From dd2cd686b16c639f59dace4d81dc780d33ec5511 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 25 Feb 2025 09:35:46 +0100 Subject: [PATCH] feat(bazel): still support cross-compiling for Windows This allows us to compile the Angular CLI tests for Windows target platform, allowing us to execute the CLI tests outside Bazel in native Windows environments. --- bazel/git-toolchain/BUILD.bazel | 15 +++++++++++++++ bazel/remote-execution/BUILD.bazel | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bazel/git-toolchain/BUILD.bazel b/bazel/git-toolchain/BUILD.bazel index 83ce0ab16..16764d2cc 100644 --- a/bazel/git-toolchain/BUILD.bazel +++ b/bazel/git-toolchain/BUILD.bazel @@ -74,3 +74,18 @@ toolchain( toolchain = ":git_macos_arm64", toolchain_type = ":toolchain_type", ) + +toolchain( + name = "git_windows_toolchain", + # TODO(devversion): Consult with Bazel team on best practices. + # Toolchain selection isn't able to cross-compile if we require Windows + # also as execution platform. This shouldn't be necessary because the toolchain + # is only used for target platform execution (not to be confused with Bazel execution). + # exec_compatible_with = [], + target_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + toolchain = ":git_windows", + toolchain_type = ":toolchain_type", +) diff --git a/bazel/remote-execution/BUILD.bazel b/bazel/remote-execution/BUILD.bazel index 55652e9dd..322392350 100644 --- a/bazel/remote-execution/BUILD.bazel +++ b/bazel/remote-execution/BUILD.bazel @@ -7,7 +7,6 @@ platform( constraint_values = [ "@platforms//os:linux", "@platforms//cpu:x86_64", - "@bazel_tools//tools/cpp:clang", ], exec_properties = { # We use the official Puppeteer docker image that supports launching browsers. Note that we