Skip to content

Commit

Permalink
hostapd: fix Argument list too long build error
Browse files Browse the repository at this point in the history
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: e8725a9 ("treewide: use APK compatible version schema")
Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
robimarko committed Mar 25, 2024
1 parent c02a2db commit bf4c04a
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From beeef79701082a82b2581a674e702ea60a358ce7 Mon Sep 17 00:00:00 2001
From: Robert Marko <[email protected]>
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 <[email protected]>
---
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) $<

0 comments on commit bf4c04a

Please sign in to comment.