Although I'm using host-python, the nodejs build cycle uses at some point the system python instead of the host python. On Fedora 35 this is Python 3.10, causing problems. Switching to Python 3.9 system-wide fixes the issue.
Certain parts of the build invoke "python" and aren't using a full path to the bin to do so. While PATH has been set to include the host built python3 and PYTHON is set to host-python3 built bin, the build process is not respecting that. We do not have a symlink python -> python3 (afaik most distros do not include python by default, just python3) so when the build stage gets invoked it's using the "python" available from PATH LD_LIBRARY_PATH=/mnt/development/buildroot/output/build/nodejs-14.18.1/out/Release/lib.host:/mnt/development/buildroot/output/build/nodejs-14.18.1/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /mnt/development/buildroot/output/build/nodejs-14.18.1/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated; python ../../deps/v8/tools/run.py "/mnt/development/buildroot/output/build/nodejs-14.18.1/out/Release/v8-qemu-wrapper" "/mnt/development/buildroot/output/build/nodejs-14.18.1/out/Release/bytecode_builtins_list_generator" "/mnt/development/buildroot/output/build/nodejs-14.18.1/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h"
We can use the same approach as in qt5webkit: # QtWebkit's build system uses python, but only supports python2. We work # around this by forcing python2 early in the PATH, via a python->python2 # symlink. QT5WEBKIT_CONF_ENV = PATH=$(@D)/host-bin:$(BR_PATH) QT5WEBKIT_MAKE_ENV = PATH=$(@D)/host-bin:$(BR_PATH) define QT5WEBKIT_PYTHON2_SYMLINK mkdir -p $(@D)/host-bin ln -sf $(HOST_DIR)/bin/python2 $(@D)/host-bin/python endef QT5WEBKIT_PRE_CONFIGURE_HOOKS += QT5WEBKIT_PYTHON2_SYMLINK
The following patch should fix this issue: https://patchwork.ozlabs.org/project/buildroot/patch/20211222140737.1179968-1-fontaine.fabrice@gmail.com/ Moreover, python 3.10 support has been added to nodejs 14.18.2: https://github.com/nodejs/node/releases/tag/v14.18.2
Fixed by https://git.buildroot.org/buildroot/commit/?id=5ad7eb6c61d281912a8c692f0b69d46726394b10, thanks