diff mbox series

[meta-python] python3-pyzmq: Don't search the host's pkg-config directories

Message ID 20261113185005.2307591-1-philip@balister.org
State New
Headers show
Series [meta-python] python3-pyzmq: Don't search the host's pkg-config directories | expand

Commit Message

Philip Balister Nov. 13, 2026, 6:50 p.m. UTC
pyzmq's CMakeLists.txt appends the host's /usr (and /usr/local,
/opt/local, /opt/homebrew when present) to CMAKE_PREFIX_PATH. Since
PKG_CONFIG_USE_CMAKE_PREFIX_PATH defaults to on, pkg_check_modules()
turns that into PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/share/pkgconfig,
which pkg-config searches before PKG_CONFIG_LIBDIR, i.e. before the
sysroot.

On a build host with the zeromq development package installed, pyzmq
then reads the host's libzmq.pc instead of the target's. Fedora's
libzmq.pc carries -DZMQ_BUILD_DRAFT_API=1 in Cflags, so pyzmq is built
against the libzmq draft API, but the target libzmq is built without
it. The module then fails to import on the target:

  ImportError: .../zmq/backend/cython/_zmq.cpython-314-aarch64-linux-gnu.so:
  undefined symbol: zmq_poller_destroy

Set PKG_CONFIG_USE_CMAKE_PREFIX_PATH=OFF so pkg-config only sees the
sysroot.

Tested on a Fedora 43 host with zeromq-devel installed, building for
qemuarm64: before, _zmq.so referenced zmq_poller_{new,add,fd,destroy}
and "import zmq" failed on the target; after, it references none of
them and the gnuradio gr-zeromq ptests that import zmq pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Philip Balister <philip@balister.org>
---
 meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb b/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb
index 4cbf46cf0a..c2230a49b4 100644
--- a/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb
+++ b/meta-python/recipes-devtools/python/python3-pyzmq_27.2.0.bb
@@ -22,6 +22,7 @@  PEP517_BUILD_OPTS = "--skip-dependency-check \
                      -Ccmake.define.CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
                      -Ccmake.define.CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
                      -Ccmake.define.CMAKE_FIND_ROOT_PATH="${STAGING_DIR_NATIVE}" \
+                     -Ccmake.define.PKG_CONFIG_USE_CMAKE_PREFIX_PATH=OFF \
                      -Ccmake.build-type="RelWithDebInfo" \
                      -Cbuild-dir="${B}" \
 "