|
| 1 | +load("@rules_cc//cc:defs.bzl", "cc_toolchain") |
| 2 | +load(":dummy_cc_toolchain.bzl", "dummy_cc_toolchain_config") |
| 3 | + |
| 4 | +# This is needed following https://github.com/bazel-contrib/rules_nodejs/pull/3859 |
| 5 | +toolchain( |
| 6 | + name = "node22_windows_no_exec_toolchain", |
| 7 | + exec_compatible_with = [], |
| 8 | + target_compatible_with = [ |
| 9 | + "@platforms//os:windows", |
| 10 | + "@platforms//cpu:x86_64", |
| 11 | + ], |
| 12 | + toolchain = "@node22_windows_amd64//:toolchain", |
| 13 | + toolchain_type = "@rules_nodejs//nodejs:toolchain_type", |
| 14 | +) |
| 15 | + |
| 16 | +# This defines a dummy C++ toolchain for Windows. |
| 17 | +# Without this, the build fails with "Unable to find a CC toolchain using toolchain resolution". |
| 18 | +dummy_cc_toolchain_config(name = "dummy_cc_toolchain_config") |
| 19 | + |
| 20 | +filegroup(name = "empty") |
| 21 | + |
| 22 | +cc_toolchain( |
| 23 | + name = "dummy_cc_toolchain", |
| 24 | + all_files = ":empty", |
| 25 | + compiler_files = ":empty", |
| 26 | + dwp_files = ":empty", |
| 27 | + linker_files = ":empty", |
| 28 | + objcopy_files = ":empty", |
| 29 | + strip_files = ":empty", |
| 30 | + supports_param_files = 0, |
| 31 | + toolchain_config = ":dummy_cc_toolchain_config", |
| 32 | + toolchain_identifier = "dummy_cc_toolchain", |
| 33 | +) |
| 34 | + |
| 35 | +toolchain( |
| 36 | + name = "dummy_cc_windows_no_exec_toolchain", |
| 37 | + exec_compatible_with = [], |
| 38 | + target_compatible_with = [ |
| 39 | + "@platforms//os:windows", |
| 40 | + "@platforms//cpu:x86_64", |
| 41 | + ], |
| 42 | + toolchain = ":dummy_cc_toolchain", |
| 43 | + toolchain_type = "@rules_cc//cc:toolchain_type", |
| 44 | +) |
0 commit comments