python3: add isFreeThreaded to the interpreter's passthru

A package that builds differently on free-threaded Python has no
attribute to ask. It must parse libPrefix or executable for the "t"
ABI flag. Expose the interpreter's own setting: true when CPython is
built with enableGIL = false, and false for every other interpreter.
The package set passes it on as an argument, like pythonAtLeast.

passthru is not part of the derivation, so nothing rebuilds.

Assisted-by: Claude Code (Claude Opus 5.5)
This commit is contained in:
lillecarl
2026-11-06 11:21:54 +01:00
parent 3c425fd928
commit c43592e498
4 changed files with 5 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ Each interpreter has the following attributes:
- `withPackages`. Simpler interface to `buildEnv`. See [](#python.withpackages-function) for usage and documentation.
- `sitePackages`. Alias for `lib/${libPrefix}/site-packages`.
- `executable`. Name of the interpreter executable, e.g. `python3.10`.
- `isFreeThreaded`. Whether the interpreter is a free-threaded build (`enableGIL = false`), e.g. `python314FreeThreading`.
- `pkgs`. Set of Python packages for that specific interpreter. The package set can be modified by overriding the interpreter and passing `packageOverrides`.
### Building packages and applications {#building-packages-and-applications}