| Tim Windelschmidt | 590239d | 2025-04-15 17:35:22 +0200 | [diff] [blame] | 1 | load("@rules_perl//perl:toolchain.bzl", "perl_toolchain") |
| Tim Windelschmidt | 5d357d8 | 2025-07-10 18:47:15 +0200 | [diff] [blame] | 2 | load("@rules_python//python:py_exec_tools_toolchain.bzl", "py_exec_tools_toolchain") |
| 3 | load("@rules_python//python:py_runtime.bzl", "py_runtime") |
| 4 | load("@rules_python//python:py_runtime_pair.bzl", "py_runtime_pair") |
| Tim Windelschmidt | 03dadba | 2025-07-09 06:58:03 +0200 | [diff] [blame] | 5 | load(":toolchain.bzl", "SUPPORTED_TARGETS", "TOOLCHAINS", "toolchain_for") |
| Tim Windelschmidt | 98000a5 | 2025-03-06 14:22:15 +0100 | [diff] [blame] | 6 | |
| 7 | package(default_visibility = ["//visibility:public"]) |
| 8 | |
| 9 | [ |
| 10 | toolchain_for( |
| 11 | name = name, |
| 12 | config = config, |
| 13 | ) |
| 14 | for name, config in TOOLCHAINS.items() |
| 15 | ] |
| Tim Windelschmidt | 590239d | 2025-04-15 17:35:22 +0200 | [diff] [blame] | 16 | |
| Tim Windelschmidt | 5d357d8 | 2025-07-10 18:47:15 +0200 | [diff] [blame] | 17 | [ |
| 18 | [ |
| 19 | py_runtime( |
| 20 | name = "rules_python_%s_python3_12_runtime" % target.tuple, |
| 21 | interpreter = "@toolchain-bundle-%s//:python3.12" % target.triple, |
| 22 | interpreter_version_info = { |
| 23 | "major": str(3), |
| 24 | "minor": str(12), |
| 25 | "micro": str(0), |
| 26 | }, |
| 27 | python_version = "PY3", |
| 28 | ), |
| 29 | py_runtime_pair( |
| 30 | name = "rules_python_%s_python3_12_runtime_pair" % target.tuple, |
| 31 | py3_runtime = ":rules_python_%s_python3_12_runtime" % target.tuple, |
| 32 | ), |
| 33 | py_exec_tools_toolchain( |
| 34 | name = "rules_python_%s_python3_12_exec_tools_toolchain_impl" % target.tuple, |
| 35 | exec_interpreter = ":rules_python_%s_python3_12_runtime_pair" % target.tuple, |
| 36 | ), |
| 37 | toolchain( |
| 38 | name = "rules_python_%s_python3_12_runtime_toolchain" % target.tuple, |
| 39 | exec_compatible_with = target.constrain, |
| 40 | toolchain = ":rules_python_%s_python3_12_runtime_pair" % target.tuple, |
| 41 | toolchain_type = "@rules_python//python:toolchain_type", |
| 42 | ), |
| 43 | toolchain( |
| 44 | name = "rules_python_%s_python3_12_exec_tools_toolchain" % target.tuple, |
| 45 | exec_compatible_with = target.constrain, |
| 46 | toolchain = ":rules_python_%s_python3_12_exec_tools_toolchain_impl" % target.tuple, |
| 47 | toolchain_type = "@rules_python//python:exec_tools_toolchain_type", |
| 48 | ), |
| 49 | ] |
| 50 | for target in SUPPORTED_TARGETS |
| 51 | ] |
| 52 | |
| Tim Windelschmidt | 03dadba | 2025-07-09 06:58:03 +0200 | [diff] [blame] | 53 | # rules_perl wiring |
| Tim Windelschmidt | 590239d | 2025-04-15 17:35:22 +0200 | [diff] [blame] | 54 | |
| Tim Windelschmidt | 03dadba | 2025-07-09 06:58:03 +0200 | [diff] [blame] | 55 | [ |
| 56 | [ |
| 57 | perl_toolchain( |
| 58 | name = "rules_perl_%s_toolchain_impl" % target.tuple, |
| 59 | runtime = [ |
| 60 | "@toolchain-bundle-%s//:perl_runtime" % target.triple, |
| 61 | ], |
| 62 | ), |
| 63 | toolchain( |
| 64 | name = "rules_perl_%s_toolchain" % target.tuple, |
| 65 | exec_compatible_with = target.constrain, |
| 66 | toolchain = ":rules_perl_%s_toolchain_impl" % target.tuple, |
| 67 | toolchain_type = "@rules_perl//perl:toolchain_type", |
| 68 | ), |
| 69 | ] |
| 70 | for target in SUPPORTED_TARGETS |
| 71 | ] |