aoqi@0: #!/bin/bash aoqi@0: aoqi@0: set -x aoqi@0: set -e aoqi@0: aoqi@0: options="$*" aoqi@0: option="$1" aoqi@0: aoqi@0: tmp=/tmp/test_builds.$$ aoqi@0: rm -f -r ${tmp} aoqi@0: mkdir -p ${tmp} aoqi@0: aoqi@0: errMessages=${tmp}/error_messages.txt aoqi@0: aoqi@0: ####### aoqi@0: # Error function aoqi@0: error() # message aoqi@0: { aoqi@0: echo "ERROR: $1" | tee -a ${errMessages} aoqi@0: } aoqi@0: # Check errors aoqi@0: checkErrors() aoqi@0: { aoqi@0: if [ -s ${errMessages} ] ; then aoqi@0: cat ${errMessages} aoqi@0: exit 1 aoqi@0: fi aoqi@0: } aoqi@0: ####### aoqi@0: aoqi@0: os="`uname -s`" aoqi@0: arch="`uname -p`" aoqi@0: make=make aoqi@0: aoqi@0: if [ "${os}" = "SunOS" ] ; then aoqi@0: make=gmake aoqi@0: export J7="/opt/java/jdk1.7.0" aoqi@0: elif [ "${os}" = "Darwin" ] ; then aoqi@0: export J7="/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home" aoqi@0: elif [ "${os}" = "Linux" -a "${arch}" = "x86_64" ] ; then aoqi@0: export J7="/usr/lib/jvm/java-7-openjdk-amd64/" aoqi@0: else aoqi@0: echo "What os/arch is this: ${os}/${arch}" aoqi@0: exit 1 aoqi@0: fi aoqi@0: aoqi@0: # Must have a jdk7 aoqi@0: if [ ! -d ${J7} ] ; then aoqi@0: echo "No JDK7 found at: ${J7}" aoqi@0: exit 1 aoqi@0: fi aoqi@0: aoqi@0: # What sources we use aoqi@0: fromroot="http://hg.openjdk.java.net/build-infra/jdk8" aoqi@0: aoqi@0: # Where we do it aoqi@0: root="testbuilds" aoqi@0: mkdir -p ${root} aoqi@0: aoqi@0: # Three areas, last three are cloned from first to insure sameness aoqi@0: t0=${root}/t0 aoqi@0: t1=${root}/t1 aoqi@0: t2=${root}/t2 aoqi@0: t3=${root}/t3 aoqi@0: repolist="${t0} ${t1} ${t2} ${t3}" aoqi@0: aoqi@0: # Optional complete clobber aoqi@0: if [ "${option}" = "clobber" ] ; then aoqi@0: for i in ${repolist} ; do aoqi@0: rm -f -r ${i} aoqi@0: done aoqi@0: fi aoqi@0: aoqi@0: # Get top repos aoqi@0: if [ ! -d ${t0}/.hg ] ; then aoqi@0: rm -f -r ${t0} aoqi@0: hg clone ${fromroot} ${t0} aoqi@0: fi aoqi@0: for i in ${t1} ${t2} ${t3} ; do aoqi@0: if [ ! -d ${i}/.hg ] ; then aoqi@0: hg clone ${t0} ${i} aoqi@0: fi aoqi@0: done aoqi@0: aoqi@0: # Get repos updated aoqi@0: for i in ${repolist} ; do aoqi@0: ( \ aoqi@0: set -e \ aoqi@0: && cd ${i} \ aoqi@0: && sh ./get_source.sh \ aoqi@0: || error "Cannot get source" \ aoqi@0: ) 2>&1 | tee ${i}.get_source.txt aoqi@0: checkErrors aoqi@0: done aoqi@0: aoqi@0: # Optional clean aoqi@0: if [ "${option}" = "clean" ] ; then aoqi@0: for i in ${repolist} ; do aoqi@0: rm -f -r ${i}/build aoqi@0: rm -f -r ${i}/*/build aoqi@0: rm -f -r ${i}/*/dist aoqi@0: done aoqi@0: fi aoqi@0: aoqi@0: # Check changes on working set files aoqi@0: for i in ${repolist} ; do aoqi@0: ( \ aoqi@0: set -e \ aoqi@0: && cd ${i} \ aoqi@0: && sh ./make/scripts/hgforest.sh status \ aoqi@0: || error "Cannot check status" \ aoqi@0: ) 2>&1 | tee ${i}.hg.status.txt aoqi@0: checkErrors aoqi@0: done aoqi@0: aoqi@0: # Configure for build-infra building aoqi@0: for i in ${t1} ${t2} ; do aoqi@0: ( \ aoqi@0: set -e \ aoqi@0: && cd ${i}/common/makefiles \ aoqi@0: && sh ../autoconf/configure --with-boot-jdk=${J7} \ aoqi@0: || error "Cannot configure" \ aoqi@0: ) 2>&1 | tee ${i}.config.txt aoqi@0: checkErrors aoqi@0: done aoqi@0: aoqi@0: # Do build-infra builds aoqi@0: for i in ${t1} ${t2} ; do aoqi@0: ( \ aoqi@0: set -e \ aoqi@0: && cd ${i}/common/makefiles \ aoqi@0: && ${make} \ aoqi@0: FULL_VERSION:=1.8.0-internal-b00 \ aoqi@0: JRE_RELEASE_VERSION:=1.8.0-internal-b00 \ aoqi@0: USER_RELEASE_SUFFIX:=compare \ aoqi@0: RELEASE:=1.8.0-internal \ aoqi@0: VERBOSE= \ aoqi@0: LIBARCH= \ aoqi@0: all images \ aoqi@0: || error "Cannot build" \ aoqi@0: ) 2>&1 | tee ${i}.build.txt aoqi@0: checkErrors aoqi@0: done aoqi@0: aoqi@0: # Compare build-infra builds aoqi@0: ( \ aoqi@0: sh ${t0}/common/bin/compareimage.sh \ aoqi@0: ${t1}/build/*/images/j2sdk-image \ aoqi@0: ${t2}/build/*/images/j2sdk-image \ aoqi@0: || error "Cannot compare" \ aoqi@0: ) 2>&1 | tee ${root}/build-infra-comparison.txt aoqi@0: checkErrors aoqi@0: aoqi@0: # Do old build aoqi@0: unset JAVA_HOME aoqi@0: export ALT_BOOTDIR="${J7}" aoqi@0: ( \ aoqi@0: cd ${t3} \ aoqi@0: && ${make} FULL_VERSION='"1.8.0-internal" sanity \ aoqi@0: || error "Cannot sanity" \ aoqi@0: ) 2>&1 | tee ${t3}.sanity.txt aoqi@0: checkErrors aoqi@0: ( \ aoqi@0: cd ${t3} \ aoqi@0: && ${make} \ aoqi@0: FULL_VERSION='"1.8.0-internal" \ aoqi@0: JRE_RELEASE_VERSION:=1.8.0-internal-b00 \ aoqi@0: USER_RELEASE_SUFFIX:=compare \ aoqi@0: RELEASE:=1.8.0-internal \ aoqi@0: || error "Cannot build old way" \ aoqi@0: ) 2>&1 | tee ${t3}.build.txt aoqi@0: checkErrors aoqi@0: aoqi@0: # Compare old build to build-infra build aoqi@0: ( \ aoqi@0: sh ${t0}/common/bin/compareimage.sh \ aoqi@0: ${t3}/build/*/j2sdk-image \ aoqi@0: ${t1}/build/*/images/j2sdk-image \ aoqi@0: || error "Cannot compare" \ aoqi@0: ) 2>&1 | tee ${root}/build-comparison.txt aoqi@0: checkErrors aoqi@0: aoqi@0: exit 0 aoqi@0: