[apple] Set limit of 200 process when running on macOS Ventura 13.5

The limit set in /Library/LaunchDaemons/limit.maxfiles.plist appears
to no longer be respected in macOS Ventura 13.5 and the OS forces a
limit of 256 file descriptors, causing build with autoninja to fail
on macOS running this most recent version of the OS.

Force the max number of process to 200 until a new working way to
increase the file descriptor limit is found. This will allow devs
working on macOS to be able to build (albeit slower than before).

Fixes the following build failure when goma is enabled and running
on macOS Ventura 13.5:

    $ autoninja -C out/Debug-iphonesimulator chrome
    ninja: Entering directory `out/Debug-iphonesimulator'
    [0/3574] CXX ....oninja: fatal: pipe: Too many open files

Bug: 1467777
Change-Id: Ia7eaab552f7e6d26a2f48d72bb8235a70d6d442f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4720227
Reviewed-by: Dirk Pranke <dpranke@google.com>
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
changes/27/4720227/3
Sylvain Defresne 2 years ago committed by LUCI CQ
parent 4ff51c15ad
commit 4d992437eb

@ -181,6 +181,14 @@ def main(args):
# performance.
j_value = min(j_value, 1000)
elif sys.platform == 'darwin':
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
if mac_ver[0] > 13 or (mac_ver[0] == 13 and mac_ver[0] >= 5):
# On macOS 13.5, the recommended way to increase the file descriptors
# and process no longer works and the build fails with an error. Set
# the limit to 200 until new way to increase the limit is discovered
# (crbug.com/1467777).
j_value = min(j_value, 250)
else:
# On macOS, j value higher than 800 causes 'Too many open files' error
# (crbug.com/936864).
j_value = min(j_value, 800)

Loading…
Cancel
Save