Description
On a project with a huge number of build targets and with a capped ulimit
on nofile
, the CMake configure stage is marked as failed (although CMake itself succeeds). And on triggering the build step, it fails with:
[rollbar] Unhandled exception: Unhandled Promise rejection:
build Error: EMFILE: too many open files,
open '/path/to/builddir/.cmake/api/v1/reply/target-<redacted>o-Release<hash>.json' {}
The problem is that the following snippet:
vscode-cmake-tools/src/drivers/cmakefileapi/api_helpers.ts
Lines 159 to 161 in d2d98f8
Calls the following for each file with no consideration to limits and no retries:
Yes, this problem can be worked around with increasing the sysctl
for fs.inotify.max_user_watches
or updating /etc/security/limits.conf
, but that assumes that every developer has admin access or can get an admin to make this change for them, which is not always possible.
I found several discussions at https://stackoverflow.com/q/8965606/1005215 , perhaps this project can adopt one of them?