[gm.py] Fix goma process detection on MacOS

On MacOS, `ps -e | grep foo` always finds a match, because `ps`
already sees the `grep` command, which matches the search string.
Luckily, `pgrep` exists as an elegant alternative.

No-Try: true
Change-Id: Ieedfe62ab11a59fb9a29ae1ebd39b164eec5193c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3144917
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76707}
This commit is contained in:
Jakob Kummerow 2021-09-07 22:43:04 +02:00 committed by V8 LUCI CQ
parent 684f3cee1f
commit 13952a1e19

View File

@ -506,7 +506,7 @@ def Main(argv):
return_code = 0 return_code = 0
# If we have Goma but it is not running, start it. # If we have Goma but it is not running, start it.
if (IS_GOMA_MACHINE and if (IS_GOMA_MACHINE and
_Call("ps -e | grep compiler_proxy > /dev/null", silent=True) != 0): _Call("pgrep -x compiler_proxy > /dev/null", silent=True) != 0):
_Call("%s/goma_ctl.py ensure_start" % GOMADIR) _Call("%s/goma_ctl.py ensure_start" % GOMADIR)
for c in configs: for c in configs:
return_code += configs[c].Build() return_code += configs[c].Build()