Skip to content
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

refactor(pystar): load (but don't use) Starlark implementation. #1428

Merged
merged 1 commit into from
Sep 25, 2023

Commits on Sep 24, 2023

  1. refactor(pystar): load (but don't use) Starlark implementation.

    Always loading the code provides several benefits:
      * It's easier to reason about what code paths are taken.
      * Iteratively working on them is simply changing an environment
        variable instead of editing several files.
      * Ensures the files are loadable on older versions of Bazel.
    
    Usage of the Starlark implemenation is controlled by an environment
    variable, `RULES_PYTHON_USE_PYSTAR=1`. An environment variable must be
    used the decision on what implemenation to use must be made before a
    regular build flag is able to run.
    
    The Starlark implementation is almost entirely compatible with pre-Bazel
    7, except for the `py_internal` symbol. This symbol is special in
    a couple ways:
      * It only exists within the `@rules_python` repo
      * It does not exist prior to Bazel 7.
    
    This requires using a repo rule, `@rules_python_internal`, to do some
    feature/version detection to generate a shim bzl file so that the
    `py_internal` symbol is always loadable. Regular rules_python code then
    loads the shim and can act accordingly.
    
    Work towards bazelbuild#1069
    rickeylev committed Sep 24, 2023
    Configuration menu
    Copy the full SHA
    5687d36 View commit details
    Browse the repository at this point in the history