Skip to content

zig build returns error.SystemResources on MacOS when build-lib command exceeds ARG_MAX #10693

@fubark

Description

@fubark

Zig Version

0.9.0

Steps to Reproduce

Create build.zig with a static lib step that adds many c source files with lib.addCSourceFile (and many c flags).
run: zig build

Expected Behavior

zig build should work and not have this limit or at the very least return a more useful error.

Actual Behavior

Prints error.SystemResources and quits.

Since zig build creates a build-lib command the args list can dramatically go up with many c source files/flags.
On linux: getconf ARG_MAX returns 2097152 so I did not run into this issue before but on MacOS this number is much lower: 262144.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.frontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions