blob: 697e3765bca996e0031a18c51b2f5581e01d16fa [file] [log] [blame]
Philipp Schrader54047962022-02-16 21:05:11 -08001load("@bazel_skylib//rules:write_file.bzl", "write_file")
2load("@build_bazel_rules_nodejs//toolchains/node:node_toolchain.bzl", "node_toolchain")
3
4write_file(
5 name = "noop_error_exit",
6 out = "noop_error_exit.sh",
7 content = [
8 "#!/bin/bash",
9 "echo 'This should never be executed. Something went wrong.' >&2",
10 "echo 'This NOOP NodeJs toolchain should never be executed. Something went wrong.' >&2",
11 "echo 'Check that your target has `target_compatible_with` set to a platform that supports NodeJs.' >&2",
12 "exit 1",
13 ],
14 is_executable = True,
15)
16
17node_toolchain(
18 name = "noop_node_toolchain_impl",
19 target_tool = ":noop_error_exit",
20)
21
22toolchain(
23 name = "noop_node_toolchain",
24 exec_compatible_with = [
25 "@platforms//os:linux",
26 ],
27 target_compatible_with = [
28 "//tools/platforms/nodejs:lacks_support",
29 ],
30 toolchain = ":noop_node_toolchain_impl",
31 toolchain_type = "@build_bazel_rules_nodejs//toolchains/node:toolchain_type",
32)