[Buildroot] [PATCH v2] package/python3: do build-time detection of non-working toolchain
Julien Olivain
ju.o at free.fr
Sun Sep 7 16:43:17 UTC 2025
On 29/08/2025 11:20, Arnout Vandecappelle via buildroot wrote:
> Since the bump to Python 3.13.2 in commit
> d63e207eb869063f82c867658676c2903beb08cb, there is a runtime assertion
> in Python when the toolchain doesn't support time64 [1]. The only such
> toolchain is one with uClibc and linux headers < 5.1.
>
> Encoding this dependency in Config.in was deemed to complicated (cfr.
> commit ffd00280315e60908d0d317b1dfb4c714590a03e).
>
> Instead, do a build-time check of the same condition. The check itself
> is a bit complicated, but it is localized to python3.mk and doesn't
> need
> to be propagated to all reverse dependencies.
>
> Testing such a corner case toolchain is a bit complicated. It can be
> done with the following configuration.
>
> BR2_arm=y
> BR2_cortex_a9=y
> BR2_ARM_ENABLE_VFP=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
> BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
> BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains.bootlin.com/downloads/releases/toolchains/armv7-eabihf/tarballs/armv7-eabihf--uclibc--stable-2018.02-1.tar.bz2"
> BR2_TOOLCHAIN_EXTERNAL_GCC_6=y
> BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_1=y
> BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
> BR2_TOOLCHAIN_EXTERNAL_CXX=y
> BR2_PACKAGE_PYTHON3=y
>
> It needs to be built in an environment that has libmpfr.so.4 installed
> as the pre-built toolchain from that era did not include it. An easy
> way to achieve this is to build this configuration under an old
> Buildroot Docker container:
>
> IMAGE=buildroot/base:20180205.0730 ./utils/docker-run make python3
>
> With a build-time check, the autobuilders could get build failures when
> generating such a config. However, the autobuilders cannot use a
> toolchain with this configuration (they only use more recent
> toolchains). Therefore, no update to genrandconfig is needed.
>
> [1]
> https://gitlab.com/buildroot.org/buildroot/-/issues/95#note_2348479811
>
> Cc: Vincent Fazio <vfazio at xes-inc.com>
> Cc: James Hilliard <james.hilliard1 at gmail.com>
> Signed-off-by: Arnout Vandecappelle <arnout at rnout.be>
Applied to master, thanks.
More information about the buildroot
mailing list