From aa58be650c14cf5b0ddcd8f609d8a2f78825d016 Mon Sep 17 00:00:00 2001 From: Catalin Patulea Date: Sun, 24 Mar 2024 16:21:37 -0400 Subject: [PATCH] Python build: fail loudly if extension modules fail to build. Otherwise, we can have a broken build: 2024-03-14T00:28:23.7126080Z /private/var/folders/1k/qq3pcbf12vb6vyblh81736p40000gn/T/python-build.20240314002650.3136/Python-3.11.7/Modules/_ctypes/callbacks.c:438:18: error: call to undeclared function 'ffi_prep_closure'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 2024-03-14T00:28:23.7172330Z result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p); 2024-03-14T00:28:23.7173100Z ^ 2024-03-14T00:28:23.7173690Z 1 error generated. 2024-03-14T00:28:24.1751690Z 2024-03-14T00:28:24.1753070Z Failed to build these modules: 2024-03-14T00:28:24.1780620Z _ctypes which causes problems later (https://github.com/Xpra-org/gtk-osx-build/issues/27#issuecomment-2016931078). --- gtk-osx-setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk-osx-setup.sh b/gtk-osx-setup.sh index 82dbd551..41936bb8 100755 --- a/gtk-osx-setup.sh +++ b/gtk-osx-setup.sh @@ -100,6 +100,7 @@ export PYTHON_CONFIGURE_OPTS="--enable-shared --with-system-ffi" #This really means pyenv's *python* version. It's poorly named but #it's defined by pyenv so it can't be changed. export PYENV_VERSION=$PYTHON_VERSION +export PYTHONSTRICTEXTENSIONBUILD=1 $PYENV install -v $PYENV_VERSION PIP="$PYENV_ROOT/shims/pip3"