OSDN Git Service

Show error message when resource limit too low for USE_GOMA=true
authorShinichiro Hamaji <hamaji@google.com>
Sat, 29 Aug 2015 02:58:47 +0000 (11:58 +0900)
committerShinichiro Hamaji <hamaji@google.com>
Sat, 29 Aug 2015 03:01:51 +0000 (12:01 +0900)
This should be particularly helpful for Mac users, because the
default limits of Mac are too low.

Change-Id: I03f0f76a0707b4ce5ef9cddf5df6e3857a215996

core/goma.mk

index 1d44aea..7fc6c46 100644 (file)
@@ -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