You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New incompatible flags disable ctx.fragments.py, ctx.fragments.bazel_py
`--incompatible_remove_ctx_py_fragment` removes `ctx.fragments.py`.
`--incompatible_remove_ctx_bazel_py_fragment` removes `ctx.fragments.bazel_py`.
`rules_python` can use this to determine if it should read Python flags from Starlark definitions or Bazel-native:
```py
if not hasattr(ctx.fragments, "py"):
print("I should read Python flags from Starlark.")
````
For bazel-contrib/rules_python#3252.
**Caveats:**
This approach has the downside that it's all-or-nothing: removing an entire fragment doesn't permit partial Starlarkification. Which is hypothetically an issue if we have to keep certain flags native because of strange inner Bazel dependencies.
I think for Python this isn't a huge risk. Worst-case we can redefine the flags to restrict fragment access instead of completely removing it.
Closes#27056.
PiperOrigin-RevId: 811388173
Change-Id: I8e148e65fce8d007f0724ebac6752319e0c86c54
0 commit comments