| ... | @@ -977,6 +977,11 @@ fn buildOutputType( | ... | @@ -977,6 +977,11 @@ fn buildOutputType( |
| 977 | var cc_argv: std.ArrayList([]const u8) = .empty; | 977 | var cc_argv: std.ArrayList([]const u8) = .empty; |
| 978 | var deps: std.ArrayList(CliModule.Dep) = .empty; | 978 | var deps: std.ArrayList(CliModule.Dep) = .empty; |
| 979 | | 979 | |
| | 980 | // We need to raise the FD limit *before* CLI parsing, because we open link inputs during CLI |
| | 981 | // parsing (in `createModule`), so a large number of link inputs could push us past the limit on |
| | 982 | // targets with a low soft limit (e.g. macOS has a default limit of 256). |
| | 983 | process.raiseFileDescriptorLimit(); |
| | 984 | |
| 980 | // Contains every module specified via -M. The dependencies are added | 985 | // Contains every module specified via -M. The dependencies are added |
| 981 | // after argument parsing is completed. We use a StringArrayHashMap to make | 986 | // after argument parsing is completed. We use a StringArrayHashMap to make |
| 982 | // error output consistent. "root" is special. | 987 | // error output consistent. "root" is special. |
| ... | @@ -3534,8 +3539,6 @@ fn buildOutputType( | ... | @@ -3534,8 +3539,6 @@ fn buildOutputType( |
| 3534 | break :b .whole; | 3539 | break :b .whole; |
| 3535 | }; | 3540 | }; |
| 3536 | | 3541 | |
| 3537 | process.raiseFileDescriptorLimit(); | | |
| 3538 | | | |
| 3539 | var file_system_inputs: std.ArrayList(u8) = .empty; | 3542 | var file_system_inputs: std.ArrayList(u8) = .empty; |
| 3540 | defer file_system_inputs.deinit(gpa); | 3543 | defer file_system_inputs.deinit(gpa); |
| 3541 | | 3544 | |