summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-08-17 12:53:14 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-08-17 12:53:14 -0400
commit39d6350a00f6989467343dc416c89ce05d8671c9 (patch)
tree45e479064bf1ca4febb3c06d84e2afee9e3e3289
parent0c4dc97c80867c4125ba541910d8f1d367962513 (diff)
ci: use manual script for distcheck builddevs/discomfitor/release-test
Summary: this adds a script which reimplements the distcheck rule generated from automake and runs that script instad of 'make distcheck' the benefit of this is that the distcheck script can run tests multiple times to avoid intermittent failures which could potentially cause build errors. distcheck builds are by far the longest and most costly of all ci builds, so it's important to reduce failure rates in these builds to the absolute minimum in order to keep ci build times low cibuildme fix T7094 Reviewers: stefan_schmidt Subscribers: #reviewers, cedric, #committers Tags: #efl Maniphest Tasks: T7094 Differential Revision: https://phab.enlightenment.org/D6734
-rwxr-xr-x.ci/distcheck.sh120
1 files changed, 120 insertions, 0 deletions
diff --git a/.ci/distcheck.sh b/.ci/distcheck.sh
new file mode 100755
index 0000000000..0024ce8566
--- /dev/null
+++ b/.ci/distcheck.sh
@@ -0,0 +1,120 @@
1#!/bin/bash
2
3. .ci/travis.sh
4
5scrape_makefile_variable() {
6 #try to scrape $1 from Makefile
7 num=0
8 var=
9 while true ; do
10 var="$(grep -A${num} -m1 -w $1 Makefile.am)"
11 #continually increment number of lines scraped if backslash is detected
12 if echo "$var" | tail -n1 | grep -q '\\' ; then
13 num=$((++num))
14 else
15 #cut out line wrapping
16 var=$(echo "$var" | tr -d '\n\\' | cut -d= -f2-)
17 break
18 fi
19 done
20 echo $var
21}
22
23#attempt to keep this as close to original makefile rule as possible
24#for ease of future updating
25
26set -e
27
28travis_fold dist "make dist"
29#create dist tarball
30make dist
31travis_endfold dist
32
33#set distdir variable to current package string
34distdir="$(grep '^PACKAGE_STRING' config.log|cut -d\' -f2|tr ' ' -)"
35DIST_ARCHIVES=${distdir}.tar.xz
36MAKE=make
37
38#unpack dist tarball
39xz -dc ${distdir}.tar.xz | tar -xf -
40
41chmod -R a-w ${distdir}
42chmod u+w ${distdir}
43mkdir ${distdir}/_build ${distdir}/_build/sub ${distdir}/_inst
44chmod a-w ${distdir}
45test -d ${distdir}/_build
46
47dc_install_base=`cd ${distdir}/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'`
48dc_destdir="${TMPDIR-/tmp}/am-dc-XXXX"
49am__cwd=`pwd`
50
51AM_DISTCHECK_CONFIGURE_FLAGS="$(scrape_makefile_variable AM_DISTCHECK_CONFIGURE_FLAGS)"
52AM_MAKEFLAGS="$(scrape_makefile_variable AM_MAKEFLAGS)"
53
54travis_fold configure "configuring distcheck build"
55cd ${distdir}/_build/sub
56../../configure \
57 ${AM_DISTCHECK_CONFIGURE_FLAGS} \
58 ${DISTCHECK_CONFIGURE_FLAGS} \
59 --srcdir=../.. --prefix="$dc_install_base"
60travis_endfold configure
61travis_fold make make
62make ${AM_MAKEFLAGS}
63travis_endfold make
64travis_fold dvi dvi
65make ${AM_MAKEFLAGS} dvi
66travis_endfold dvi
67travis_fold check-build check-build
68make ${AM_MAKEFLAGS} check-build
69travis_endfold check-build
70travis_fold check-TESTS check-TESTS
71set +e
72for tries in 1 2 3 ; do
73 make ${AM_MAKEFLAGS} -C src/ -j1 check-TESTS && break
74 cat src/test-suite.log
75 if [ $tries != 3 ] ; then echo "tests failed, trying again!" ; continue ; fi
76 exit 1
77done
78travis_endfold check-TESTS
79set -e
80travis_fold make_install "make install"
81make ${AM_MAKEFLAGS} install
82travis_endfold make_install
83travis_fold make_installcheck "make installcheck"
84make ${AM_MAKEFLAGS} installcheck
85travis_endfold make_installcheck
86travis_fold make_uninstall "make uninstall"
87make ${AM_MAKEFLAGS} uninstall
88travis_endfold make_uninstall
89travis_fold distuninstallcheck "make distuninstallcheck"
90make ${AM_MAKEFLAGS} distuninstallcheck_dir="$dc_install_base" \
91 distuninstallcheck
92travis_endfold distuninstallcheck
93chmod -R a-w "$dc_install_base"
94 (cd ../.. && umask 077 && mktemp -d "$dc_destdir")
95 travis_fold dist-install "make dist-install"
96 make ${AM_MAKEFLAGS} DESTDIR="$dc_destdir" install
97 travis_endfold dist-install
98 travis_fold dist-uninstall "make dist-uninstall"
99 make ${AM_MAKEFLAGS} DESTDIR="$dc_destdir" uninstall
100 travis_endfold dist-uninstall
101 travis_fold dist-distuninstallcheck "make dist-distuninstallcheck"
102 make ${AM_MAKEFLAGS} DESTDIR="$dc_destdir" \
103 distuninstallcheck_dir="$dc_destdir" distuninstallcheck \
104 || { rm -rf "$dc_destdir"; exit 1; }
105 travis_endfold dist-distuninstallcheck
106rm -rf "$dc_destdir"
107travis_fold dist-dist "make dist-dist"
108make ${AM_MAKEFLAGS} dist
109travis_endfold dist-dist
110rm -rf ${DIST_ARCHIVES}
111travis_fold dist-distcleancheck "make dist-distcleancheck"
112make ${AM_MAKEFLAGS} distcleancheck
113travis_endfold dist-distcleancheck
114cd "$am__cwd"
115#$(am__post_remove_distdir)
116if test -d "${distdir}"; then
117 find "${distdir}" -type d ! -perm -200 -exec chmod u+w {} ';' \
118 && rm -rf "${distdir}" \
119 || { rm -rf "${distdir}"; }; \
120else :; fi