I see that there is a community package for node here. I'm unfamiliar with the process for building packages for particular targets, but it looks to me like this package is enabled for arm architectures. However, these packages are not in the packages feed. Confusingly, there are some packages that depend on the node package are in the feed, eg. node-serialport.
I'm wondering if anyone has insight into this. I suspect that those community packages are built by a buildbot automatically and if there's a compilation error it doesn't spit out a package and moves on. And perhaps the node package is failing to build for some reason. If this is true, is there public info on the build server, eg. build logs? Can anyone point me in the right direction? Where is the appropriate place to file a bug report on this? (an issue on the openwrt repo in github?)
I notice that over the past few years others have asked about this here, but I've seen no answer. I hope I can get to the bottom of this.
Thanks! Do you know the difference between the host-compile.txt and compile.txt? Is the host-compile not cross-compiled?
There's a couple thing I notice this those logs:
host-compile.txt shows a successful build.
compile.txt does show an error, though it doesn't appear to be with node code, but with the compiler. /usr/include/c++/8/bits/stl_algobase.h is including bits/c++config.h, which doesn't exist. But /usr/include/c++/8/bits/stl_algobase.h is a compiler header file. Looks to me like the build machine has an issue with the compiler installation.
Compiling for OpenWrt is pretty complex, as the compiler runs on x64 machines and mainly compiles for routers with ARM/MIPS processors. So it is about cross-compiling.
In many cases, the cross compilation needs/uses tools built for and run in the x64 buildhost, so there is a "host compile" step first, where these tools are first compiled, so that they are available for the final cross compile "compile" step.
(And in many cases you can't use the "normal" header files adjusted for x86, but you need new header files in the toolchain itself targeting the respective ARM/MIPS CPU variant. For that reason, there are 20+ different package compilation architectures.)
Feel free to familiarize yourself with the the OpenWrt build toolchain system, and fix the node packages.
I believe the issue is that the build machine needs g++-multilib to be installed in order to make <bits/c++config.h> available when cross-compiling from a 64-bit machine to a 32-bit machine.
At least, on my x86_64 Ubuntu machine, I can cross-compile node using the OpenWRT buildroot if I first do a sudo apt install g++-multilib.
I think the issue is that the OpenWRT buildbot doesn't have that library installed, so I've made a MR on the openwrt/buildbot gitlab, so hopefully that should fix it, see https://gitlab.com/openwrt/buildbot/-/merge_requests/11