mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
compiler: raise FD limit before opening link inputs
This commit is contained in:
committed by
Alex Rønne Petersen
parent
31bc385a96
commit
9ba89394df
+5
-2
@@ -977,6 +977,11 @@ fn buildOutputType(
|
||||
var cc_argv: std.ArrayList([]const u8) = .empty;
|
||||
var deps: std.ArrayList(CliModule.Dep) = .empty;
|
||||
|
||||
// We need to raise the FD limit *before* CLI parsing, because we open link inputs during CLI
|
||||
// parsing (in `createModule`), so a large number of link inputs could push us past the limit on
|
||||
// targets with a low soft limit (e.g. macOS has a default limit of 256).
|
||||
process.raiseFileDescriptorLimit();
|
||||
|
||||
// Contains every module specified via -M. The dependencies are added
|
||||
// after argument parsing is completed. We use a StringArrayHashMap to make
|
||||
// error output consistent. "root" is special.
|
||||
@@ -3534,8 +3539,6 @@ fn buildOutputType(
|
||||
break :b .whole;
|
||||
};
|
||||
|
||||
process.raiseFileDescriptorLimit();
|
||||
|
||||
var file_system_inputs: std.ArrayList(u8) = .empty;
|
||||
defer file_system_inputs.deinit(gpa);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user