summary refs log tree commit diff
path: root/maintainers/scripts
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2015-06-20 21:15:39 +0300
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2015-06-20 23:31:17 +0300
commitd78d168096fbbf39a7a6604a38844f8a8b2b8bb1 (patch)
treedb07f9b45e28ccdbb8753ce007b4295086f8917f /maintainers/scripts
parente1af50c4c4c0332136283e9231f0a32ac11f2b90 (diff)
downloadnixlib-d78d168096fbbf39a7a6604a38844f8a8b2b8bb1.tar
nixlib-d78d168096fbbf39a7a6604a38844f8a8b2b8bb1.tar.gz
nixlib-d78d168096fbbf39a7a6604a38844f8a8b2b8bb1.tar.bz2
nixlib-d78d168096fbbf39a7a6604a38844f8a8b2b8bb1.tar.lz
nixlib-d78d168096fbbf39a7a6604a38844f8a8b2b8bb1.tar.xz
nixlib-d78d168096fbbf39a7a6604a38844f8a8b2b8bb1.tar.zst
nixlib-d78d168096fbbf39a7a6604a38844f8a8b2b8bb1.zip
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.
Diffstat (limited to 'maintainers/scripts')
-rwxr-xr-xmaintainers/scripts/travis-nox-review-pr.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/maintainers/scripts/travis-nox-review-pr.sh b/maintainers/scripts/travis-nox-review-pr.sh
index 3c3f9151d837..545499557479 100755
--- a/maintainers/scripts/travis-nox-review-pr.sh
+++ b/maintainers/scripts/travis-nox-review-pr.sh
@@ -31,7 +31,15 @@ elif [[ $1 == build ]]; then
         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