Closed sergiodj closed 4 months ago
I hit this on Fedora as well, and it's been there for a while. It seems to be an incompatible change in swig, or maybe in Python, or in the combination of the two somehow. Unfortunately, I don't know Python FFI well enough to fix it, and I don't really have time to learn. I've been hoping someone Python knowledgable would fix this :(.
Thanks, @dgibson.
To be clear, did you disable these specific tests on Fedora for now? I'm considering doing the same in Ubuntu/Debian.
FWIW I tried the testcases with Python3.12 with newer swig 4.2.0 that claims to have support for py3.12 and it fails the same way.
@sergiodj , sorry, I didn't mean the Fedora package of dtc - I'm not involved with that packaging. I meant that the upstream tests also fail running on my Fedora 39 system.
This has now become a blocker for python 3.12 for alpine. Does anybody have a fix or workaround?
Fix or workaround from Debian: https://sources.debian.org/patches/device-tree-compiler/1.7.0-2/fix-tests-for-Python3.12.patch/
Unfortunately not. I haven't had the time to continue debugging the issue, and meanwhile decided to skip the specific test.
@sergiodj this should be fixed by https://github.com/dgibson/dtc/commit/822123856980f84562406cc7bd1d4d6c2b8bc184
Thanks, @blmaier!
@sergiodj can you confirm that @blmaier 's commit fixes the problem? If so we can close the issue.
@dgibson I did a local build of the device-tree-compiler Debian package here with @blmaier's patch backported, and it works fine. Cc @zumbi
@sergiodj thanks for the confirmation.
Hi,
This bug is affecting both Debian and Ubuntu. I spent some time investigating it and I believe it's caused by some Python 3.12 change that's affecting SWIG, but I'm not entirely sure.
The relevant log snippet follows:
The relevant code here seems to be:
https://github.com/dgibson/dtc/blob/3fbfdd08afd2a7a25b27433f6f5678c0fe694721/pylibfdt/libfdt.i#L1189-L1197
When running with Python 3.11,
if (PyTuple_GET_SIZE(resultobj) == 0)
is true the first time we reach this point, which makes the list have the right number of elements. However, on Python 3.12 that check is never true (possibly becauseresultobj
has been initialized before and holds one element, but I couldn't find more details), which makes the final list have0
at the beginning.