Support building free-threaded CPython (#319)

* Support building free-threaded CPython

Add support for Python's free threading build mode where the global
interpreter lock is disabled. The packages are marked using a suffix on
the architecture, like 'x64-freethreaded' or 'arm64-freethreaded'.

* Match '-freethreaded' in arch

* Use type 'string' instead of 'str'

* On Linux, only delete Python installations with the same architecture.

This matches the macOS behavior and allows users to install both the
free-threading and default builds at the same time.
This commit is contained in:
Sam Gross
2025-02-20 09:42:21 -05:00
committed by GitHub
parent e550a75036
commit d456108e6b
14 changed files with 176 additions and 39 deletions

View File

@@ -115,7 +115,7 @@ class NixPythonBuilder : PythonBuilder {
Write-Debug "make Python $($this.Version)-$($this.Architecture) $($this.Platform)"
$buildOutputLocation = New-Item -Path $this.WorkFolderLocation -Name "build_output.txt" -ItemType File
Execute-Command -Command "make 2>&1 | tee $buildOutputLocation" -ErrorAction Continue
Execute-Command -Command "make 2>&1 | tee $buildOutputLocation" -ErrorAction Continue
Execute-Command -Command "make install" -ErrorAction Continue
Write-Debug "Done; Make log location: $buildOutputLocation"