aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-03-07 08:02:15 +0100
committerBjörn Gustavsson <[email protected]>2017-03-07 10:26:56 +0100
commit19ea615886979e65a691f2a2a394e5cd8057b39a (patch)
treeee922b671acdf62d748a3f83939480b5b02d4419 /scripts
parent23e60014ee1de86cbf163716a61905db7af954ed (diff)
downloadotp-19ea615886979e65a691f2a2a394e5cd8057b39a.tar.gz
otp-19ea615886979e65a691f2a2a394e5cd8057b39a.tar.bz2
otp-19ea615886979e65a691f2a2a394e5cd8057b39a.zip
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-otp25
1 files changed, 22 insertions, 3 deletions
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