Skip to content

yelp.m4: Avoid argument list too long error when cleaning

If $(_HELP_LC_FILES) is a very large list, then the rm -f command passed as a single argument to sh -c may exceed the Linux kernel's 32 page (128 kB) single argument length limit. This results in the error make: execvp: /bin/bash: Argument list too long. At Endless we hit this in our build of gnome-user-docs where we have 130 help files and 40 languages - 5200 total files with a resulting command line of about 130 kB.

This change works around the issue by looping over the file list using make functions so that the full list is never passed as a shell argument. It's slow and doesn't print the commands as it goes but works correctly.

Merge request reports