#1145314 device-tree-compiler: FTBFS with swig 4.5.0

#1145314#5
Date:
2026-08-24 06:48:40 UTC
From:
To:
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

#1145314#8
Date:
2026-08-30 09:51:01 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
device-tree-compiler, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1145149@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Héctor Orón Martínez <zumbi@debian.org> (supplier of updated device-tree-compiler package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 30 Aug 2026 11:06:08 +0200
Source: device-tree-compiler
Architecture: source
Version: 1.8.1-1
Distribution: unstable
Urgency: medium
Maintainer: Héctor Orón Martínez <zumbi@debian.org>
Changed-By: Héctor Orón Martínez <zumbi@debian.org>
Closes: 1112314 1145149
Changes:
 device-tree-compiler (1.8.1-1) unstable; urgency=medium
 .
   * New upstream release. (Closes: #1145149)
   * d/rules: switch package to meson upstream build system
   * d/patches: sync up latest upstream, disable not needed ones
   * d/libfdt-dev.install: add libfdt.pc file (Closes: #1112314)
   * d/control: add python3 dh sequence
   * d/lintian-overrides: warning about missing manpage
   * d/copyright: update FSF address
Checksums-Sha1:
 c2a5919f8df5c24cd9779f60087bad31d6381182 2496 device-tree-compiler_1.8.1-1.dsc
 b6c7faff2ff535d5fb8dbf617d307f1cd6f94e73 227851 device-tree-compiler_1.8.1.orig.tar.gz
 6a374155c48183943291abd7c4797f38d9c68568 44868 device-tree-compiler_1.8.1-1.debian.tar.xz
 4b8f5ed3d51cac29fb24e930ee3520622275936b 9055 device-tree-compiler_1.8.1-1_source.buildinfo
Checksums-Sha256:
 664f2d1dd66b9a69545f4434996f6d45a15611ffb9dfe0bdc1d93df83a262e65 2496 device-tree-compiler_1.8.1-1.dsc
 14de29de0b3aa95b2dec0fa63340395e0f412e1a4f5f7b3966db407291e5bd4f 227851 device-tree-compiler_1.8.1.orig.tar.gz
 7217dff9ba1f5cae5172a5b46dbe9679682d84831cfc7a169911a58bc619a82d 44868 device-tree-compiler_1.8.1-1.debian.tar.xz
 5e5bd518e43be23a00a27f96ece9d4000c109c8d1c0b6f426b1dc2b3f4006470 9055 device-tree-compiler_1.8.1-1_source.buildinfo
Files:
 a95cf4fe9c25bc8bfb7540884ab810ed 2496 devel optional device-tree-compiler_1.8.1-1.dsc
 4d5faf836fcc65f5bc350c1e409cc795 227851 devel optional device-tree-compiler_1.8.1.orig.tar.gz
 3a9dde8d14af8c14ace6c47341556e45 44868 devel optional device-tree-compiler_1.8.1-1.debian.tar.xz
 6e526d28d109c3e58d0fb6b931b53ecb 9055 devel optional device-tree-compiler_1.8.1-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE6Q8IiVReeMgqnedOryKDqnbirHsFAmqT+eMACgkQryKDqnbi
rHvg+A//SFAoHv4tTOa6Xv5V8GhWi1rQk69msP4tjscsZWkQf13koz2R4tvrj8ef
/L3yqx0lxXGU4NJ1Cf9bTAPndd/UMRoZAASlACd8YANB+l2/vNzrDi0tGg6O2Jgo
qPRNizUemq9+NaXfcYI62bXPgpNdTTrxgTdLIMVPY8eQzqV7YKpuiyQ7B1ug8pji
V57jFp3/vn+13uZJwOGevT8NTur0hT0brHVaYBtiDRYP1I2pylHlTdc1D/g9blcV
Im/nE4e24XezAaKh0asCiJ2nZmUCY3WAmNCkCTli5Xa2TWzbqf9PVMe7n5NX6QCl
/vTU97WDy0N6grwx11VzwkWwgCqH+OWanIYob7uHml0LdC/6Rvq7J7EIAlo8SQpV
Kvf+nhdS5FrKoFoJqvRNmqO8RmufRzq32ma4eHXApwAXOatzNprjplio++RsZUUQ
z+0XKBB3BULDiU0kg5le113Yn+BKoutJ9k/KbqKKjY07AWNq6LPOEOP/I9tq2GSX
9kqbAHrKnUGK9pdxve0Jbp35hDGrk7WZNKqYbiY1uB5Dn+I3j0K/6zUmzQUm7+Kz
K7ToPnduGWqjW7eLq8INPkvHGeAldonRF8HVgaQCEd978TslZfteF6Ut/OBiyOLK
xI2LwaDHmQeZOlZMeSTo6QJfj+U9izNrBT1UkoEwQNdEF9kASOM=
=oD5/
-----END PGP SIGNATURE-----