diff --git a/core/goma.mk b/core/goma.mk index 1d44aea93e1ece0f035946407fdd4e950ba04288..7fc6c461d93aaa949f66898511e8183bbaba74c6 100644 --- a/core/goma.mk +++ b/core/goma.mk @@ -25,6 +25,16 @@ ifneq ($(USE_GOMA),) $(error USE_GOMA=true works only with USE_NINJA=true) endif + # Goma requires a lot of processes and file descriptors. + ifeq ($(shell echo $$(($$(ulimit -u) < 2500 || $$(ulimit -n) < 16000))),1) + $(warning Max user processes and/or open files are insufficient) + ifeq ($(shell uname),Darwin) + $(error See go/ma/how-to-use-goma/how-to-use-goma-for-android to relax the limit) + else + $(error Adjust the limit by ulimit -u and ulimit -n) + endif + endif + ifdef GOMA_DIR goma_dir := $(GOMA_DIR) else