Skip to content

build: distribute IDE project trees per-directory to fix "make dist"#10951

Merged
douzzer merged 1 commit into
wolfSSL:masterfrom
Frauschi:fix-dist-argmax
Jul 20, 2026
Merged

build: distribute IDE project trees per-directory to fix "make dist"#10951
douzzer merged 1 commit into
wolfSSL:masterfrom
Frauschi:fix-dist-argmax

Conversation

@Frauschi

Copy link
Copy Markdown
Contributor

Summary

make dist can fail on Linux with:

/bin/bash: Argument list too long
make[2]: *** [distdir-am] Error 127

This changes the IDE/ integration trees to be distributed one directory at a time (EXTRA_DIST += IDE/<dir>) instead of enumerating every file, shrinking the top-level DISTFILES from ~123 KB to ~97 KB and getting make dist well clear of the limit. The set of files placed in the release tarball is unchanged.

Root cause

wolfSSL uses a single non-recursive Makefile.am, so every distributed file lands in one top-level $(DISTFILES). Automake's distdir-am recipe inlines that entire list into a single shell command (list='$(DISTFILES)'; ...), which make passes to /bin/bash -c as one argument. Linux caps a single argument at MAX_ARG_STRLEN (128 KB), independent of the 2 MB total ARG_MAX. With DISTFILES sitting at ~123 KB, the recipe was right at that limit, so a modest addition of EXTRA_DIST entries pushed it over and execve returned E2BIG. macOS has no per-argument cap, which is why this only reproduces on Linux.

Change

The IDE/ directories were enumerated file-by-file via 53 include IDE/*/include.am fragments (~745 EXTRA_DIST entries). Automake already copies a directory-valued EXTRA_DIST entry recursively, and IDE/include.am already used that form for a few trees (IDE/Espressif, IDE/HEXIWEAR, ...). This change extends it to the rest:

  • Replace the per-file enumeration with one EXTRA_DIST += IDE/<dir> entry per directory (~52 entries).
  • Remove the 53 now-unused include.am fragments.
  • Preserve the DISTCLEANFILES entry for IDE/iotsafe/build.

Net effect on the top-level DISTFILES:

Before After
Bytes 122,948 97,366
Entries 3,363 2,824
IDE/ contribution ~36 KB / ~910 entries ~12.5 KB / ~52 entries

That leaves roughly 34 KB of headroom under the 128 KB limit.

Directories kept enumerated

Three directories intentionally omit some tracked files (private IDE configs, .gitkeep placeholders, helper scripts), so they stay listed file-by-file to avoid shipping those: IDE/apple-universal, IDE/MPLABX16, and IDE/Renesas.

Why not a recursive SUBDIRS

Splitting IDE/ into a recursively-distributed subdirectory is the other textbook fix, but wolfSSL deliberately avoids recursive distdir: linuxkm/Makefile is hand-written (not in AC_CONFIG_FILES), and Makefile.am documents that the SUBDIRS_OPT aux-variable exists specifically to keep make distdir from recursing. Extending the wholesale-EXTRA_DIST idiom already present in IDE/include.am stays on-convention.

Testing

  • Before/after make dist tarball comparison: no IDE/ project file added or removed. The only difference is that the 53 now-unused include.am build fragments are no longer packaged.
  • make dist verified on Ubuntu 24.04 / automake 1.16.5 (matching the Multiple compilers and versions CI toolchain).
  • A dirty in-tree build is out of scope: as with the pre-existing wholesale entries, make dist is expected to run from a clean checkout.

Checklist

  • No functional/library code changed (build metadata only).
  • Distributed file set unchanged (verified by tarball diff).
  • make dist passes on the CI toolchain.

The non-recursive automake "distdir" recipe inlines the entire $(DISTFILES)
list into a single shell command. Enumerating every IDE integration file
individually made that list large enough (~123 KB) that the recipe exceeded
the Linux MAX_ARG_STRLEN (128 KB) single-argument exec limit, so "make dist"
failed with:

    /bin/bash: Argument list too long
    make[2]: *** [distdir-am] Error 127

Replace the per-file EXTRA_DIST enumeration of the IDE directories with one
wholesale "EXTRA_DIST += IDE/<dir>" entry per directory (automake copies the
tree recursively). This collapses ~745 file entries into ~52 directory
entries and shrinks the top-level DISTFILES from ~123 KB to ~97 KB, well
under the limit.

The set of distributed IDE files is unchanged: a before/after "make dist"
diff shows no project file added or removed (only the now-unused include.am
build fragments are gone). Three directories that intentionally omit some
tracked files (apple-universal, MPLABX16, Renesas - private IDE configs,
.gitkeep placeholders, helper scripts) stay enumerated file-by-file.
@douzzer

douzzer commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

retest this please
(aborted "group 6")

@douzzer
douzzer merged commit bd6388c into wolfSSL:master Jul 20, 2026
341 checks passed
@Frauschi
Frauschi deleted the fix-dist-argmax branch July 21, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants