Skip to content

Enable free-threaded Python 3.14t#16

Open
mkanat wants to merge 1 commit intomainfrom
freethreaded-python
Open

Enable free-threaded Python 3.14t#16
mkanat wants to merge 1 commit intomainfrom
freethreaded-python

Conversation

@mkanat
Copy link
Copy Markdown
Owner

@mkanat mkanat commented Mar 4, 2026

Summary

  • Add a custom Bazel platform (//tools/platforms:freethreaded) that inherits from the host platform, adds aspect_rules_py's freethreading_enabled constraint for cp314t wheel selection, and sets the rules_python py_freethreaded=yes flag for the free-threaded interpreter.
  • Register it as the default target platform (.bazelrc) and execution platform (MODULE.bazel).

Blocked on upstream issues

Tests will not pass until these are resolved:

  • aspect-build/rules_py#805: select_chain picks abi3 wheels that segfault under the cp314t ABI (different struct layouts make standard-ABI extensions crash on load).
  • google/re2#602: No cp314t wheels published for google-re2 (transitive dep via protovalidatecel-python).

Test plan

  • bazelisk build //... succeeds (verified)
  • bazelisk test //... — blocked on upstream issues above

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 2026

The latest Buf updates on your PR. Results from workflow CI / lint (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed⏩ skippedMar 24, 2026, 4:36 AM

@mkanat mkanat force-pushed the freethreaded-python branch from 1718463 to ff7c2e5 Compare March 24, 2026 04:00
Use bazelrc flags (aspect_rules_py interpreter:freethreaded and
rules_python py_freethreaded) instead of a custom platform to select
the free-threaded interpreter and cp314t wheels.

Blocked on upstream issues before tests will pass:
- google/re2#602: no cp314t wheels published for google-re2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mkanat mkanat force-pushed the freethreaded-python branch from ff7c2e5 to eb34140 Compare March 24, 2026 04:34
@mkanat
Copy link
Copy Markdown
Owner Author

mkanat commented Mar 24, 2026

Okay, the aspect_rules_py stuff is mostly working now. (It will be simpler once the python interpreter stuff is complete, upstream.)

Now just need re2 to update.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant