Re: configure checks for python3-notmuch2 module

Subject: Re: configure checks for python3-notmuch2 module

Date: Thu, 15 Jul 2021 14:14:26 +0300

To: David Bremner,


From: Tomi Ollila

On Sun, Jul 11 2021, David Bremner wrote:

> It turns out we need pyconfig.h to build the (new) python bindings.  I
> don't think this is adequately checked for by the configure script,
> since I had a Fedora user report a build failure (during make install,
> which I found odd) missing pyconfig.h
> On Debian this is on libpython3.x-dev, which is not a dependency of the
> python3-cffi package.
> log follows.
> ----------------------------------------------------------------------
> cd bindings/python-cffi && \
> 	python3 build --build-lib build/stage && \
> 	mkdir -p build/stage/tests && cp tests/*.py build/stage/tests
> running build
> running build_py
> running build_ext
> generating cffi module 'build/temp.linux-x86_64-3.9/notmuch2._capi.c'
> creating build/temp.linux-x86_64-3.9
> building 'notmuch2._capi' extension
> creating build/temp.linux-x86_64-3.9/build
> creating build/temp.linux-x86_64-3.9/build/temp.linux-x86_64-3.9
> gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I../../lib -I/usr/include/python3.9 -c build/temp.linux-x86_64-3.9/notmuch2._capi.c -o b
>  ld/temp.linux-x86_64-3.9/build/temp.linux-x86_64-3.9/notmuch2._capi.o
> build/temp.linux-x86_64-3.9/notmuch2._capi.c:50:14: fatal error: pyconfig.h: No such file or directory
>    50 | #    include <pyconfig.h>
>       |              ^~~~~~~~~~~~
> compilation terminated.
> error: command '/usr/bin/gcc' failed with exit code 1

While me trying (Fedora 34 .. ooh no, 33 (but anyway ;D)):

$ ./configure
Checking for python3 cffi and setuptools...
No (will not install CFFI-based python bindings).

OK, why -- I do have cffi and setuptools python packages installed

$ script -c 'sh -x ./configure'

reveals (after trying w/ python 3.9 repl) that cffi.FFI().verify()
fails due to missing Python.h... let's hunt (again, I recall solving
this like a year ago or so..) ... apparently python3-devel needed.

$ sudo dnf install python3-devel
$ make distclean
$ ./configure --prefix=$PWD/TTT
$ make
$ make install

... hmm all worked.... pyconfig.h is part of python3-devel package

Have to check how all this behaves on Fedora 34 machine when I 
have access to one (currently away from such machines and from
power grid also (laptop battery power, which I have to preserve,
mobile devices gets charged by small solar panels so no problem
there ;D))

notmuch mailing list --
To unsubscribe send an email to