travis-nox-review-pr: Try to detect if the build ran out of memory

Travis builds sometimes fail because Travis doesn't have much memory.
When it happens, the failure reason is often hard to see in the logs and
is confusing (especially for new contributors).

Try to detect OOM errors in dmesg and give a warning when it happens.

Changed files
+9 -1
maintainers
+9 -1
maintainers/scripts/travis-nox-review-pr.sh
···
echo "=== Not a pull request"
else
echo "=== Checking PR"
-
nox-review pr ${TRAVIS_PULL_REQUEST}
+
+
if ! nox-review pr ${TRAVIS_PULL_REQUEST}; then
+
if sudo dmesg | egrep 'Out of memory|Killed process' > /tmp/oom-log; then
+
echo "=== The build failed due to running out of memory:"
+
cat /tmp/oom-log
+
echo "=== Please disregard the result of this Travis build."
+
fi
+
exit 1
+
fi
fi
# echo "=== Checking tarball creation"
# nix-build pkgs/top-level/release.nix -A tarball