When using rules_android 0.7.1 on a big codebase, we are getting an error Too many open files. Happens on the PackageAndroidResources action.
Things we have tried (didn't work):
- Added
-XX:+MaxFDLimit to the jvm_flags in java.bzl's _run method.
Things we have tried (worked for is):
- Calling
ulimit -n 65536 here.
- Adjusting the
ResourceLinker to merge .zip files in batches.
Dev env. and tools:
- Using patched bazel 7.7.1
- Using rules_android 0.7.1 (including this patch: Bencodes@cc2c826).
- OS: Tahoe 26.2