From 869a2f3d1f171c2d2753c312b3e476b72871979d Mon Sep 17 00:00:00 2001 From: "juanjose.tenorio" Date: Sun, 29 Oct 2023 14:35:37 +0900 Subject: [PATCH 1/8] gh-111062 Set up free-threaded CI for windows Co-authored-by: Donghee Na --- .github/workflows/build.yml | 59 ++++-------------------- .github/workflows/reusable-build-win.yml | 53 +++++++++++++++++++++ 2 files changed, 63 insertions(+), 49 deletions(-) create mode 100644 .github/workflows/reusable-build-win.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ef68b62e21a8b..5c6ece07a57ed5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,56 +178,19 @@ jobs: if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME run: make check-c-globals - build_win32: - name: 'Windows (x86)' - runs-on: windows-latest - timeout-minutes: 60 + build_win: + name: 'Windows' needs: check_source if: needs.check_source.outputs.run_tests == 'true' - env: - IncludeUwp: 'true' - steps: - - uses: actions/checkout@v4 - - name: Build CPython - run: .\PCbuild\build.bat -e -d -p Win32 - - name: Display build info - run: .\python.bat -m test.pythoninfo - - name: Tests - run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci - - build_win_amd64: - name: 'Windows (x64)' - runs-on: windows-latest - timeout-minutes: 60 - needs: check_source - if: needs.check_source.outputs.run_tests == 'true' - env: - IncludeUwp: 'true' - steps: - - uses: actions/checkout@v4 - - name: Register MSVC problem matcher - run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Build CPython - run: .\PCbuild\build.bat -e -d -p x64 - - name: Display build info - run: .\python.bat -m test.pythoninfo - - name: Tests - run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci + uses: ./.github/workflows/reusable-build-win.yml - build_win_arm64: - name: 'Windows (arm64)' - runs-on: windows-latest - timeout-minutes: 60 + build_win_free_threaded: + name: 'Windows (free-threaded)' needs: check_source - if: needs.check_source.outputs.run_tests == 'true' - env: - IncludeUwp: 'true' - steps: - - uses: actions/checkout@v4 - - name: Register MSVC problem matcher - run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Build CPython - run: .\PCbuild\build.bat -e -d -p arm64 + if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded') + uses: ./.github/workflows/reusable-build-win.yml + with: + free-threaded: true build_macos: name: 'macOS' @@ -577,9 +540,7 @@ jobs: - check_source # Transitive dependency, needed to access `run_tests` value - check-docs - check_generated_files - - build_win32 - - build_win_amd64 - - build_win_arm64 + - build_win - build_macos - build_ubuntu - build_ubuntu_ssltests diff --git a/.github/workflows/reusable-build-win.yml b/.github/workflows/reusable-build-win.yml new file mode 100644 index 00000000000000..d75d9f2da07554 --- /dev/null +++ b/.github/workflows/reusable-build-win.yml @@ -0,0 +1,53 @@ +on: + workflow_call: + inputs: + free-threaded: + required: false + type: boolean + default: false + +jobs: + build_win_32: + name: 'build and test (x86)' + runs-on: windows-latest + timeout-minutes: 60 + env: + IncludeUwp: 'true' + steps: + - uses: actions/checkout@v4 + - name: Build CPython + run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }} + - name: Display build info + run: .\python.bat -m test.pythoninfo + - name: Tests + run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci + + build_win_amd64: + name: 'build and test (x64)' + runs-on: windows-latest + timeout-minutes: 60 + env: + IncludeUwp: 'true' + steps: + - uses: actions/checkout@v4 + - name: Register MSVC problem matcher + run: echo "::add-matcher::.github/problem-matchers/msvc.json" + - name: Build CPython + run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }} + - name: Display build info + run: .\python.bat -m test.pythoninfo + - name: Tests + run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci + + build_win_arm64: + name: 'build (arm64)' + runs-on: windows-latest + timeout-minutes: 60 + env: + IncludeUwp: 'true' + steps: + - uses: actions/checkout@v4 + - name: Register MSVC problem matcher + run: echo "::add-matcher::.github/problem-matchers/msvc.json" + - name: Build CPython + run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }} From 69f5ad8c738dd7220e38bace74d46c66760f4ab1 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Mon, 30 Oct 2023 23:35:57 +0900 Subject: [PATCH 2/8] Apply suggestions from code review Co-authored-by: Hugo van Kemenade --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c6ece07a57ed5..29c0f01a7d6743 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -182,13 +182,13 @@ jobs: name: 'Windows' needs: check_source if: needs.check_source.outputs.run_tests == 'true' - uses: ./.github/workflows/reusable-build-win.yml + uses: ./.github/workflows/reusable-build-windows.yml build_win_free_threaded: name: 'Windows (free-threaded)' needs: check_source if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded') - uses: ./.github/workflows/reusable-build-win.yml + uses: ./.github/workflows/reusable-build-windows.yml with: free-threaded: true From d874a25e355b7f5b0bf1d8057b675667814833dc Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Mon, 30 Oct 2023 23:36:58 +0900 Subject: [PATCH 3/8] Update --- .github/workflows/build.yml | 2 +- .github/workflows/reusable-build-win.yml | 53 ------------------------ 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 .github/workflows/reusable-build-win.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29c0f01a7d6743..87e41feaada233 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -540,7 +540,7 @@ jobs: - check_source # Transitive dependency, needed to access `run_tests` value - check-docs - check_generated_files - - build_win + - build_windows - build_macos - build_ubuntu - build_ubuntu_ssltests diff --git a/.github/workflows/reusable-build-win.yml b/.github/workflows/reusable-build-win.yml deleted file mode 100644 index d75d9f2da07554..00000000000000 --- a/.github/workflows/reusable-build-win.yml +++ /dev/null @@ -1,53 +0,0 @@ -on: - workflow_call: - inputs: - free-threaded: - required: false - type: boolean - default: false - -jobs: - build_win_32: - name: 'build and test (x86)' - runs-on: windows-latest - timeout-minutes: 60 - env: - IncludeUwp: 'true' - steps: - - uses: actions/checkout@v4 - - name: Build CPython - run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }} - - name: Display build info - run: .\python.bat -m test.pythoninfo - - name: Tests - run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci - - build_win_amd64: - name: 'build and test (x64)' - runs-on: windows-latest - timeout-minutes: 60 - env: - IncludeUwp: 'true' - steps: - - uses: actions/checkout@v4 - - name: Register MSVC problem matcher - run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Build CPython - run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }} - - name: Display build info - run: .\python.bat -m test.pythoninfo - - name: Tests - run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci - - build_win_arm64: - name: 'build (arm64)' - runs-on: windows-latest - timeout-minutes: 60 - env: - IncludeUwp: 'true' - steps: - - uses: actions/checkout@v4 - - name: Register MSVC problem matcher - run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Build CPython - run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }} From 5451d22cc755bc83882abcab28ca7d3752aa2d11 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Mon, 30 Oct 2023 23:37:41 +0900 Subject: [PATCH 4/8] Update names --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87e41feaada233..b91e513553dbd7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,13 +178,13 @@ jobs: if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME run: make check-c-globals - build_win: + build_windows: name: 'Windows' needs: check_source if: needs.check_source.outputs.run_tests == 'true' uses: ./.github/workflows/reusable-build-windows.yml - build_win_free_threaded: + build_windows_free_threaded: name: 'Windows (free-threaded)' needs: check_source if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded') From 0103ca4d97123d20877cf4c6cef06de5f797a843 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Mon, 30 Oct 2023 23:39:26 +0900 Subject: [PATCH 5/8] Add files --- .github/workflows/reusable-build-windows.yml | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/reusable-build-windows.yml diff --git a/.github/workflows/reusable-build-windows.yml b/.github/workflows/reusable-build-windows.yml new file mode 100644 index 00000000000000..d75d9f2da07554 --- /dev/null +++ b/.github/workflows/reusable-build-windows.yml @@ -0,0 +1,53 @@ +on: + workflow_call: + inputs: + free-threaded: + required: false + type: boolean + default: false + +jobs: + build_win_32: + name: 'build and test (x86)' + runs-on: windows-latest + timeout-minutes: 60 + env: + IncludeUwp: 'true' + steps: + - uses: actions/checkout@v4 + - name: Build CPython + run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }} + - name: Display build info + run: .\python.bat -m test.pythoninfo + - name: Tests + run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci + + build_win_amd64: + name: 'build and test (x64)' + runs-on: windows-latest + timeout-minutes: 60 + env: + IncludeUwp: 'true' + steps: + - uses: actions/checkout@v4 + - name: Register MSVC problem matcher + run: echo "::add-matcher::.github/problem-matchers/msvc.json" + - name: Build CPython + run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }} + - name: Display build info + run: .\python.bat -m test.pythoninfo + - name: Tests + run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci + + build_win_arm64: + name: 'build (arm64)' + runs-on: windows-latest + timeout-minutes: 60 + env: + IncludeUwp: 'true' + steps: + - uses: actions/checkout@v4 + - name: Register MSVC problem matcher + run: echo "::add-matcher::.github/problem-matchers/msvc.json" + - name: Build CPython + run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }} From 4f17e1af0dbce3b7959b93b41baaf040dee790cc Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Mon, 30 Oct 2023 23:40:18 +0900 Subject: [PATCH 6/8] Update --- .github/workflows/reusable-build-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-build-windows.yml b/.github/workflows/reusable-build-windows.yml index d75d9f2da07554..a2bc10518a0e92 100644 --- a/.github/workflows/reusable-build-windows.yml +++ b/.github/workflows/reusable-build-windows.yml @@ -7,7 +7,7 @@ on: default: false jobs: - build_win_32: + build_windows_32: name: 'build and test (x86)' runs-on: windows-latest timeout-minutes: 60 @@ -22,7 +22,7 @@ jobs: - name: Tests run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci - build_win_amd64: + build_windows_amd64: name: 'build and test (x64)' runs-on: windows-latest timeout-minutes: 60 @@ -39,7 +39,7 @@ jobs: - name: Tests run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci - build_win_arm64: + build_windows_arm64: name: 'build (arm64)' runs-on: windows-latest timeout-minutes: 60 From 251deea15689bcb264a53b36944b7d4e7c474a05 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Mon, 30 Oct 2023 23:42:34 +0900 Subject: [PATCH 7/8] Revert "Update" This reverts commit 4f17e1af0dbce3b7959b93b41baaf040dee790cc. --- .github/workflows/reusable-build-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-build-windows.yml b/.github/workflows/reusable-build-windows.yml index a2bc10518a0e92..d75d9f2da07554 100644 --- a/.github/workflows/reusable-build-windows.yml +++ b/.github/workflows/reusable-build-windows.yml @@ -7,7 +7,7 @@ on: default: false jobs: - build_windows_32: + build_win_32: name: 'build and test (x86)' runs-on: windows-latest timeout-minutes: 60 @@ -22,7 +22,7 @@ jobs: - name: Tests run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci - build_windows_amd64: + build_win_amd64: name: 'build and test (x64)' runs-on: windows-latest timeout-minutes: 60 @@ -39,7 +39,7 @@ jobs: - name: Tests run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci - build_windows_arm64: + build_win_arm64: name: 'build (arm64)' runs-on: windows-latest timeout-minutes: 60 From 9eb210e60dc639b377359f2441569e9a268e5a55 Mon Sep 17 00:00:00 2001 From: Donghee Na Date: Mon, 30 Oct 2023 23:43:07 +0900 Subject: [PATCH 8/8] fix --- .github/workflows/reusable-build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build-windows.yml b/.github/workflows/reusable-build-windows.yml index d75d9f2da07554..29e0a7e35b5450 100644 --- a/.github/workflows/reusable-build-windows.yml +++ b/.github/workflows/reusable-build-windows.yml @@ -7,7 +7,7 @@ on: default: false jobs: - build_win_32: + build_win32: name: 'build and test (x86)' runs-on: windows-latest timeout-minutes: 60