Skip to content

Process runner: a command with 256+ argv entries returns -1 with no message (posix_run_argv argc >= 256) #1916

Closed

Description

@ehartford

Where: rt/darwin_aarch64.w, rt/linux_x86_64.w, rt/linux_aarch64.w — posix_run_argv returns -1 when posix_argv_blob_count(...) >= 256 (fixed [256]*const u8 argv array), and posix_fill_argv stops at 255. Nothing is printed, so ProcessRunner.run_spec / run_capture report exit code -1 with empty stdout/stderr and no stderr file is written.

Repro (found during #1915): a build action that archives mingw-w64's libmingwex (316 objects) with one llvm-ar qcsL out.lib <316 paths> call fails as

error: sdk-windows-libc: archive-mingwex.lib failed with exit code -1:

and no out/command/<target>/archive-mingwex.lib.std* exists.

Expected: either the command runs (argv sized to the blob, as the OS allows ~1 MiB on macOS/Linux), or the runner fails loudly with the reason ("argv has N entries; the runner supports at most 255"). A silent -1 is the #D "a tool that stayed silent" class.

Workaround used: the #1915 SDK libc step passes archive members through an llvm-ar response file (@file), which it needs anyway for Windows' 32 KiB command-line limit. The fix should not remove that, but the silent limit must go.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions