-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
BUILD.bazel
95 lines (82 loc) · 2.47 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
91
92
93
94
95
load("@rules_python//python:defs.bzl", "py_runtime", "py_runtime_pair")
load("//tools/lint:lint.bzl", "add_lint_tests")
load(
":interpreter_paths.bzl",
"LINUX_DBG_INTERPRETER_PATH",
"LINUX_INTERPRETER_PATH",
"MACOS_ARM64_INTERPRETER_PATH",
"MACOS_I386_INTERPRETER_PATH",
)
# The value of interpreter_path must match the value of linux_interpreter_path
# used when declaring the @python repository.
py_runtime(
name = "linux_py3_runtime",
interpreter_path = LINUX_INTERPRETER_PATH,
python_version = "PY3",
)
py_runtime_pair(
name = "linux_py_runtime_pair",
py3_runtime = ":linux_py3_runtime",
)
toolchain(
name = "linux_toolchain",
target_compatible_with = ["@platforms//os:linux"],
toolchain = ":linux_py_runtime_pair",
toolchain_type = "@rules_python//python:toolchain_type",
)
py_runtime(
name = "linux_dbg_py3_runtime",
interpreter_path = LINUX_DBG_INTERPRETER_PATH,
python_version = "PY3",
)
py_runtime_pair(
name = "linux_dbg_py_runtime_pair",
py3_runtime = ":linux_dbg_py3_runtime",
)
# Typically this toolchain would be loaded manually using the
# --extra_toolchains command line option.
toolchain(
name = "linux_dbg_toolchain",
target_compatible_with = ["@platforms//os:linux"],
toolchain = ":linux_dbg_py_runtime_pair",
toolchain_type = "@rules_python//python:toolchain_type",
)
# The value of interpreter_path must match the value of macos_interpreter_path
# used when declaring the @python repository.
py_runtime(
name = "macos_i386_py3_runtime",
interpreter_path = MACOS_I386_INTERPRETER_PATH,
python_version = "PY3",
)
py_runtime(
name = "macos_arm64_py3_runtime",
interpreter_path = MACOS_ARM64_INTERPRETER_PATH,
python_version = "PY3",
)
py_runtime_pair(
name = "macos_i386_py_runtime_pair",
py3_runtime = ":macos_i386_py3_runtime",
)
py_runtime_pair(
name = "macos_arm64_py_runtime_pair",
py3_runtime = ":macos_arm64_py3_runtime",
)
toolchain(
name = "macos_i386_toolchain",
target_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:osx",
],
toolchain = ":macos_i386_py_runtime_pair",
toolchain_type = "@rules_python//python:toolchain_type",
)
toolchain(
name = "macos_arm64_toolchain",
target_compatible_with = [
"@platforms//cpu:arm64",
"@platforms//os:osx",
],
toolchain = ":macos_arm64_py_runtime_pair",
toolchain_type = "@rules_python//python:toolchain_type",
)
add_lint_tests()