zeek | 782120c | 2022-03-22 21:22:19 +0800 | [diff] [blame] | 1 | load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair") |
| 2 | |
Matthias Maennich | b7b30f4 | 2021-05-21 14:10:52 +0100 | [diff] [blame] | 3 | package(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 Chen | 1977a48 | 2022-01-13 14:41:41 +0000 | [diff] [blame] | 13 | |
zeek | 782120c | 2022-03-22 21:22:19 +0800 | [diff] [blame] | 14 | py_runtime( |
| 15 | name = "python2", |
| 16 | files = ["linux-x86/bin/py2-cmd"], |
| 17 | interpreter = "linux-x86/bin/py2-cmd", |
| 18 | python_version = "PY2", |
| 19 | ) |
Jingwen Chen | 1977a48 | 2022-01-13 14:41:41 +0000 | [diff] [blame] | 20 | |
Jingwen Chen | 1977a48 | 2022-01-13 14:41:41 +0000 | [diff] [blame] | 21 | py_runtime( |
| 22 | name = "python3", |
| 23 | files = ["linux-x86/bin/py3-cmd"], |
| 24 | interpreter = "linux-x86/bin/py3-cmd", |
| 25 | python_version = "PY3", |
| 26 | ) |
zeek | 782120c | 2022-03-22 21:22:19 +0800 | [diff] [blame] | 27 | |
| 28 | py_runtime_pair( |
| 29 | name = "py_runtime_pair", |
| 30 | py2_runtime = ":python2", |
| 31 | py3_runtime = ":python3", |
| 32 | ) |
| 33 | |
| 34 | toolchain( |
| 35 | name = "py_toolchain", |
| 36 | toolchain = ":py_runtime_pair", |
| 37 | toolchain_type = "@bazel_tools//tools/python:toolchain_type", |
| 38 | ) |