@@ -2,7 +2,9 @@ load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
22load ("@bazel_skylib//rules:common_settings.bzl" , "bool_flag" )
33load ("@devinfra//bazel/validation:defs.bzl" , "validate_ts_version_matching" )
44load ("@npm//:defs.bzl" , "npm_link_all_packages" )
5+ load ("@rules_cc//cc:defs.bzl" , "cc_toolchain" )
56load ("//tools:defaults.bzl" , "copy_to_bin" )
7+ load ("//tools:dummy_cc_toolchain.bzl" , "dummy_cc_toolchain_config" )
68
79package (default_visibility = ["//visibility:public" ])
810
@@ -120,3 +122,33 @@ toolchain(
120122 toolchain = "@node22_windows_amd64//:toolchain" ,
121123 toolchain_type = "@rules_nodejs//nodejs:toolchain_type" ,
122124)
125+
126+ # This file defines a dummy C++ toolchain for Windows.
127+ # Without this, the build fails with "Unable to find a CC toolchain using toolchain resolution".
128+ dummy_cc_toolchain_config (name = "dummy_config" )
129+
130+ filegroup (name = "empty" )
131+
132+ cc_toolchain (
133+ name = "dummy_cc_toolchain" ,
134+ all_files = ":empty" ,
135+ compiler_files = ":empty" ,
136+ dwp_files = ":empty" ,
137+ linker_files = ":empty" ,
138+ objcopy_files = ":empty" ,
139+ strip_files = ":empty" ,
140+ supports_param_files = 0 ,
141+ toolchain_config = ":dummy_config" ,
142+ toolchain_identifier = "dummy-toolchain" ,
143+ )
144+
145+ toolchain (
146+ name = "dummy_cc_toolchain_impl" ,
147+ exec_compatible_with = [],
148+ target_compatible_with = [
149+ "@platforms//os:windows" ,
150+ "@platforms//cpu:x86_64" ,
151+ ],
152+ toolchain = ":dummy_cc_toolchain" ,
153+ toolchain_type = "@rules_cc//cc:toolchain_type" ,
154+ )
0 commit comments