Skip to content

Commit a547c51

Browse files
authored
Fix debug build setup (python#17822)
python#17819
1 parent 5d63463 commit a547c51

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ jobs:
9494
# This is broken. See
9595
# - https://github.com/python/mypy/issues/17819
9696
# - https://github.com/python/mypy/pull/17822
97-
# - name: mypyc runtime tests with py38-debug-build-ubuntu
98-
# python: '3.9.21'
97+
# - name: mypyc runtime tests with py310-debug-build-ubuntu
98+
# python: '3.10'
9999
# os: ubuntu-latest
100100
# toxenv: py
101101
# tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
@@ -152,24 +152,15 @@ jobs:
152152
with:
153153
persist-credentials: false
154154

155-
- name: Debug build
156-
if: ${{ matrix.debug_build }}
157-
run: |
158-
PYTHONVERSION=${{ matrix.python }}
159-
PYTHONDIR=~/python-debug/python-$PYTHONVERSION
160-
VENV=$PYTHONDIR/env
161-
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
162-
# TODO: does this do anything? env vars aren't passed to the next step right
163-
source $VENV/bin/activate
164155
- name: Latest dev build
165156
if: ${{ endsWith(matrix.python, '-dev') }}
166157
run: |
167158
git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch $( echo ${{ matrix.python }} | sed 's/-dev//' )
168159
cd /tmp/cpython
169160
echo git rev-parse HEAD; git rev-parse HEAD
170161
git show --no-patch
171-
sudo apt-get update
172-
sudo apt-get install -y --no-install-recommends \
162+
sudo apt-get update -q
163+
sudo apt-get install -q -y --no-install-recommends \
173164
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
174165
libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
175166
./configure --prefix=/opt/pythondev
@@ -178,6 +169,23 @@ jobs:
178169
sudo ln -s /opt/pythondev/bin/python3 /opt/pythondev/bin/python
179170
sudo ln -s /opt/pythondev/bin/pip3 /opt/pythondev/bin/pip
180171
echo "/opt/pythondev/bin" >> $GITHUB_PATH
172+
- name: Debug build
173+
if: ${{ matrix.debug_build }}
174+
run: |
175+
git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch ${{ matrix.python }}
176+
cd /tmp/cpython
177+
echo git rev-parse HEAD; git rev-parse HEAD
178+
git show --no-patch
179+
sudo apt-get update -q
180+
sudo apt-get install -q -y --no-install-recommends \
181+
build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
182+
libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
183+
./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug -with-trace-refs --prefix=/opt/pythondev
184+
make -j$(nproc)
185+
sudo make install
186+
sudo ln -s /opt/pythondev/bin/python3 /opt/pythondev/bin/python
187+
sudo ln -s /opt/pythondev/bin/pip3 /opt/pythondev/bin/pip
188+
echo "/opt/pythondev/bin" >> $GITHUB_PATH
181189
- uses: actions/setup-python@v5
182190
if: ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
183191
with:

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ identify==2.6.15
2222
# via pre-commit
2323
iniconfig==2.1.0
2424
# via pytest
25-
librt==0.7.3 ; platform_python_implementation != "PyPy"
25+
librt==0.7.8 ; platform_python_implementation != "PyPy"
2626
# via -r mypy-requirements.txt
2727
lxml==6.0.2 ; python_version < "3.15"
2828
# via -r test-requirements.in

0 commit comments

Comments
 (0)