X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=do_build;h=a898bbaff6ec0e01e90928da8d0c78e0e21425cb;hb=HEAD;hp=9b041192b9f3758520857085fe1dd28f14f5ca4e;hpb=56527e170d25f68a799782256136dd78b77feb63;p=next-scripts diff --git a/do_build b/do_build index 9b04119..a898bba 100755 --- a/do_build +++ b/do_build @@ -1,40 +1,194 @@ -#!/bin/sh +#!/bin/bash -. "$(dirname $0)/common.sh" +tree= +if [ "$1" ]; then + tree=$1 + shift +fi + +# shellcheck source=common.sh +. "$(dirname "$0")/common.sh" set -e -###ssh "$build_host" /bin/sh -e <<-EOF -ssh root@"$build_host" unshare -n su $(id -u -n) <<-EOF - set -e +bparent=$(dirname "$build_dir") + +line=$(tail -n 1 "$SHA1_FILE") + +# strip everything after the first tab character +stree=${line%% *} +if [ "$tree" ]; then + if [ "$tree" != "$stree" ]; then + printf 'That is not the last tree merged (%s v %s)\n' "$tree" "$stree" 1>&2 + exit 1 + fi +else + tree="$stree" +fi +obdir="$bparent/old/$tree" + +cmd="/bin/sh" +if [ "$build_host" ]; then + cmd="ssh root@$build_host unshare -n su $(id -u -n)" +fi + +log_regex='/^[[:space:]]+$/d +/^[.[:digit:]]+user [.[:digit:]]+system [:.[:digit:]]+elapsed [[:digit:]]+%CPU \([[:digit:]]+avgtext\+[[:digit:]]+avgdata [[:digit:]]+maxresident\)k$/d +/^[[:digit:]]+inputs\+[[:digit:]]+outputs \([[:digit:]]+major\+[[:digit:]]+minor\)pagefaults [[:digit:]]+swaps$/d +/^Setup is [[:digit:]]+ bytes \(padded to [[:digit:]]+ bytes\)\.$/d +/^System is [[:digit:]]+ kB$/d +/^CRC [[:xdigit:]]+$/d +/^Kernel: arch\/x86\/boot\/bzImage is ready \(#[[:digit:]]+\)$/d +s/^(WARNING: (modpost: )?(drivers\/built-in|vmlinux)\.o\(\.[^+]*\+0x)[[:xdigit:]]+(\): Section mismatch in reference from .*)$/\1XXXX\4/ +/^Warning: Kernel ABI header at /d +/^[[:space:]]+PERF_VERSION = /d +s/^(Parsed description of) [[:digit:]]+ (helper function)/\1 X \2/ +s/^[[:xdigit:]]+([[:space:]]+R_PPC64_(ADDR64|REL32)[[:space:]].*)$/XXX\1/' + +$cmd <<-EOF + + echo Building on \$(hostname) echo \$PATH | grep -q "\$HOME/bin" || export PATH="\$HOME/bin:\$PATH" export LANG=C - cd "$build_dir" - - export CCACHE_DIR="${build_dir%/*}/.ccache" - export TMPDIR="${build_dir%/*}/tmp" - - git reset --hard next - touch .scmversion - - d=../powerpc_ppc64_defconfig - [ -d \$d ] || mkdir \$d - cross -n -N -a powerpc64 -k powerpc -c 4.8.1 O=\$d ppc64_defconfig - cross -n -N -a powerpc64 -k powerpc -c 4.8.1 O=\$d -j64 -s - - d=../x86_64_allmodconfig - [ -d \$d ] || mkdir \$d - e=\$d.except - cat >\$e <&1 | less + else + diff -u /dev/null \$log 2>&1 | less + fi + fi + if [ \$len -gt 0 ]; then + (sanitise_log <\$log; cat $bparent/log-ignore ) | + sort -u >$bparent/log-ignore.tmp + mv $bparent/log-ignore.tmp $bparent/log-ignore + fi + mv \$log $obdir/\$b + } + + echo Building: x86_64 allmodconfig + d="$bparent/x86_64_allmodconfig" + [ -d \$d ] || mkdir \$d || exit 1 + log_x86=\$d.log + make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=\$d -s allmodconfig || exit 1 + echo "Forking x86 build ..." + /usr/bin/time make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- O=\$d -j100 -O -s > \$log_x86 2>&1 & + x86_64_pid=\$! + + echo Building: perf + d="$bparent/perf" + [ -d \$d ] || mkdir \$d || exit 1 + log_perf=\$d.log + # the -Wno-psabi is to suppress + # note: the layout of aggregates containing vectors with 8-byte alignment has changed in GCC 5 + # warnings until at least gcc 12 when the warning will be removed + /usr/bin/time make -C tools/perf -f Makefile.perf -s -O -j40 O=\$d EXTRA_CFLAGS=-Wno-psabi > \$log_perf 2>&1 + rc=\$? + + if [ \$rc -ne 0 ]; then + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "ERROR: perf build failed - log follows" + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + cat \$log_perf + kill \$x86_64_pid || true + killall make + rm .scmversion + exit 1 + else + show_log native perf \$log_perf + fi + + echo Building: powerpc ppc64_defconfig + d="$bparent/powerpc_ppc64_defconfig" + [ -d \$d ] || mkdir \$d || exit 1 + log_ppc=\$d.log + make ARCH=powerpc O=\$d -s ppc64_defconfig || exit 1 + /usr/bin/time make ARCH=powerpc O=\$d -j40 -O -s > \$log_ppc 2>&1 + rc=\$? + + if [ \$rc -ne 0 ]; then + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "ERROR: powerpc ppc64_defconfig build failed - log follows" + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + cat \$log_ppc + kill \$x86_64_pid || true + killall make + rm .scmversion + exit 1 + else + show_log powerpc ppc64_defconfig \$log_ppc + fi + + echo Building: arm multi_v7_defconfig + d="$bparent/arm_multi_v7_defconfig" + [ -d \$d ] || mkdir \$d || exit 1 + log_arm=\$d.log + make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=\$d -s multi_v7_defconfig || exit 1 + /usr/bin/time make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=\$d -j40 -O -s > \$log_arm 2>&1 + rc=\$? + + if [ \$rc -ne 0 ]; then + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "ERROR: arm multi_v7_defconfig build failed - log follows" + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + cat \$log_arm + kill \$x86_64_pid || true + killall make + rm .scmversion + exit 1 + else + show_log arm multi_v7_defconfig \$log_arm + fi + + wait \$x86_64_pid + rc=\$? + + if [ \$rc -ne 0 ]; then + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo "ERROR: x86_64 allmodconfig build failed - log follows" + echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + cat \$log_x86 + rm .scmversion + exit 1 + else + show_log x86_64 allmodconfig \$log_x86 + fi + + rm .scmversion EOF