Raise the maximum number of processes and open files to their maximum.
Under macOS, the default soft resource limits for open files and concurrent
processes are pretty low, but their corresponding hard defaults are
reasonable. Because the soft limits are low, Bazel sometimes fails during
large builds -- not because of Bazel itself, but because the executed
actions do "too much work" or because the --jobs setting was high enough
to cause all parallel tasks to exceed the limits.
Instead of trying to fix the actions themselves, start by trying to raise
the system limits as a best-effort operation. And, given that this code
is fairly portable, try to do it on all POSIX systems and not just macOS.
Note that, for non-macOS systems, this might still not do what's promised
in all circumstances because I'm currently only implementing
GetExplicitSystemLimit on macOS.
RELNOTES: None.
PiperOrigin-RevId: 161401482
diff --git a/src/test/cpp/BUILD b/src/test/cpp/BUILD
index 9cbf269..20c36d5 100644
--- a/src/test/cpp/BUILD
+++ b/src/test/cpp/BUILD
@@ -23,6 +23,7 @@
],
"//conditions:default": [
"blaze_util_test.cc",
+ "blaze_util_posix_test.cc",
],
}),
deps = [