#1076206 pybj: fails to build extension but build still succeeds

Package:
src:pybj
Source:
src:pybj
Submitter:
Graham Inggs
Date:
2026-09-09 21:09:01 UTC
Severity:
normal
Tags:
#1076206#5
Date:
2024-07-12 14:21:41 UTC
From:
To:
Hi Maintainer

pybj fails to build its extension, but the build still succeeds.
Noticed in the recent rebuild for Python 3.12 only [1].  I've copied
what I hope is the relevant part of the log below.

Regards
Graham


[1] https://buildd.debian.org/status/fetch.php?pkg=pybj&arch=amd64&ver=0.2.6-2%2Bb1&stamp=1720780666&raw=0


running build
running build_py
running build_ext
building '_bjdata' extension
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g
-O2 -Wall -g -O2 -Werror=implicit-function-declaration
-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.12 -c src/_bjdata.c -o
build/temp.linux-x86_64-cpython-312/src/_bjdata.o -std=c99
-DUSE__BJDATA
x86_64-linux-gnu-gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g
-O2 -Wall -g -O2 -Werror=implicit-function-declaration
-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.12 -c src/decoder.c -o
build/temp.linux-x86_64-cpython-312/src/decoder.o -std=c99
-DUSE__BJDATA
src/decoder.c:20:10: fatal error: numpy/arrayobject.h: No such file or directory
   20 | #include <numpy/arrayobject.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
/<<PKGBUILDDIR>>/setup.py:64: UserWarning: Extension module _bjdata:
The output above this warning shows how the compilation failed.
  warnings.warn("Extension module %s: The output above this warning
shows how the compilation failed."
command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
running install_lib

#1076206#10
Date:
2026-09-09 21:06:22 UTC
From:
To:
user debian-python@lists.debian.org
usertags 1076206 python3.15
tags 1076206 patch
thanks

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version I ran into this failure [1].

In order to solve it, I have:
- Dropped the broken numpy dependency
- Updated debian/control to rely on dh-sequence-numpy3 instead of
   setting the abi manually
- Backported upstream commit a46355a0: fix pip ext compilation error,
   [2] to add include_dirs=[numpy.get_include()] and import numpy in
   setup.py.
- Added patch to replace deprecated PyArray_* constants with NPY_*.
- Updated the recursion patch "C extension does not use Python recursion
   limit in Python 3.12+"

I've applied these fixes in the sandbox [3] to verify that it builds
successfully and that the extension is present in the result. These
fixes should be applied in Debian to get the package back to a healthy
state.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/TODO/
[2]: https://github.com/NeuroJSON/pybj/commit/a46355a0b0df0bec1817b04368a5a573358645ef
[3]: https://debusine.debian.net/debian/r-python-python3.15/