blob: 884e82aae38d72ea88f750c0dcd3c53155f04ad6 [file] [log] [blame]
zeek782120c2022-03-22 21:22:19 +08001load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
2
Matthias Maennichb7b30f42021-05-21 14:10:52 +01003package(default_visibility = ["//visibility:public"])
4
5[filegroup(
6 name = platform,
7 srcs = glob([
8 "common/**",
9 "%s/bin/*" % platform,
10 "%s/lib64/*" % platform,
11 ]),
12) for platform in ("linux-x86", "darwin")]
Jingwen Chen1977a482022-01-13 14:41:41 +000013
zeek782120c2022-03-22 21:22:19 +080014py_runtime(
15 name = "python2",
16 files = ["linux-x86/bin/py2-cmd"],
17 interpreter = "linux-x86/bin/py2-cmd",
18 python_version = "PY2",
19)
Jingwen Chen1977a482022-01-13 14:41:41 +000020
Jingwen Chen1977a482022-01-13 14:41:41 +000021py_runtime(
22 name = "python3",
23 files = ["linux-x86/bin/py3-cmd"],
24 interpreter = "linux-x86/bin/py3-cmd",
25 python_version = "PY3",
26)
zeek782120c2022-03-22 21:22:19 +080027
28py_runtime_pair(
29 name = "py_runtime_pair",
30 py2_runtime = ":python2",
31 py3_runtime = ":python3",
32)
33
34toolchain(
35 name = "py_toolchain",
36 toolchain = ":py_runtime_pair",
37 toolchain_type = "@bazel_tools//tools/python:toolchain_type",
38)