Skip to content

rules_python zipapp cannot use a rules_py free-threaded runtime #1332

Description

@tamird

After #1305, a rules_py-provisioned free-threaded runtime no longer registers a compatible @rules_python//python:exec_tools_toolchain_type. rules_python 1.9's py_zipapp_binary requires that type, and its bundled 3.11 registrations are restricted to py_freethreaded=no, so an aligned free-threaded configuration has no matching exec toolchain.

The existing rules-python-consumers fixture should reproduce this by building :pycowsay_zipapp with:

--@aspect_rules_py//py:python_version=3.13
--@aspect_rules_py//py/private/interpreter:freethreaded=true
--@rules_python//python/config_settings:python_version=3.13
--@rules_python//python/config_settings:py_freethreaded=yes

The public exec toolchain is currently mandatory for py_zipapp_binary even though the zipapp implementation does not read it. Removing that unused requirement in rules_python is the clean fix. For compatibility with the released rules_python 1.9 API, rules_py would need to register a properly shaped py_exec_tools_toolchain adapter for PBS in addition to its private exec toolchain; registering the PBS runtime directly under the public type would not satisfy consumers that expect ToolchainInfo.exec_tools.

OpenAI's current downstream snapshot does not enable the free-threaded path, so this does not block the current upgrade.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions