SERVER-83258 add python toolchain to bazel build
This commit is contained in:
committed by
Evergreen Agent
parent
0ffed150b1
commit
cd6a9b34b5
35
bazel/toolchains/python_toolchain.BUILD
Normal file
35
bazel/toolchains/python_toolchain.BUILD
Normal file
@@ -0,0 +1,35 @@
|
||||
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
|
||||
|
||||
filegroup(
|
||||
name = "files",
|
||||
srcs = glob(["**/*"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "interpreter",
|
||||
srcs = ["{interpreter_path}"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
py_runtime(
|
||||
name = "py_runtime",
|
||||
files = [":files"],
|
||||
interpreter = ":interpreter",
|
||||
python_version = "PY3",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
py_runtime_pair(
|
||||
name = "py_runtime_pair",
|
||||
py2_runtime = None,
|
||||
py3_runtime = ":py_runtime",
|
||||
)
|
||||
|
||||
toolchain(
|
||||
name = "python_toolchain",
|
||||
exec_compatible_with = [{constraints}],
|
||||
target_compatible_with = [{constraints}],
|
||||
toolchain = ":py_runtime_pair",
|
||||
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
|
||||
)
|
||||
Reference in New Issue
Block a user