-
Notifications
You must be signed in to change notification settings - Fork 7k
[bazel] rename contraint from hermatic to python_version #58499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cd07f3e
b5558e1
4fe300e
e545335
c444503
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,8 @@ config_setting( | |
| ], | ||
| ) | ||
|
|
||
| # Hermetic python environment, currently only used for CI infra and scripts. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment describing the hermetic Python environment is now disconnected from the |
||
|
|
||
| py_runtime( | ||
| name = "py39_runtime", | ||
| interpreter = python39, | ||
|
|
@@ -79,7 +81,7 @@ py_runtime_pair( | |
|
|
||
| toolchain( | ||
| name = "py39_toolchain", | ||
| exec_compatible_with = ["//:hermetic_python"], | ||
| exec_compatible_with = [":py39"], | ||
| toolchain = ":py39_runtime_pair", | ||
| toolchain_type = "@bazel_tools//tools/python:toolchain_type", | ||
| ) | ||
|
|
@@ -100,7 +102,35 @@ py_runtime_pair( | |
|
|
||
| toolchain( | ||
| name = "py310_toolchain", | ||
| exec_compatible_with = ["//:hermetic_python"], | ||
| exec_compatible_with = [":py310"], | ||
| toolchain = ":py310_runtime_pair", | ||
| toolchain_type = "@bazel_tools//tools/python:toolchain_type", | ||
| ) | ||
|
|
||
| constraint_setting(name = "python_version") | ||
|
|
||
| constraint_value( | ||
| name = "py39", | ||
| constraint_setting = ":python_version", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| constraint_value( | ||
| name = "py310", | ||
| constraint_setting = ":python_version", | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| platform( | ||
| name = "py39_platform", | ||
| constraint_values = [":py39"], | ||
| parents = ["@local_config_platform//:host"], | ||
| visibility = ["//visibility:private"], | ||
| ) | ||
|
|
||
| platform( | ||
| name = "py310_platform", | ||
| constraint_values = [":py310"], | ||
| parents = ["@local_config_platform//:host"], | ||
| visibility = ["//visibility:private"], | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Python 3.10 Toolchain: Incomplete Setup
The
py310_toolchainis defined inbazel/BUILD.bazelbut not registered in WORKSPACE. Onlypy39_toolchainis registered, which means targets withexec_compatible_with = ["//bazel:py310"]will fail because Bazel won't find a matching toolchain. The PR description mentions registering Python 3.10 with hermetic toolchain, but the toolchain registration is missing.