Index: buildbot/buildbot_pnacl_merge.sh |
=================================================================== |
--- buildbot/buildbot_pnacl_merge.sh (revision 0) |
+++ buildbot/buildbot_pnacl_merge.sh (revision 0) |
@@ -0,0 +1,126 @@ |
+#!/bin/bash |
+# Copyright (c) 2011 The Native Client Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+set -u |
+set -e |
+ |
+# Script assumed to be run in native_client/ |
+if [[ $(pwd) != */native_client ]]; then |
+ echo 'ERROR: must be run in native_client/ directory!' |
+ echo " (Current directory is $(pwd))" |
+ exit 1 |
+fi |
+ |
+RETCODE=0 |
+ |
+export UTMAN_BUILDBOT=true |
+export UTMAN_USE_MQ=false |
+export UTMAN_UPSTREAM=true |
+export UTMAN_UPSTREAM_SKIP_UPDATE=true |
+ |
+UTMAN=tools/llvm/utman.sh |
+MERGE_TOOL=tools/llvm/merge-tool.sh |
+SPEC2K_SCRIPT=buildbot/buildbot_spec2k.sh |
+UTMAN_TEST=tools/llvm/utman-test.sh |
+ |
+clobber() { |
+ echo @@@BUILD_STEP clobber@@@ |
jvoung - send to chromium...
2011/07/28 23:48:54
should this check if the clobber env var is set?
pdox
2011/07/29 00:05:55
CLOBBER is probably not useful here.
|
+ rm -rf scons-out compiler ../xcodebuild ../sconsbuild ../out \ |
+ src/third_party/nacl_sdk/arm-newlib |
+ rm -rf toolchain/pnacl* toolchain/hg* toolchain/test-log |
+ rm -rf ../toolchain |
+ # Try to clobber /tmp/ contents to clear temporary chrome files. |
+ rm -rf /tmp/.org.chromium.Chromium.* |
+} |
+ |
+show-config() { |
+ echo @@@BUILD_STEP show-config@@@ |
+ ${UTMAN} show-config |
+} |
+ |
+build-pnacl() { |
+ echo @@@BUILD_STEP compile_toolchain@@@ |
+ ${UTMAN} clean |
+ ${UTMAN} everything-translator |
jvoung - send to chromium...
2011/07/28 23:48:54
this leaves "sdk" around for spec testing right?
pdox
2011/07/29 00:05:55
yes, but that's not critical.
scons uses its own
|
+} |
+ |
+utman-test() { |
+ local testname=$1 |
+ echo @@@BUILD_STEP ${testname}@@@ |
+ ${UTMAN_TEST} ${testname} || |
+ { RETCODE=$? && echo @@@STEP_FAILURE@@@;} |
+ |
+} |
+ |
+slow-bot() { |
jvoung - send to chromium...
2011/07/28 23:48:54
Comment on difference between slow-bot and fast-bo
pdox
2011/07/29 00:05:55
Done.
|
+ clobber |
+ show-config |
+ ${UTMAN} hg-update-upstream |
+ build-pnacl |
+ |
+ # SCons Tests |
+ utman-test test-x86-32 |
+ utman-test test-x86-32-pic |
+ utman-test test-x86-32-browser |
+ utman-test test-x86-64 |
+ utman-test test-x86-64-pic |
+ utman-test test-x86-64-browser |
+ # TODO(pdox): Enable after MC bug is fixed |
+ # utman-test test-arm |
+ # utman-test test-arm-pic |
+ |
+ # Spec2K |
+ CLOBBER=no ${SPEC2K_SCRIPT} pnacl-x8632 |
+ CLOBBER=no ${SPEC2K_SCRIPT} pnacl-x8664 |
+ # TODO(pdox): Enable after MC bug is fixed |
+ # CLOBBER=no ${SPEC2K_SCRIPT} pnacl-arm |
+} |
+ |
+fast-bot() { |
+ clobber |
+ show-config |
+ |
+ # Disable this bot until we are merged |
+ # up to the tip and all tests are passing |
+ return 0 |
+ |
+ ${MERGE_TOOL} auto |
jvoung - send to chromium...
2011/07/28 23:48:54
is there a change to merge tool to add an "auto" f
pdox
2011/07/29 00:05:55
yes, added. It is not quite ready, but 90% there.
|
+ build-pnacl |
+ utman-test test-x86-32 |
+ utman-test test-x86-64 |
+ utman-test test-arm |
+ # TODO(pdox): Add a few Spec2K tests |
+ commit-and-push-merge |
+} |
+ |
+commit-and-push-merge() { |
+ echo "@@@BUILD_STEP commit-and-push-merge@@@" |
+ if [ ${RETCODE} -eq 0 ]; then |
+ ${MERGE_TOOL} final-commit |
+ echo "@@@STEP_SUCCESS@@@" |
+ else |
+ echo "Skipping due to prior failure(s)" |
+ echo "@@@STEP_FAILURE@@@" |
+ fi |
+} |
+ |
+if [[ $# -eq 0 ]] ; then |
+ echo "you must specify a mode on the commandline:" |
+ exit 1 |
+fi |
+ |
+if [ "$(type -t $1)" != "function" ]; then |
+ Usage |
+ echo "ERROR: unknown mode '$1'." >&2 |
+ exit 1 |
+fi |
+ |
+"$@" |
+ |
+if [[ ${RETCODE} != 0 ]]; then |
+ echo "@@@BUILD_STEP summary@@@" |
+ echo There were failed stages. |
+ exit ${RETCODE} |
+fi |