diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2015-03-13 13:52:05 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2015-04-02 21:10:44 +0100 |
commit | 9a4cf2522434ad0c57e81585f383d0f0046f3e37 (patch) | |
tree | 94785fede6066782ec557089009ce45200445aa3 | |
parent | 70d9d0301ca437be84bdd780c0dd9607b6390619 (diff) |
Add support for target=native and for target=schroot-* in scripts/Backport.job and test-backport.sh
Change-Id: Ib7b96ba8b89c738a65f8b90d56ffc2f899851722
-rwxr-xr-x | scripts/Backport.job | 17 | ||||
-rwxr-xr-x | test-backport.sh | 58 |
2 files changed, 57 insertions, 18 deletions
diff --git a/scripts/Backport.job b/scripts/Backport.job index 344417f4..9160cd8d 100755 --- a/scripts/Backport.job +++ b/scripts/Backport.job @@ -29,14 +29,9 @@ EOF return 0 } -# Server to store results on. abe_dir="${WORKSPACE}/abe" -user_snapshots="${WORKSPACE}/snapshots" -shared="/home/buildslave/workspace/shared/" -snapshots_ref="${shared}/snapshots" export CONFIG_SHELL="/bin/bash" - cat << EOF > ${WORKSPACE}/BUILD-INFO.txt Format-Version: 0.5 @@ -48,11 +43,13 @@ rm -fr ${WORKSPACE}/_build/builds/* ${WORKSPACE}/_build/sysroots/* mkdir -p ${WORKSPACE}/_build cd ${WORKSPACE}/_build -if test ! -d ${snapshots_ref}/gcc.git; then - git clone http://git.linaro.org/git/toolchain/gcc.git ${snapshots_ref}/gcc.git -fi - -$CONFIG_SHELL ${abe_dir}/configure --enable-schroot-test --with-local-snapshots=${user_snapshots} --with-git-reference-dir=${snapshots_ref} +case ${target} in + schroot-*) + schroot_arch=$(echo ${target} | sed -e "s/^schroot-\([^-]*\)-\(.*\)/\1/") + target=$(echo ${target} | sed -e "s/^schroot-\([^-]*\)-\(.*\)/\2/") + CONFIG_SHELL="schroot -c tcwg-build-${schroot_arch}-trusty --preserve-environment -- ${CONFIG_SHELL}" + ;; +esac # If started by a Gerrit Trigger, use that for the branch. if test x"${GERRIT_TOPIC}" != x; then diff --git a/test-backport.sh b/test-backport.sh index fcf50212..985fb8a1 100755 --- a/test-backport.sh +++ b/test-backport.sh @@ -40,6 +40,31 @@ if test $# -lt 2; then fi # load commonly used functions +which_dir="`which $0`" +topdir="`dirname ${which_dir}`" + +user_snapshots="${WORKSPACE}/snapshots" +shared="/home/buildslave/workspace/shared/" +snapshots_ref="${shared}/snapshots" + +if test ! -d ${snapshots_ref}/gcc.git; then + git clone http://git.linaro.org/git/toolchain/gcc.git ${snapshots_ref}/gcc.git +fi + +# Configure Abe itself. Force the use of bash instead of the Ubuntu +# default of dash as some configure scripts go into an infinite loop with +# dash. Not good... +export CONFIG_SHELL="/bin/bash" +if test x"${debug}" = x"true"; then + export CONFIG_SHELL="/bin/bash -x" +fi + +if test x"${abe_dir}" = x; then + abe_dir=${topdir} +fi +$CONFIG_SHELL ${abe_dir}/configure --enable-schroot-test --with-local-snapshots=${user_snapshots} --with-git-reference-dir=${snapshots_ref} + +# load commonly used functions if test -e "${PWD}/host.conf"; then . "${PWD}/host.conf" else @@ -81,6 +106,15 @@ while test $# -gt 0; do shift done +if test x"${target}" != x"native" -a x"${target}" != x; then + platform="--target ${target}" + targetname=${target} +else + # For native builds, we need to know the effective target name to + # be able to find the results + targetname=${build} +fi + if test "`echo ${branch} | grep -c gcc.git`" -gt 0; then branch="`echo ${branch} | sed -e 's:gcc.git~::'`" fi @@ -123,6 +157,14 @@ else gerrit="" fi +# Force the use of bash as CONFIG_SHELL: +# - some configure scripts don't work with dash +# - we may have overridden to use a schroot +export CONFIG_SHELL="/bin/bash" +if test x"${debug}" = x"true"; then + export CONFIG_SHELL="/bin/bash -x" +fi + # Checkout all the sources #bash -x ${topdir}/abe.sh --checkout all @@ -141,26 +183,26 @@ while test $i -lt ${#revisions[@]}; do continue fi - bash ${topdir}/abe.sh ${gerrit} --disable update --check --target ${target} gcc=gcc.git@${revisions[$i]} --build all --disable make_docs + bash -x ${topdir}/abe.sh ${gerrit} --disable update --check ${platform} gcc=gcc.git@${revisions[$i]} --build all --disable make_docs if test $? -gt 0; then echo "ERROR: Abe failed!" exit 1 fi # Compress .sum and .log files - sums="`find ${local_builds}/${build}/${target}/ -name \*.sum`" - logs="`find ${local_builds}/${build}/${target}/ -name \*.log | egrep -v 'config.log|check-.*.log|install.log'`" + sums="`find ${local_builds}/${build}/${targetname}/ -name \*.sum`" + logs="`find ${local_builds}/${build}/${targetname}/ -name \*.log | egrep -v 'config.log|check-.*.log|install.log'`" xz ${sums} ${logs} # FIXME: The way this is currently implemented only handles GCC backports. If binutils # backports are desired, this will have to be implented here. - sums="`find ${local_builds}/${build}/${target}/binutils-* -name \*.sum.xz`" - sums="${sums} `find ${local_builds}/${build}/${target}/gcc.git@${revisions[$i]}-stage2 -name \*.sum.xz`" + sums="`find ${local_builds}/${build}/${targetname}/binutils-* -name \*.sum.xz`" + sums="${sums} `find ${local_builds}/${build}/${targetname}/gcc.git@${revisions[$i]}-stage2 -name \*.sum.xz`" # Copy only the log files we want - logs="`find ${local_builds}/${build}/${target}/binutils-* -name \*.log.xz | egrep -v 'config.log|check-.*.log|install.log'`" - logs="${logs} `find ${local_builds}/${build}/${target}/gcc.git@${revisions[$i]}-stage2 -name \*.log.xz | egrep -v 'config.log|check-.*.log|install.log'`" + logs="`find ${local_builds}/${build}/${targetname}/binutils-* -name \*.log.xz | egrep -v 'config.log|check-.*.log|install.log'`" + logs="${logs} `find ${local_builds}/${build}/${targetname}/gcc.git@${revisions[$i]}-stage2 -name \*.log.xz | egrep -v 'config.log|check-.*.log|install.log'`" - manifest="`find ${local_builds}/${build}/${target} -name manifest.txt`" + manifest="`find ${local_builds}/${build}/${targetname} -name manifest.txt`" # xz ${resultsdir}${revisions[$i]}/*.sum ${resultsdir}${revisions[$i]}/*.log echo "Copying test results files to ${fileserver}:${dir}/ which will take some time..." |