[openwrt/openwrt] hostapd: fix Argument list too long build error

LEDE Commits lede-commits at lists.infradead.org
Mon Mar 25 03:02:22 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/bf4c04a4d08376bb611a748a102dbf974d089336

commit bf4c04a4d08376bb611a748a102dbf974d089336
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Sun Mar 24 20:54:26 2024 +0100

    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 <robimarko at gmail.com>
---
 ..._make_dirs-robust-against-too-long-argume.patch | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

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 0000000000..cb8171551d
--- /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 <robimarko at gmail.com>
+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 <robimarko at gmail.com>
+---
+ 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) $<




More information about the lede-commits mailing list