Skip to content

Commit a324693

Browse files
committed
Fix Windows build in Py3.14.
See python/cpython#133779
1 parent a79c92e commit a324693

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Tools/ci-run.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,15 @@ fi
8989
echo "===================="
9090

9191
# Install python requirements
92+
GIL_CFLAGS=""
9293
echo "Installing requirements [python]"
9394
if [[ $PYTHON_VERSION == "3.1"[2-9]* ]]; then
9495
python -m pip install -U pip wheel setuptools || exit 1
95-
if [[ $PYTHON_VERSION != *"t" ]]; then
96+
if [[ $PYTHON_VERSION == *"t" ]]; then
97+
# https://github.com/python/cpython/issues/133779
98+
GIL_CFLAGS="-DPy_GIL_DISABLED=0"
99+
export CFLAGS="$CFLAGS $GIL_CFLAGS"
100+
else
96101
# twine is not installable on freethreaded Python due to cryptography requirement
97102
python -m pip install -U twine || exit 1
98103
fi
@@ -154,6 +159,9 @@ if [[ $OSTYPE == "msys" ]]; then # for MSVC cl
154159
else
155160
CFLAGS="-O0 -ggdb -Wall -Wextra -Wcast-qual -Wconversion -Wdeprecated -Wunused-result"
156161
fi
162+
163+
CFLAGS="$CFLAGS $GIL_CFLAGS"
164+
157165
# Trying to cover debug assertions in the CI without adding
158166
# extra jobs. Therefore, odd-numbered minor versions of Python
159167
# running C++ jobs get NDEBUG undefined, and even-numbered

0 commit comments

Comments
 (0)