Skip to content

docker: fix pylibfdt build with swig 4.5 - #3192

Merged
nuclearcat merged 1 commit into
kernelci:mainfrom
nuclearcat:docker-pylibfdt-swig-4.5
Aug 24, 2026
Merged

docker: fix pylibfdt build with swig 4.5#3192
nuclearcat merged 1 commit into
kernelci:mainfrom
nuclearcat:docker-pylibfdt-swig-4.5

Conversation

@nuclearcat

Copy link
Copy Markdown
Member

Fix staging failure"
libfdt/libfdt_wrap.c:5555:20: error: implicit declaration of function 'PyInt_AsLong'; did you mean 'PyLong_AsLong'?

Define the two macros on the compiler command line, using the same replacements as the upstream fix in dtc commit 5008d1d6a356. They can be dropped once a pylibfdt release picks that fix up.

Installing dtschema and dt-schema pulls in pylibfdt, which has no
binary wheels and is built from source.  Its pyproject.toml lists swig
as a build dependency, so pip's build isolation fetches the newest
release from PyPI instead of using the distro package.  swig 4.5.0
removed the Python 2 compatibility macros from its runtime header
pyhead.swg, while pylibfdt still uses PyString_FromString() and
PyInt_AsLong() in its typemaps, so the generated wrapper no longer
compiles:

  libfdt/libfdt_wrap.c:5555:20: error: implicit declaration of
  function 'PyInt_AsLong'; did you mean 'PyLong_AsLong'?

Define the two macros on the compiler command line, using the same
replacements as the upstream fix in dtc commit 5008d1d6a356.  They can
be dropped once a pylibfdt release picks that fix up.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
@nuclearcat
nuclearcat added this pull request to the merge queue Aug 24, 2026
Merged via the queue into kernelci:main with commit bce6298 Aug 24, 2026
3 checks passed
@nuclearcat
nuclearcat deleted the docker-pylibfdt-swig-4.5 branch August 24, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant