Add troubleshooting info on Bazel crashes (OOM).

Explains what to do when Bazel crashes (OOM).
This commit is contained in:
Eryu Xia 2021-08-05 02:00:11 -07:00 committed by Stanley Cheung
parent ef0f44e1ce
commit fb3f864a0d
1 changed files with 28 additions and 0 deletions

28
scripts/README.md Normal file
View File

@ -0,0 +1,28 @@
# Scripts
A collection of scripts (mostly test related).
## Troubleshooting - Bazel Crashes (OOM)
[Bazel](https://github.com/bazelbuild/bazel) can be memory hungry and often
crashes while building on Mac with default Docker memory settings (2GB)
(similar reports: [here](https://github.com/tensorflow/models/issues/3647) and
[here](https://stackoverflow.com/questions/65605663/cannot-build-with-error-server-terminated-abruptly)).
Bump the [memory settings](https://docs.docker.com/docker-for-mac/#resources)
in Docker Desktop for Mac (e.g. to 4 - 6GB) if you see the following errors:
```
$ bazel test --cache_test_results=no //javascript/net/grpc/web/... //net/grpc/gateway/examples/...
...
Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/root/.cache/bazel/_bazel_root/.../server/jvm.out')
------
failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c bazel build javascript/net/grpc/web/... && cp $(bazel info bazel-genfiles)/javascript/net/grpc/web/protoc-gen-grpc-web /usr/local/bin/protoc-gen-grpc-web]: exit code: 37
```