OpenWrt 22.XX and python3-docutils does not compile

hi wondering why python3-docutils does not compile in openwrt 22.xx

always the same error
The "distutils" standard module, which is required for the
installation of Docutils, could not be found.

even then though it seams to exist and is found in the python build directory

python3-distutils is a host side build dependency for OpenWrt.

thank you for the reply not having issue with python3-distutils build having trouble building python3-docutils every time i try to build a package that relies on python3-docutils i fail at the same point . I have all those build dependencies installed. when I go through openwrt prebuild package f.. for python3-docutils none have python3-docutils built and an are missing for openwrt 22.xxx but exists in older openwrt build 21, 19 etc

I am having the same issue. While attempting to perform a build of all userspace packages, it fails on python3-docutils with:

touch /mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/.configured_68b329da9893e34099c7d8ad5cb9c940
rm -f /mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/.built
touch /mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/.built_check
install -d -m0755 /mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/ipkg-install//usr/lib/python3.10/site-packages
cd "/mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/" && CC="arm-openwrt-linux-muslgnueabi-gcc" CCSHARED="arm-openwrt-linux-muslgnueabi-gcc -DPIC -fpic" CXX="arm-openwrt-linux-muslgnueabi-g++" LD="arm-openwrt-linux-muslgnueabi-gcc" LDSHARED="arm-openwrt-linux-muslgnueabi-gcc -shared" CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14=docutils-0.14 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CPPFLAGS="-I/mnt/extnbd/devel/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/usr/include -I/mnt/extnbd/devel/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include/fortify -I/mnt/extnbd/devel/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/include -I/mnt/extnbd/devel/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/include/python3.10" LDFLAGS="-L/mnt/extnbd/devel/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/usr/lib -L/mnt/extnbd/devel/openwrt/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/lib -znow -zrelro -lpython3.10" _PYTHON_HOST_PLATFORM="linux-arm" __PYVENV_LAUNCHER__="/usr/bin/python3.10" PYTHONPATH="/mnt/extnbd/devel/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib/python3.10:/mnt/extnbd/devel/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi//usr/lib/python3.10/site-packages:/mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/ipkg-install//usr/lib/python3.10/site-packages" PYTHONDONTWRITEBYTECODE=1 PYTHONOPTIMIZE="" _python_sysroot="/mnt/extnbd/devel/openwrt/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi" _python_prefix="/usr" _python_exec_prefix="/usr"     /mnt/extnbd/devel/openwrt/staging_dir/hostpkg/bin/python3.10  setup.py   install --prefix="/usr" --root="/mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/ipkg-install" 
Error: The "distutils" standard module, which is required for the 
installation of Docutils, could not be found.  You may need to 
install a package called "python-devel" (or similar) on your 
system using your package manager.
make[2]: *** [Makefile:40: /mnt/extnbd/devel/openwrt/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/pypi/docutils-0.14/.built] Error 1
make[2]: Leaving directory '/mnt/extnbd/devel/openwrt/feeds/packages/lang/python/python-docutils'
time: package/feeds/packages/python-docutils/compile#1.05#0.09#1.11
    ERROR: package/feeds/packages/python-docutils failed to build.
make[1]: *** [package/Makefile:116: package/feeds/packages/python-docutils/compile] Error 1
make[1]: Leaving directory '/mnt/extnbd/devel/openwrt'
make: *** [/mnt/extnbd/devel/openwrt/include/toplevel.mk:230: package/python-docutils/compile] Error 2

My host system, Ubuntu-based, has all the python devel packages including python3-distutil and python3-distutil-extra. I tried building other packages which I know are dependent on python3-distutils, like libmbim and luci-app-ksmbd and they compile with no issues.

Looking at the log, though, it doesn't seem as if it it's trying to use my host system's python at all here. It looks like it's failing when it tries to use its own built-in hostpkg python3, and that seems not to have distutils with it.

Any insights?

Hi
Didn't solve that issue since it appeared in 22.03.
But in my config it fails as soon as i incorporate luci-app-ksmbd in my build (which surprisingly works your side??).

Program stderr:

Traceback (most recent call last):
  File "<string>", line 5, in <module>
ModuleNotFoundError: No module named 'distutils.command'


../../../../build_dir/target-mipsel_24kc_musl/glib-2.70.5/meson.build:2209:0: ERROR: <PythonExternalProgram 'python3' -> ['/home/francis/openwrt/staging_dir/host/bin/python3']> is not a valid python or it is missing distutils

Therfore now i donnot include it and later download the package from the Openwrt repo
Not very nice....

Checking for python3-distutils package availability it look like it is not part of the distribution (fresh clone of the 22.03.3).
python3 is well located in ~/feeds/packages/lang/python but python3-distutils is not
Do i made a mistake while looking for this?

Ok I missed to update my PC according slh suggestion (see build system setup)
once done, the compil goes well
THX