Skip to content

Commit

Permalink
feat: enable rules_python Starlark implemention by default for Bazel …
Browse files Browse the repository at this point in the history
…7+ (#1699)

This makes the base rules use the Starlark code in rules_python
("pystar") instead of what is built into Bazel 7.

The pystar implementation can be disabled by setting
`RULES_PYTHON_ENABLE_PYSTAR=0` in your environment or using
`--action_env`.

Earlier versions of Bazel continue to use the rules built into Bazel
regardless (the new implementation requires special APIs that only Bazel
7 has).

Work towards #1069
  • Loading branch information
rickeylev authored Feb 13, 2024
1 parent f1d1732 commit 5cd32ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ A brief description of the categories of changes:

### Changed

* For Bazel 7, the core rules and providers are now implemented in rules_python
directly and the rules bundled with Bazel are not used. Bazel 6 and earlier
continue to use the Bazel builtin symbols. Of particular note, this means,
under Bazel 7, the builtin global symbol `PyInfo` is **not** the same as what
is loaded from rules_python. The same is true of `PyRuntimeInfo`.

* (toolchains) Windows hosts always ignore pyc files in the downloaded runtimes.
This fixes issues due to pyc files being created at runtime and affecting the
definition of what files were considered part of the runtime.
Expand Down
2 changes: 1 addition & 1 deletion python/private/internal_config_repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ settings for rules to later use.
"""

_ENABLE_PYSTAR_ENVVAR_NAME = "RULES_PYTHON_ENABLE_PYSTAR"
_ENABLE_PYSTAR_DEFAULT = "0"
_ENABLE_PYSTAR_DEFAULT = "1"

_CONFIG_TEMPLATE = """\
config = struct(
Expand Down

0 comments on commit 5cd32ad

Please sign in to comment.