commit | 84ff5777421c336f1cf1329a3ff0a5754b5bbf47 | [log] [tgz] |
---|---|---|
author | Ivo List <ilist@google.com> | Tue Oct 08 20:01:39 2024 +0200 |
committer | GitHub <noreply@github.com> | Tue Oct 08 18:01:39 2024 +0000 |
tree | 335ade092ad5650f47378efba78be2eaa0f19ffe | |
parent | a2773de53c02ccaf242ed52f706a08a7f61b9186 [diff] |
chore: support removal of builtin providers (#2274) The builtin providers PyInfo, PyRuntimeInfo, and PyCcLinkParamsProvider are being removed, which means Bazel throws an error while compiling bzl files if there is a reference to a top-level symbol that doesn't exist anymore. For backwards compatibility, rules_python consumes/produces these providers, so the symbols are used in various places. To fix, use `native.legacy_globals` and Bazel version detection to conditionally emit the symbols into `@rules_python_internal`. If they aren't present, they are reported as None. This mimics equivalent functionality in bazel_features; bazel_features isn't used because it would require users to update their WORKSPACE to initialize some dependencies before rules_python can perform its initialization. Removal of the builtin symbols is controlled by `--incompatible_autoload_externally` (which is in Bazel 8 and has been cherry-picked into earlier version). If the flag is enabled with "@rules_python" or "-@rules_python" the providers are removed from Bazel. --------- Co-authored-by: Richard Levasseur <rlevasseur@google.com>
This repository is the home of the core Python rules -- py_library
, py_binary
, py_test
, py_proto_library
, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.