Skip to content

Commit b586066

Browse files
committed
Debug windows
1 parent e4c7608 commit b586066

File tree

1 file changed

+190
-0
lines changed

1 file changed

+190
-0
lines changed
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
name: Debug Windows
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
12+
cancel-in-progress: true
13+
14+
env:
15+
FORCE_COLOR: 1
16+
17+
jobs:
18+
build-context:
19+
name: Change detection
20+
# To use boolean outputs from this job, parse them as JSON.
21+
# Here's some examples:
22+
#
23+
# if: fromJSON(needs.build-context.outputs.run-docs)
24+
#
25+
# ${{
26+
# fromJSON(needs.build-context.outputs.run-tests)
27+
# && 'truthy-branch'
28+
# || 'falsy-branch'
29+
# }}
30+
#
31+
uses: ./.github/workflows/reusable-context.yml
32+
33+
check-docs:
34+
name: Docs
35+
needs: build-context
36+
if: fromJSON(needs.build-context.outputs.run-docs)
37+
uses: ./.github/workflows/reusable-docs.yml
38+
39+
check_autoconf_regen:
40+
name: 'Check if Autoconf files are up to date'
41+
# Don't use ubuntu-latest but a specific version to make the job
42+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
43+
runs-on: ubuntu-24.04
44+
container:
45+
image: ghcr.io/python/autoconf:2025.01.02.12581854023
46+
timeout-minutes: 60
47+
needs: build-context
48+
if: needs.build-context.outputs.run-tests == 'true'
49+
steps:
50+
- name: Install Git
51+
run: |
52+
apt update && apt install git -yq
53+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
54+
- uses: actions/checkout@v4
55+
with:
56+
fetch-depth: 1
57+
persist-credentials: false
58+
- name: Runner image version
59+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
60+
- name: Check Autoconf and aclocal versions
61+
run: |
62+
grep "Generated by GNU Autoconf 2.72" configure
63+
grep "aclocal 1.16.5" aclocal.m4
64+
grep -q "runstatedir" configure
65+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
66+
- name: Regenerate autoconf files
67+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
68+
run: autoreconf -ivf -Werror
69+
- name: Check for changes
70+
run: |
71+
git add -u
72+
changes=$(git status --porcelain)
73+
# Check for changes in regenerated files
74+
if test -n "$changes"; then
75+
echo "Generated files not up to date."
76+
echo "Perhaps you forgot to run make regen-configure ;)"
77+
echo "configure files must be regenerated with a specific version of autoconf."
78+
echo "$changes"
79+
echo ""
80+
git diff --staged || true
81+
exit 1
82+
fi
83+
84+
check_generated_files:
85+
name: 'Check if generated files are up to date'
86+
# Don't use ubuntu-latest but a specific version to make the job
87+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
88+
runs-on: ubuntu-24.04
89+
timeout-minutes: 60
90+
needs: build-context
91+
if: needs.build-context.outputs.run-tests == 'true'
92+
steps:
93+
- uses: actions/checkout@v4
94+
with:
95+
persist-credentials: false
96+
- uses: actions/setup-python@v5
97+
with:
98+
python-version: '3.x'
99+
- name: Runner image version
100+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
101+
- name: Restore config.cache
102+
uses: actions/cache@v4
103+
with:
104+
path: config.cache
105+
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
106+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.build-context.outputs.config-hash }}-${{ env.pythonLocation }}
107+
- name: Install Dependencies
108+
run: sudo ./.github/workflows/posix-deps-apt.sh
109+
- name: Add ccache to PATH
110+
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
111+
- name: Configure ccache action
112+
uses: hendrikmuhs/[email protected]
113+
with:
114+
save: false
115+
- name: Configure CPython
116+
run: |
117+
# Build Python with the libpython dynamic library
118+
./configure --config-cache --with-pydebug --enable-shared
119+
- name: Build CPython
120+
run: |
121+
make -j4 regen-all
122+
make regen-stdlib-module-names regen-sbom regen-unicodedata
123+
- name: Check for changes
124+
run: |
125+
git add -u
126+
changes=$(git status --porcelain)
127+
# Check for changes in regenerated files
128+
if test -n "$changes"; then
129+
echo "Generated files not up to date."
130+
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
131+
echo "configure files must be regenerated with a specific version of autoconf."
132+
echo "$changes"
133+
echo ""
134+
git diff --staged || true
135+
exit 1
136+
fi
137+
- name: Check exported libpython symbols
138+
run: make smelly
139+
- name: Check limited ABI symbols
140+
run: make check-limited-abi
141+
- name: Check for unsupported C global variables
142+
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
143+
run: make check-c-globals
144+
145+
build_windows:
146+
name: >-
147+
Windows
148+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
149+
needs: build-context
150+
if: fromJSON(needs.build-context.outputs.run-windows-tests)
151+
strategy:
152+
fail-fast: false
153+
matrix:
154+
os:
155+
- windows-latest
156+
arch:
157+
- x64
158+
free-threading:
159+
- false
160+
- true
161+
include:
162+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
163+
arch: arm64
164+
free-threading: false
165+
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
166+
arch: arm64
167+
free-threading: true
168+
- os: windows-latest
169+
arch: Win32
170+
free-threading: false
171+
uses: ./.github/workflows/reusable-windows.yml
172+
with:
173+
os: ${{ matrix.os }}
174+
arch: ${{ matrix.arch }}
175+
free-threading: ${{ matrix.free-threading }}
176+
177+
build_windows_msi:
178+
name: >- # ${{ '' } is a hack to nest jobs under the same sidebar category
179+
Windows MSI${{ '' }}
180+
needs: build-context
181+
if: fromJSON(needs.build-context.outputs.run-windows-msi)
182+
strategy:
183+
matrix:
184+
arch:
185+
- x86
186+
- x64
187+
- arm64
188+
uses: ./.github/workflows/reusable-windows-msi.yml
189+
with:
190+
arch: ${{ matrix.arch }}

0 commit comments

Comments
 (0)