Path: blob/aarch64-shenandoah-jdk8u272-b10/common/bin/test_builds.sh
32281 views
#!/bin/bash12set -x3set -e45options="$*"6option="$1"78tmp=/tmp/test_builds.$$9rm -f -r ${tmp}10mkdir -p ${tmp}1112errMessages=${tmp}/error_messages.txt1314#######15# Error function16error() # message17{18echo "ERROR: $1" | tee -a ${errMessages}19}20# Check errors21checkErrors()22{23if [ -s ${errMessages} ] ; then24cat ${errMessages}25exit 126fi27}28#######2930os="`uname -s`"31arch="`uname -p`"32make=make3334if [ "${os}" = "SunOS" ] ; then35make=gmake36export J7="/opt/java/jdk1.7.0"37elif [ "${os}" = "Darwin" ] ; then38export J7="/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home"39elif [ "${os}" = "Linux" -a "${arch}" = "x86_64" ] ; then40export J7="/usr/lib/jvm/java-7-openjdk-amd64/"41else42echo "What os/arch is this: ${os}/${arch}"43exit 144fi4546# Must have a jdk747if [ ! -d ${J7} ] ; then48echo "No JDK7 found at: ${J7}"49exit 150fi5152# What sources we use53fromroot="http://hg.openjdk.java.net/build-infra/jdk8"5455# Where we do it56root="testbuilds"57mkdir -p ${root}5859# Three areas, last three are cloned from first to insure sameness60t0=${root}/t061t1=${root}/t162t2=${root}/t263t3=${root}/t364repolist="${t0} ${t1} ${t2} ${t3}"6566# Optional complete clobber67if [ "${option}" = "clobber" ] ; then68for i in ${repolist} ; do69rm -f -r ${i}70done71fi7273# Get top repos74if [ ! -d ${t0}/.hg ] ; then75rm -f -r ${t0}76hg clone ${fromroot} ${t0}77fi78for i in ${t1} ${t2} ${t3} ; do79if [ ! -d ${i}/.hg ] ; then80hg clone ${t0} ${i}81fi82done8384# Get repos updated85for i in ${repolist} ; do86( \87set -e \88&& cd ${i} \89&& sh ./get_source.sh \90|| error "Cannot get source" \91) 2>&1 | tee ${i}.get_source.txt92checkErrors93done9495# Optional clean96if [ "${option}" = "clean" ] ; then97for i in ${repolist} ; do98rm -f -r ${i}/build99rm -f -r ${i}/*/build100rm -f -r ${i}/*/dist101done102fi103104# Check changes on working set files105for i in ${repolist} ; do106( \107set -e \108&& cd ${i} \109&& sh ./make/scripts/hgforest.sh status \110|| error "Cannot check status" \111) 2>&1 | tee ${i}.hg.status.txt112checkErrors113done114115# Configure for build-infra building116for i in ${t1} ${t2} ; do117( \118set -e \119&& cd ${i}/common/makefiles \120&& sh ../autoconf/configure --with-boot-jdk=${J7} \121|| error "Cannot configure" \122) 2>&1 | tee ${i}.config.txt123checkErrors124done125126# Do build-infra builds127for i in ${t1} ${t2} ; do128( \129set -e \130&& cd ${i}/common/makefiles \131&& ${make} \132FULL_VERSION:=1.8.0-internal-b00 \133JRE_RELEASE_VERSION:=1.8.0-internal-b00 \134USER_RELEASE_SUFFIX:=compare \135RELEASE:=1.8.0-internal \136VERBOSE= \137LIBARCH= \138all images \139|| error "Cannot build" \140) 2>&1 | tee ${i}.build.txt141checkErrors142done143144# Compare build-infra builds145( \146sh ${t0}/common/bin/compareimage.sh \147${t1}/build/*/images/j2sdk-image \148${t2}/build/*/images/j2sdk-image \149|| error "Cannot compare" \150) 2>&1 | tee ${root}/build-infra-comparison.txt151checkErrors152153# Do old build154unset JAVA_HOME155export ALT_BOOTDIR="${J7}"156( \157cd ${t3} \158&& ${make} FULL_VERSION='"1.8.0-internal" sanity \159|| error "Cannot sanity" \160) 2>&1 | tee ${t3}.sanity.txt161checkErrors162( \163cd ${t3} \164&& ${make} \165FULL_VERSION='"1.8.0-internal" \166JRE_RELEASE_VERSION:=1.8.0-internal-b00 \167USER_RELEASE_SUFFIX:=compare \168RELEASE:=1.8.0-internal \169|| error "Cannot build old way" \170) 2>&1 | tee ${t3}.build.txt171checkErrors172173# Compare old build to build-infra build174( \175sh ${t0}/common/bin/compareimage.sh \176${t3}/build/*/j2sdk-image \177${t1}/build/*/images/j2sdk-image \178|| error "Cannot compare" \179) 2>&1 | tee ${root}/build-comparison.txt180checkErrors181182exit 0183184185186