Dear Maintainer,
The device-tree-compiler package FTBFS with swig 4.5.0, which is currently in unstable. An excerpt of the build log is shown below.
This is due to the removal of the Python 2 compatibility macros in version 4.5.0. According to the SWIG authors, these macros were retained in the generated code (pyhead.swg) solely for user typemaps. Any typemap using these macros must be updated to call the Python 3 C API directly.
A patch for fixing the issue is available at the upstream Git repository:
https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=5008d1d6a356b8d0a78060da2e1021507d529cff
BTW, Upstream has released version 1.8.0, which contains the above patch, Isn't it time to update the package?
Best,
Rafael Laboissière
##### Build log excerpt
running build_ext
building '_libfdt' extension
swigging <<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt.i to <<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c
swig -python -I<<BUILD-DIR>>/device-tree-compiler-1.7.2/./libfdt -o <<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c <<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt.i
creating build/temp.linux-x86_64-cpython-314<<BUILD-DIR>>/device-tree-compiler-1.7.2/pylibfdt
x86_64-linux-gnu-gcc -g -Os -fPIC -Werror -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=<<BUILD-DIR>>/device-tree-compiler-1.7.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Wer
ror=format-security -fcf-protection -Wno-error -I/usr/include/valgrind -Wno-error -Wdate-time -D_FORTIFY_SOURCE=2 -I libfdt -I . -fPIC -DPY_SSIZE_T_CLEAN -I<<BUILD-DIR>>/device-tree-compiler-1.7.2/./libfdt -I/us
r/include/python3.14 -c <<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c -o build/temp.linux-x86_64-cpython-314<<BUILD-DIR>>/device-tree-compiler-1.7.2/pylibfdt/libfdt_wrap.o
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’:
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c:5555:20: error: implicit declaration of function ‘PyInt_AsLong’; did you mean ‘PyLong_AsLong’? [-Wimplicit-function-declaration]
5555 | depth3 = (int) PyInt_AsLong(swig_obj[2]);
| ^~~~~~~~~~~~
| PyLong_AsLong
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_get_property_by_offset’:
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c:6606:19: error: implicit declaration of function ‘PyString_FromString’; did you mean ‘PyLong_FromString’? [-Wimplicit-function-declaration]
6606 | resultobj = PyString_FromString(
| ^~~~~~~~~~~~~~~~~~~
| PyLong_FromString
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c:6606:17: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
6606 | resultobj = PyString_FromString(
| ^
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_get_property_by_offset_w’:
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c:6660:17: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
6660 | resultobj = PyString_FromString(
| ^
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_get_property’:
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c:6723:17: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
6723 | resultobj = PyString_FromString(
| ^
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_get_property_w’:
<<BUILD-DIR>>/device-tree-compiler-1.7.2/./pylibfdt/libfdt_wrap.c:6788:17: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
6788 | resultobj = PyString_FromString(
| ^
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
make[3]: *** [pylibfdt/Makefile.pylibfdt:21: pylibfdt/_libfdt.so] Error 1