From: Robert Marko Date: Sun, 24 Mar 2024 19:54:26 +0000 (+0100) Subject: hostapd: fix Argument list too long build error X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bf4c04a4d08376bb611a748a102dbf974d089336;p=openwrt%2Fstaging%2Frmilecki.git hostapd: fix Argument list too long build error Currently, both CI and local builds of wpa-supplicant will fail with: /bin/sh: Argument list too long Its happening as the argument list for mkdir in build.rules is too large and over the MAX_ARG_STRLEN limit. It seems that recent introduction of APK compatible version schema has increased the argument size and thus pushed it over the limit uncovering the issue. Fixes: e8725a932e16 ("treewide: use APK compatible version schema") Signed-off-by: Robert Marko --- diff --git a/package/network/services/hostapd/patches/999-build-make-_make_dirs-robust-against-too-long-argume.patch b/package/network/services/hostapd/patches/999-build-make-_make_dirs-robust-against-too-long-argume.patch new file mode 100644 index 00000000000..cb8171551d0 --- /dev/null +++ b/package/network/services/hostapd/patches/999-build-make-_make_dirs-robust-against-too-long-argume.patch @@ -0,0 +1,27 @@ +From beeef79701082a82b2581a674e702ea60a358ce7 Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Sun, 24 Mar 2024 20:47:06 +0100 +Subject: [PATCH] build: make _make_dirs robust against too long argument error + +_make_dirs currently can fail as _DIRS can be really long and thus go over +the MAX_ARG_STRLEN limit so it will fail with: +/bin/sh: Argument list too long + +Lets avoid this by stripping the $(BUILDDIR) prefix and then restoring it. + +Signed-off-by: Robert Marko +--- + src/build.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/build.rules ++++ b/src/build.rules +@@ -80,7 +80,7 @@ endif + _DIRS := $(BUILDDIR)/$(PROJ) + .PHONY: _make_dirs + _make_dirs: +- @mkdir -p $(_DIRS) ++ @printf '$(BUILDDIR)/%s ' $(patsubst $(BUILDDIR)/%,%,$(_DIRS)) | xargs mkdir -p + + $(BUILDDIR)/$(PROJ)/src/%.o: $(ROOTDIR)src/%.c $(CONFIG_FILE) | _make_dirs + $(Q)$(CC) -c -o $@ $(CFLAGS) $<