Skip to content

Add support for freethreaded builds of Python 3.13 #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 63 additions & 38 deletions .github/workflows/apple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,161 +47,186 @@ jobs:
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.8'
optimizations: 'debug'
options: 'debug'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I added a separate freethreaded: true flag but defining all the build options at once makes passing them around much easier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this should be variant? Or flavor, as they're called in the docs? Don't feel strongly.

Copy link
Member Author

@zanieb zanieb Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the documentation, this isn't the "flavor" it's the "build configuration". The "flavors" are install_only / full. These are options to configure the build.

Instead of --options and build_options we could do --config and build_config but I don't think that's clearer.

- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.8'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.8'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.9'
optimizations: 'debug'
options: 'debug'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.9'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.9'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.10'
optimizations: 'debug'
options: 'debug'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.10'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.10'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.11'
optimizations: 'debug'
options: 'debug'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.11'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.11'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.12'
optimizations: 'debug'
options: 'debug'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.12'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.12'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.13'
optimizations: 'debug'
options: 'debug'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.13'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.13'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.13'
options: 'freethreaded+debug'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.13'
options: 'freethreaded+pgo'
- target_triple: 'aarch64-apple-darwin'
runner: macos-14
py: 'cpython-3.13'
options: 'freethreaded+pgo+lto'

# macOS on Intel hardware. This is pretty straightforward. We exclude
# noopt because it doesn't provide any compelling advantages over PGO
# or LTO builds.
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.8'
optimizations: 'debug'
options: 'debug'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.8'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.8'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.9'
optimizations: 'debug'
options: 'debug'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.9'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.9'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.10'
optimizations: 'debug'
options: 'debug'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.10'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.10'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.11'
optimizations: 'debug'
options: 'debug'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.11'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.11'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.12'
optimizations: 'debug'
options: 'debug'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.12'
optimizations: 'pgo'
options: 'pgo'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.12'
optimizations: 'pgo+lto'
options: 'pgo+lto'

- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.13'
optimizations: 'debug'
options: 'debug'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.13'
options: 'pgo'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.13'
options: 'pgo+lto'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.13'
options: 'freethreaded+debug'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.13'
optimizations: 'pgo'
options: 'freethreaded+pgo'
- target_triple: 'x86_64-apple-darwin'
runner: macos-13
py: 'cpython-3.13'
optimizations: 'pgo+lto'
options: 'freethreaded+pgo+lto'
needs:
- pythonbuild
runs-on: ${{ matrix.build.runner }}
Expand Down Expand Up @@ -232,12 +257,12 @@ jobs:
exit 1
fi

./build-macos.py --target-triple ${{ matrix.build.target_triple }} --python ${{ matrix.build.py }} --optimizations ${{ matrix.build.optimizations }}
./build-macos.py --target-triple ${{ matrix.build.target_triple }} --python ${{ matrix.build.py }} --options ${{ matrix.build.options }}

- name: Upload Distributions
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.build.py }}-${{ matrix.build.target_triple }}-${{ matrix.build.optimizations }}
name: ${{ matrix.build.py }}-${{ matrix.build.target_triple }}-${{ matrix.build.options }}
path: dist/*

- uses: actions/checkout@v4
Expand Down
Loading