[X] This is a pyzmq-specific bug, not an issue of zmq socket behavior. Don't worry if you're not sure! We'll figure it out together.
What pyzmq version?
b771427b54bdc5df431c3f1875fe5453afc0f6f5
What libzmq version?
n/a
Python version (and how it was installed)
PyPy 3.10 7.3.16; Gentoo package
OS
Gentoo Linux amd64
What happened?
When building with GCC 14 and PyPy3.10, the CFFI sources fail to build with an error:
* Building wheel...
*** scikit-build-core 0.9.3 using CMake 3.29.3 (wheel)
*** Configuring CMake...
2024-05-09 16:38:37,410 - scikit_build_core - WARNING - Can't find a Python library, got libdir=/usr/bin, ldlibrary=libpypy3.9-c.so, multiarch=x86_64-linux-gnu, masd=None
loading initial cache file /tmp/tmp8_vvg8mg/build/CMakeInit.txt
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: /tmp/build-env-socmms5_/bin/python (found version "3.10.14") found components: Interpreter Development.Module
-- Looking for libzmq
-- Looking for libzmq with pkg-config
-- Checking for module 'libzmq'
-- Found libzmq, version 4.3.5
-- Looking for libzmq with pkg-config - found: -L/usr/lib64 -lzmq
-- Using Python PyPy /tmp/build-env-socmms5_/bin/python
-- Building CFFI backend
-- Linking libzmq target PkgConfig::libzmq
-- Configuring done (0.8s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/tmp8_vvg8mg/build
*** Building project with Ninja...
[1/3] Generating _src/_cffi.c
generating /tmp/tmp8_vvg8mg/build/_src/_cffi.c
[2/3] Building C object CMakeFiles/_cffi.dir/_src/_cffi.c.o
FAILED: CMakeFiles/_cffi.dir/_src/_cffi.c.o
/usr/bin/cc -D_cffi_EXPORTS -I/tmp/build-via-sdist-jveunolw/pyzmq-26.0.3/zmq/utils -isystem /usr/include/pypy3.10 -Werror=incompatible-pointer-types -O3 -DNDEBUG -fPIC -DZMQ_BUILD_DRAFT_API=1 -MD -MT CMakeFiles/_cffi.dir/_src/_cffi.c.o -MF CMakeFiles/_cffi.dir/_src/_cffi.c.o.d -o CMakeFiles/_cffi.dir/_src/_cffi.c.o -c /tmp/tmp8_vvg8mg/build/_src/_cffi.c
/tmp/tmp8_vvg8mg/build/_src/_cffi.c: In function ‘_cffi_checkfld__zhint’:
/tmp/tmp8_vvg8mg/build/_src/_cffi.c:2664:19: error: initialization of ‘void **’ from incompatible pointer type ‘mutex_t **’ [-Werror=incompatible-pointer-types]
2664 | { void * *tmp = &p->mutex; (void)tmp; }
| ^
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
*** CMake build failed
ERROR Backend subprocess exited when trying to invoke build_wheel
Code to reproduce bug
# Reproducer that works with earlier GCC versions
export CFLAGS='-Werror=incompatible-pointer-types'
pypy3 -m build
Traceback, if applicable
No response
More info
It seems to be caused by mutex being declared as void * in _cdefs.h, but as mutex_t * in _cffi_src.c. If I change the latter file to use a void * instead, it seems to compile, but I don't know whether this is the correct solution.
This is a pyzmq bug
What pyzmq version?
b771427b54bdc5df431c3f1875fe5453afc0f6f5
What libzmq version?
n/a
Python version (and how it was installed)
PyPy 3.10 7.3.16; Gentoo package
OS
Gentoo Linux amd64
What happened?
When building with GCC 14 and PyPy3.10, the CFFI sources fail to build with an error:
Code to reproduce bug
Traceback, if applicable
No response
More info
It seems to be caused by
mutex
being declared asvoid *
in_cdefs.h
, but asmutex_t *
in_cffi_src.c
. If I change the latter file to use avoid *
instead, it seems to compile, but I don't know whether this is the correct solution.