aspect-build / aspect-build/rules_py

rules_python zipapp cannot use a rules_py free-threaded runtime

Open
#1,332 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
145
Forks
97
Avg merge
1d 1h
Merged PRs (30d)
71

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start with the existing rules-python-consumers fixture and reproduce the failure by building :pycowsay_zipapp with the four aligned Python and free-threading settings listed in the issue. Inspect py_zipapp_binary and the rules_python 1.9 exec-tools toolchain API, then verify that the fixture builds successfully without the incompatible requirement or with the required adapter shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.