Use openwrt's CI container images if you're having trouble compiling openwrt
Getting a build system set up for openwrt is fairly simple on a Linux system, including WSL. You need
- build system dependencies,
- WSL workarounds, if applicable,
- instructions on how to use the build system.
This all works great but your day-to-day system probably has a lot of stuff lying around that could mess up library search paths, your PATH, and other global system things. Instead of trying to make your system align perfectly with the openwrt developer's systems, take advantage of all the work they've put into their CI infrastructure and copy it.
I used to get all sorts of weird errors from perl and some other libraries, but
now I use a container with an image built basically the same way as the
official openwrt build
worker.
Those errors have all gone away and it's worked flawlessly since version
23.05.3
. It's been so long that I don't even remember the errors.
I haven't set up a fully automated build. Instead, I run and attach to a container using this image interactively and run some simple scripts from inside the container. Those scripts contain commands from the build system instructions above.
You could also use the Image Builder, but when I first started doing this I needed something that couldn't be done with the Image Builder (and I didn't know it existed).