Trying to build OpenWRT but build fails on enabling wpad

Trying to build OpenWRT v22.03.5 but get the following error:

Enabling wpad
sed -i "s/Installed-Time: .*/Installed-Time: 1682627295/" /home/nick/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/usr/lib/opkg/status
rm -rf /home/nick/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/boot /home/nick/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/tmp/* /home/nick/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/usr/lib/opkg/info/*.postinst* /home/nick/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/usr/lib/opkg/lists/* /home/nick/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/var/lock/*.lock
find /home/nick/openwrt/build_dir/target-mipsel_24kc_musl/root-ramips/ -mindepth 1 -execdir touch -hcd "@1682627295" "{}" +
find: The relative path 'Files' is included in the PATH environment variable, which is insecure in combination with the -execdir action of find.  Please remove that entry from $PATH
make[2]: *** [package/Makefile:73: package/install] Error 1
make[2]: Leaving directory '/home/nick/openwrt'
make[1]: *** [package/Makefile:111: /home/nick/openwrt/staging_dir/target-mipsel_24kc_musl/stamp/.package_install] Error 2
make[1]: Leaving directory '/home/nick/openwrt'
make: *** [/home/nick/openwrt/include/ world] Error 2

What other information would be helpful to debug this?

I assume that you're building on a windows host (with linux subsystem), in which case you have to sanitize your PATH variable for WSL{,2} (remove non linux paths, Program Files and anything else with spaces in particular).


Yes, I am using wsl2. My path is now:


I've started the build again, will let you know how it gets on.

The build succeeded now, thanks for your help!

Quick question, I have two devices with two different architectures… off the top of my head one is a mt7621 and the other is an ipq-something. I want to rebuild wpad for each. I’m trying to understand where in the build process the commands would need to be run twice. I am following Let’s say I build the mt7621 wpad package, can I then build for ipq-something without recompiling tools/toolchain as I believe this is what takes the most time. Is it just a case of dropping in the new .config file, configuring it with menuconfig and running something like make package/nano/compile (but obviously for wpad)?

You can build out of the same git clone, but with mt7621a being mips and ipq**xx being arm based, you won't win much (almost nothing).

Personally, given the builddir size, I'd clean up inbetween.


You could save just "tools", as "toolchain" components are already target specific. (Actually, CPU architecture / package target). And toolchain compilation is the time-consuming task...

Cleaning toolchain is done by (rarely used) make targetclean, or by make dirclean. normal (make clean just cleans the target items)

If disc space is no constraint, you could also have both toolchains coexist, and just focus on the normal build.

In principle, yes. Selecting target/router in menuconfig causes the build to used the correct toolchain (even when there are multiple toolchains compiled).

Ahhh gotcha. So I don’t need to cleanup the toolchain (or any build stuff?) as you say there can be multiple toolchains compiled at the same time.

What about tools? I’m assuming they aren’t target specific and can just be left alone.

Gotcha, thanks.

Am I right in saying that to build for example wpad-wolfssl, I need to have done a full build beforehand?

At the same time, as in multiple make processes for different targets running at the same time no. One after another, leaving build artefacts for other targets (and being able to reuse them later), yes.

More or less, yes (the whole dependency stack needs to be built before, the only reasonable approach for that is doing almost a full build).