From 19ea615886979e65a691f2a2a394e5cd8057b39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Tue, 7 Mar 2017 08:02:15 +0100 Subject: Travis CI: Avoid that builds gets killed for inactivity Travis CI will kill build jobs that have not produced output for 10 minutes. The OTP build was never killed because of inactivity before 74796de9c7739 (which started to capture the output in a temporary file). After that commit, now and then a build would be killed because it did not finish in 10 minutes. Update the build script to periodically print a ".", but only if the size of the log file has changed. That way, if there is a real hanging during the build, Travis CI will still kill the build. Alternatives considered: Using travis_wait. Rejected because travis_wait will extend the build unconditonally, even if the build does not progress at all. --- scripts/build-otp | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'scripts/build-otp') diff --git a/scripts/build-otp b/scripts/build-otp index 388fa8c276..da09fb8045 100755 --- a/scripts/build-otp +++ b/scripts/build-otp @@ -1,12 +1,31 @@ #!/bin/bash +function progress { + local file=$1 + ls=$(ls -l $file) + while [ true ]; do + sleep 10 + new_ls=$(ls -l $file) + if [ "$new_ls" != "$ls" ]; then + echo -n "." + fi + ls="$new_ls" + done +} + function do_and_log { log="scripts/latest-log.$$" - echo -n "$1... " + echo "" >$log + echo -n "$1..." + (progress $log) & + pid=$! + disown if ./otp_build $2 $3 >$log 2>&1; then - echo "done." + kill $pid >/dev/null 2>&1 + echo " done." else - echo "failed." + kill $pid >/dev/null 2>&1 + echo " failed." tail -n 200 $log echo "*** Failed ***" exit 1 -- cgit v1.2.3