Skip to content

Commit fe89c39

Browse files
committed
fix(manylinux2010): _ctypes module build
1 parent f76302a commit fe89c39

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docker/build_scripts/build-cpython.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ tar -xzf Python-${CPYTHON_VERSION}.tgz
3333
pushd Python-${CPYTHON_VERSION}
3434
PREFIX="/opt/_internal/cpython-${CPYTHON_VERSION}"
3535
mkdir -p ${PREFIX}/lib
36+
if [ "${AUDITWHEEL_POLICY}" == "manylinux2010" ]; then
37+
# The _ctypes stdlib module build started to fail with 3.10.0rc1
38+
# No clue what changed exactly yet
39+
# This workaround fixes the build
40+
LIBFFI_INCLUDEDIR=$(pkg-config --cflags-only-I libffi | tr -d '[:space:]')
41+
LIBFFI_INCLUDEDIR=${LIBFFI_INCLUDEDIR:2}
42+
cp ${LIBFFI_INCLUDEDIR}/ffi.h ${LIBFFI_INCLUDEDIR}/ffitarget.h /usr/include/
43+
fi
3644
# configure with hardening options only for the interpreter & stdlib C extensions
3745
# do not change the default for user built extension (yet?)
3846
./configure \
@@ -41,6 +49,9 @@ mkdir -p ${PREFIX}/lib
4149
--prefix=${PREFIX} --disable-shared --with-ensurepip=no > /dev/null
4250
make > /dev/null
4351
make install > /dev/null
52+
if [ "${AUDITWHEEL_POLICY}" == "manylinux2010" ]; then
53+
rm -f /usr/include/ffi.h /usr/include/ffitarget.h
54+
fi
4455
popd
4556
rm -rf Python-${CPYTHON_VERSION} Python-${CPYTHON_VERSION}.tgz Python-${CPYTHON_VERSION}.tgz.asc
4657

0 commit comments

Comments
 (0)