-
Notifications
You must be signed in to change notification settings - Fork 520
/
Copy pathBUILD.bazel
90 lines (80 loc) · 2.99 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("//nodejs/private:nodejs_toolchains_repo.bzl", "PLATFORMS")
load("//nodejs/private:user_build_settings.bzl", "user_args")
load("@rules_nodejs//nodejs:toolchain.bzl", "resolved_toolchain")
package(default_visibility = ["//visibility:public"])
exports_files([
"index.for_docs.bzl",
"providers.bzl",
])
bzl_library(
name = "index.for_docs",
srcs = glob(["*.bzl"]) + ["@bazel_tools//tools:bzl_srcs"],
deps = [
"//nodejs/private:bzl",
"//nodejs/private/providers:bzl",
"@bazel_skylib//lib:paths",
],
)
# Appropriate for;
# - Providing a runtime for *_binary rules.
# - Compiling against the Node-API.
# See also exec_runtime_toolchain_type.
# See also :resolved_toolchain (e.g. for genrule)
toolchain_type(name = "runtime_toolchain_type")
# Helper for rules such as `genrule`.
# Appropriate for (under target configuration);
# - Providing a runtime for executable outputs.
# - Compiling against the Node-API.
# Appropriate for (under exec configuration);
# - Providing a runtime for rule actions.
# Appropriate for (under exec configuration with matching target constraints);
# - Snapshot generation (--build-snapshot, --experimental-sea-config with `useSnapshot` or
# `useCodeCache`). Sensitive to OS, architecture NodeJS version and other factors constraints
# alone cannot capture such as;
# - V8 flags
# - CPU features
resolved_toolchain(
name = "resolved_toolchain",
visibility = ["//visibility:public"],
)
alias(
name = "toolchain_type",
actual = "runtime_toolchain_type",
deprecation = """
Use one of the following instead;
- @rules_nodejs//nodejs:runtime_toolchain_type
- @rules_nodejs//nodejs:exec_runtime_toolchain_type
- @rules_nodejs//nodejs:compilation_toolchain_type
See https://github.com/bazel-contrib/rules_nodejs/issues/3795.
"""
)
# Inverse of :runtime_toolchain_type,
# Appropriate for;
# - Providing a runtime for rule actions.
# See also :resolved_toolchain (e.g. for genrule).
toolchain_type(name = "exec_runtime_toolchain_type")
# Appropriate for;
# - Snapshot generation (--build-snapshot, --experimental-sea-config with `useSnapshot` or
# `useCodeCache`). Sensitive to OS, architecture NodeJS version and other factors constraints
# alone cannot capture such as;
# - V8 flags
# - CPU features
# This toolchain exists to cover niche scenarios where the runtime needs to be compatible across
# target _and_ execution platforms. It should not be used without good reason.
# See also resolved_toolchain (e.g. for genrule).
toolchain_type(name = "compilation_toolchain_type")
[
platform(
name = key,
constraint_values = values.compatible_with,
)
for key, values in PLATFORMS.items()
]
# Default arguments/flags that are passed to nodejs in all nodejs_binary and
# nodejs_test targets. Can be overwritten by settings
# --@rules_nodejs//nodejs:default_args="--flag1 --flag2"
user_args(
name = "default_args",
build_setting_default = "--preserve-symlinks",
)