-
Notifications
You must be signed in to change notification settings - Fork 543
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
feat(toolchain, pip.parse): introduce a new '_host' toolchain repo #1644
feat(toolchain, pip.parse): introduce a new '_host' toolchain repo #1644
Conversation
Oh this is gonna be tough to remember. @chrislovecnm do you remember what the issue was with windows and trying to symlink to the python interpreter from another repo? |
Ah, this might be it: #1265 Something about: the symlink can't be executed directly / powershell issue / dll's can't be found from the symlink's location ? |
5f65e16
to
4840d42
Compare
I am wondering then why the CI is still passing. Maybe the Just to be explicit, I am not using the symlink in toolchain |
Yeah, the previous |
1a97810
to
7cf8787
Compare
7cf8787
to
53a553e
Compare
This is for passing it in repository_rules and relies on the canonical label representation introduced in bazel 6.0 and symlink support (needs to be present on Windows) to work. This allows the users to not need to `load` the interpreter label from a `.bzl` file but instead specify the label in the form of `@<mytoolchainrepo>_host//:python`. Work towards bazelbuild#1643.
53a553e
to
991d4c0
Compare
Previously, in the typical use case where `python_interpreter_target` is passed, the @bazel_rules_hdl//:init.bzl init macro would always call the vendored `install_deps`. However, this would only work if the passed in toolchain name matched the one used to generate the vendored requirements.bzl (since @python39 is hardcoded as a default inside). Now, we pass along any interpreter args to the vendored `install_deps` to override the defaults as documented at: https://github.com/bazelbuild/rules_python/blob/main/examples/pip_parse_vendored/README.md. This also eliminates the documented requirement to use the generated pip deps instead of the vendored version if an interpreter arg is set. We also update rules_python to the latest version, allowing the use of the "_host" toolchain label to avoid loading the interpreter per bazelbuild/rules_python#1644. Finally, we clean up other references to the pip_parse repo (which was only intended for the vendoring) and move them to use the vendored deps directly.
Previously, in the typical use case where `python_interpreter_target` is passed, the @bazel_rules_hdl//:init.bzl init macro would always call the vendored `install_deps`. However, this would only work if the passed in toolchain name matched the one used to generate the vendored requirements.bzl (since @python39 is hardcoded as a default inside). Now, we pass along any interpreter args to the vendored `install_deps` to override the defaults as documented at: https://github.com/bazelbuild/rules_python/blob/main/examples/pip_parse_vendored/README.md. This also eliminates the documented requirement to use the generated pip deps instead of the vendored version if an interpreter arg is set. We also update rules_python to the latest version, allowing the use of the "_host" toolchain label to avoid loading the interpreter per bazelbuild/rules_python#1644. Finally, we clean up other references to the pip_parse repo (which was only intended for the vendoring) and move them to use the vendored deps directly.
Previously, in the typical use case where `python_interpreter_target` is passed, the @bazel_rules_hdl//:init.bzl init macro would always call the vendored `install_deps`. However, this would only work if the passed in toolchain name matched the one used to generate the vendored requirements.bzl (since @python39 is hardcoded as a default inside). Now, we pass along any interpreter args to the vendored `install_deps` to override the defaults as documented at: https://github.com/bazelbuild/rules_python/blob/main/examples/pip_parse_vendored/README.md. This also eliminates the documented requirement to use the generated pip deps instead of the vendored version if an interpreter arg is set. We also update rules_python to the latest version, allowing the use of the "_host" toolchain label to avoid loading the interpreter per bazelbuild/rules_python#1644. Finally, we clean up other references to the pip_parse repo (which was only intended for the vendoring) and move them to use the vendored deps directly.
Previously, in the typical use case where `python_interpreter_target` is passed, the @bazel_rules_hdl//:init.bzl init macro would always call the vendored `install_deps`. However, this would only work if the passed in toolchain name matched the one used to generate the vendored requirements.bzl (since @python39 is hardcoded as a default inside). Now, we pass along any interpreter args to the vendored `install_deps` to override the defaults as documented at: https://github.com/bazelbuild/rules_python/blob/main/examples/pip_parse_vendored/README.md. This also eliminates the documented requirement to use the generated pip deps instead of the vendored version if an interpreter arg is set. We also update rules_python to the latest version, allowing the use of the "_host" toolchain label to avoid loading the interpreter per bazelbuild/rules_python#1644. Finally, we clean up other references to the pip_parse repo (which was only intended for the vendoring) and move them to use the vendored deps directly.
Previously, in the typical use case where `python_interpreter_target` is passed, the @bazel_rules_hdl//:init.bzl init macro would always call the vendored `install_deps`. However, this would only work if the passed in toolchain name matched the one used to generate the vendored requirements.bzl (since @python39 is hardcoded as a default inside). Now, we pass along any interpreter args to the vendored `install_deps` to override the defaults as documented at: https://github.com/bazelbuild/rules_python/blob/main/examples/pip_parse_vendored/README.md. This also eliminates the documented requirement to use the generated pip deps instead of the vendored version if an interpreter arg is set. We also update rules_python to the latest version, allowing the use of the "_host" toolchain label to avoid loading the interpreter per bazelbuild/rules_python#1644. Finally, we clean up other references to the pip_parse repo (which was only intended for the vendoring) and move them to use the vendored deps directly.
Previously, in the typical use case where `python_interpreter_target` is passed, the @bazel_rules_hdl//:init.bzl init macro would always call the vendored `install_deps`. However, this would only work if the passed in toolchain name matched the one used to generate the vendored requirements.bzl (since @python39 is hardcoded as a default inside). Now, we pass along any interpreter args to the vendored `install_deps` to override the defaults as documented at: https://github.com/bazelbuild/rules_python/blob/main/examples/pip_parse_vendored/README.md. This also eliminates the documented requirement to use the generated pip deps instead of the vendored version if an interpreter arg is set. We also update rules_python to the latest version, allowing the use of the "_host" toolchain label to avoid loading the interpreter per bazelbuild/rules_python#1644. Finally, we clean up other references to the pip_parse repo (which was only intended for the vendoring) and move them to use the vendored deps directly.
This is for passing it in repository_rules and relies on the canonical
label representation introduced in bazel 6.0 and symlink support (needs
to be present on Windows) to work.
This allows the users to not need to
load
the interpreter label froma
.bzl
file but instead specify the label in the form of@<mytoolchainrepo>_host//:python
.In order to make it work robustly on Windows, we do
repository_ctx.path(python_interpreter_label).realpath
to get the actualpath of the Python interpreter on both, bzlmod and non-bzlmod setups on
Windows within the
whl_library
repository rule.Work towards #1643.