diff --git a/MODULE.bazel b/MODULE.bazel index b0ae2b5869040..dbac8b4580352 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -140,6 +140,7 @@ use_repo( python, system_python = "python_{}".format(SUPPORTED_PYTHON_VERSIONS[-1].replace(".", "_")), ) +# use_repo(python, "python") pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True) diff --git a/WORKSPACE b/WORKSPACE index 6148f5e67925f..775ce5514f810 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -27,10 +27,16 @@ load("@bazel_features//:deps.bzl", "bazel_features_deps") bazel_features_deps() -load("@rules_python//python:repositories.bzl", "py_repositories") +load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") py_repositories() +python_register_toolchains( + name = "python_latest", + python_version = "3.12", +) +#register_toolchains("@rules_python//python/runtime_env_toolchains:all") + # Bazel platform rules. http_archive( name = "platforms", diff --git a/python/build_targets.bzl b/python/build_targets.bzl index 775e8f95d63a7..fa94357d00738 100644 --- a/python/build_targets.bzl +++ b/python/build_targets.bzl @@ -98,7 +98,9 @@ def build_targets(name): ], deps = select({ "//conditions:default": [], - ":use_fast_cpp_protos": ["@system_python//:python_headers"], + ":use_fast_cpp_protos": ["@rules_python//python/cc:current_py_cc_headers"], + #":use_fast_cpp_protos": ["@python//python/cc:current_py_cc_headers"], + #":use_fast_cpp_protos": ["@python//cc:current_py_cc_headers"], }), ) @@ -154,7 +156,9 @@ def build_targets(name): "@abseil-cpp//absl/strings", ] + select({ "//conditions:default": [], - ":use_fast_cpp_protos": ["@system_python//:python_headers"], + ":use_fast_cpp_protos": ["@rules_python//python/cc:current_py_cc_headers"], + # ":use_fast_cpp_protos": ["@python//python/cc:current_py_cc_headers"], + #":use_fast_cpp_protos": ["@python//cc:current_py_cc_headers"], }), ) @@ -459,7 +463,9 @@ def build_targets(name): "//src/google/protobuf/io", "@abseil-cpp//absl/log:absl_check", "@abseil-cpp//absl/status", - "@system_python//:python_headers", + "@rules_python//python/cc:current_py_cc_headers", + #"@python//python/cc:current_py_cc_headers", + #"@python//cc:current_py_cc_headers", ], )