#1152563 pcapy-ng: FTBFS: bpfobj.cc:13:10: fatal error: Python.h: No such file or directory

#1152563#5
Date:
2026-10-30 11:22:53 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202610/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:pcapy-ng, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
I: pybuild base:383: /usr/bin/python3.15 setup.py build
running build
running build_ext
building 'pcapy' extension
x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.15 -c bpfobj.cc -o build/temp.linux-x86_64-cpython-315/bpfobj.o
bpfobj.cc:13:10: fatal error: Python.h: No such file or directory
   13 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
error: Command ['x86_64-linux-gnu-g++', '-g', '-O2', '-ffile-prefix-map=/<<PKGBUILDDIR>>=.', '-fstack-protector-strong', '-fstack-clash-protection', '-Wformat', '-Werror=format-security', '-fcf-protection', '-Wdate-time', '-D_FORTIFY_SOURCE=2', '-fPIC', '-I/usr/include/python3.15', '-c', 'bpfobj.cc', '-o', 'build/temp.linux-x86_64-cpython-315/bpfobj.o'] returned non-zero exit status 1.
E: pybuild pybuild:485: build: plugin distutils failed with: exit code=1: /usr/bin/python3.15 setup.py build
I: pybuild base:383: /usr/bin/python3 setup.py build
running build
running build_ext
building 'pcapy' extension
x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.14 -c bpfobj.cc -o build/temp.linux-x86_64-cpython-314/bpfobj.o
bpfobj.cc: In function ‘PyObject* p_new_bpfobject(PyTypeObject*, PyObject*, PyObject*)’:
bpfobj.cc:181:26: warning: ‘int pcap_compile_nopcap(int, int, bpf_program*, const char*, int, bpf_u_int32)’ is deprecated: use pcap_open_dead(), pcap_compile() and pcap_close() [-Wdeprecated-declarations]
  181 |   if (pcap_compile_nopcap((1<<16), linktype, &bpfprog, filter_string, 0, 0)){
      |       ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/pcap.h:43,
                 from bpfobj.cc:12:
/usr/include/pcap/pcap.h:656:17: note: declared here
  656 | PCAP_API int    pcap_compile_nopcap(int, int, struct bpf_program *,
      |                 ^~~~~~~~~~~~~~~~~~~
bpfobj.cc: In function ‘PyObject* p_filter(bpfobject*, PyObject*)’:
bpfobj.cc:213:22: warning: ‘u_int bpf_filter(const bpf_insn*, const u_char*, u_int, u_int)’ is deprecated: use pcap_offline_filter() [-Wdeprecated-declarations]
  213 |   status = bpf_filter(bpf->bpf.bf_insns,
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
  214 |                       packet,
      |                       ~~~~~~~
  215 |                       len, len);
      |                       ~~~~~~~~~
In file included from /usr/include/pcap/pcap.h:130:
/usr/include/pcap/bpf.h:267:17: note: declared here
  267 | PCAP_API u_int  bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
      |                 ^~~~~~~~~~
x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.14 -c pcap_pkthdr.cc -o build/temp.linux-x86_64-cpython-314/pcap_pkthdr.o
x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.14 -c pcapdumper.cc -o build/temp.linux-x86_64-cpython-314/pcapdumper.o
x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.14 -c pcapobj.cc -o build/temp.linux-x86_64-cpython-314/pcapobj.o
pcapobj.cc: In function ‘PyObject* p_loop_to_buffer(pcapobject*, PyObject*, PyObject*)’:
pcapobj.cc:1378:12: warning: ignoring return value of ‘int pcap_loop(pcap_t*, int, pcap_handler, u_char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 1378 |   pcap_loop(pp->pcap, cant, BufferCallBack, (u_char*)&b);
      |   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.14 -c pcapy.cc -o build/temp.linux-x86_64-cpython-314/pcapy.o
pcapy.cc: In function ‘PyObject* lookupdev(PyObject*, PyObject*)’:
pcapy.cc:40:23: warning: ‘char* pcap_lookupdev(char*)’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
   40 |   dev = pcap_lookupdev(errbuff);
      |         ~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/pcap.h:43,
                 from pcapy.cc:12:
/usr/include/pcap/pcap.h:419:18: note: declared here
  419 | PCAP_API char   *pcap_lookupdev(char *);
      |                  ^~~~~~~~~~~~~~
x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-z,relro -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-cpython-314/bpfobj.o build/temp.linux-x86_64-cpython-314/pcap_pkthdr.o build/temp.linux-x86_64-cpython-314/pcapdumper.o build/temp.linux-x86_64-cpython-314/pcapobj.o build/temp.linux-x86_64-cpython-314/pcapy.o -L/usr/lib/x86_64-linux-gnu -lpcap -o /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_python3-pcapy/build/pcapy.cpython-314-x86_64-linux-gnu.so
dh_auto_build: error: pybuild --build -i python{version} -p "3.15 3.14" --parallel=2 returned exit code 13
make: *** [debian/rules:7: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------