Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 set -o xtrace | 6 set -o xtrace |
| 7 set -o nounset | 7 set -o nounset |
| 8 set -o errexit | 8 set -o errexit |
| 9 | 9 |
| 10 clobber() { | |
| 11 echo "@@@BUILD_STEP clobber@@@" | |
| 12 rm -rf scons-out toolchain compiler hg ../xcodebuild ../sconsbuild ../out \ | |
| 13 src/third_party/nacl_sdk/arm-newlib | |
| 14 } | |
| 10 | 15 |
| 11 # This is the first thing you want to run on the bots to install the toolchains | 16 # This is the first thing you want to run on the bots to install the toolchains |
| 12 toolchain-setup() { | 17 install-lkgr-toolchains() { |
| 13 echo @@@BUILD_STEP clobber@@@ | 18 echo "@@@BUILD_STEP gclient_runhooks@@@" |
| 14 rm -rf scons-out toolchain compiler hg ../xcodebuild ../sconsbuild ../out \ | |
| 15 src/third_party/nacl_sdk/arm-newlib | |
| 16 | |
| 17 echo @@@BUILD_STEP gclient_runhooks@@@ | |
| 18 gclient runhooks --force | 19 gclient runhooks --force |
| 19 } | 20 } |
| 20 | 21 |
| 21 # We usually do not trust the TC to provide the latest (extra) SDK | 22 # We usually do not trust the TC to provide the latest (extra) SDK |
| 22 # so we rebuild them here | 23 # so we rebuild them here |
| 23 partial-sdk() { | 24 partial-sdk() { |
| 24 echo @@@BUILD_STEP partial_sdk@@@ | 25 echo "@@@BUILD_STEP partial_sdk@@@" |
| 25 UTMAN_BUILDBOT=true tools/llvm/utman.sh extrasdk-make-install | 26 UTMAN_BUILDBOT=true tools/llvm/utman.sh extrasdk-make-install |
| 26 } | 27 } |
| 27 | 28 |
| 28 # These tars up the executable to be shipped to the arm HW bots | 29 # These tars up the executable to be shipped to the arm HW bots |
| 29 archive-for-hw-bots() { | 30 archive-for-hw-bots() { |
| 30 echo @@@BUILD_STEP archive_build@@@ | 31 echo "@@@BUILD_STEP archive_build@@@" |
| 31 tar cvfz arm.tgz scons-out/ | 32 tar cvfz arm.tgz scons-out/ |
| 32 # TODO(bradnelson): explain this mechanism | 33 # TODO(bradnelson): explain this mechanism |
| 33 if [[ $BUILDBOT_BUILDERNAME == nacl-* ]]; then | 34 if [[ $BUILDBOT_BUILDERNAME == nacl-* ]]; then |
| 34 VERSION=None | 35 VERSION=None |
| 35 else | 36 else |
| 36 VERSION=rev_${BUILDBOT_GOT_REVISION} | 37 VERSION=rev_${BUILDBOT_GOT_REVISION} |
| 37 fi | 38 fi |
| 38 /b/build/scripts/slave/gsutil -h Cache-Control:no-cache cp -a public-read \ | 39 /b/build/scripts/slave/gsutil -h Cache-Control:no-cache cp -a public-read \ |
| 39 arm.tgz gs://nativeclient-archive2/between_builders/\ | 40 arm.tgz gs://nativeclient-archive2/between_builders/\ |
| 40 ${BUILDBOT_BUILDERNAME}/${VERSION}/build.tgz | 41 ${BUILDBOT_BUILDERNAME}/${VERSION}/build.tgz |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 52 export CC=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-gcc | 53 export CC=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-gcc |
| 53 export CXX=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-g++ | 54 export CXX=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-g++ |
| 54 export LD=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-ld | 55 export LD=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-ld |
| 55 export RANLIB=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-ranlib | 56 export RANLIB=${TOOLCHAIN_BIN}/arm-none-linux-gnueabi-ranlib |
| 56 export SYSROOT | 57 export SYSROOT |
| 57 export GYP_DEFINES="target_arch=arm \ | 58 export GYP_DEFINES="target_arch=arm \ |
| 58 sysroot=${TOOLCHAIN_DIR}/arm-none-linux-gnueabi/libc \ | 59 sysroot=${TOOLCHAIN_DIR}/arm-none-linux-gnueabi/libc \ |
| 59 linux_use_tcmalloc=0 armv7=1 arm_thumb=1" | 60 linux_use_tcmalloc=0 armv7=1 arm_thumb=1" |
| 60 export GYP_GENERATOR=make | 61 export GYP_GENERATOR=make |
| 61 | 62 |
| 62 echo @@@BUILD_STEP gyp_compile@@@ | 63 echo @@@BUILD_STEP gyp_compile@@@ |
|
jvoung - send to chromium...
2011/04/19 16:46:14
Can add quotes here and for gyp_tests also.
| |
| 63 make -C .. -k -j8 V=1 BUILDTYPE=${gypmode} | 64 make -C .. -k -j8 V=1 BUILDTYPE=${gypmode} |
| 64 | 65 |
| 65 echo @@@BUILD_STEP gyp_tests@@@ | 66 echo @@@BUILD_STEP gyp_tests@@@ |
| 66 python trusted_test.py --config ${gypmode} | 67 python trusted_test.py --config ${gypmode} |
| 67 } | 68 } |
| 68 | 69 |
| 69 | 70 |
| 70 ad-hoc-shared-lib-tests() { | 71 ad-hoc-shared-lib-tests() { |
| 71 # TODO(robertm): make this accessible by the utman script so that this get | 72 # TODO(robertm): make this accessible by the utman script so that this get |
| 72 # http://code.google.com/p/nativeclient/issues/detail?id=1647 | 73 # http://code.google.com/p/nativeclient/issues/detail?id=1647 |
| 73 echo @@@BUILD_STEP fake_shared_libs@@@ | 74 echo "@@@BUILD_STEP fake_shared_libs@@@" |
| 74 pushd tests/pnacl_ld_example/ | 75 pushd tests/pnacl_ld_example/ |
| 75 make -f Makefile.pnacl clean | 76 make -f Makefile.pnacl clean |
| 76 make -f Makefile.pnacl preparation | 77 make -f Makefile.pnacl preparation |
| 77 make -f Makefile.pnacl run.x86-32 | 78 make -f Makefile.pnacl run.x86-32 |
| 78 make -f Makefile.pnacl run.arm | 79 make -f Makefile.pnacl run.arm |
| 79 popd | 80 popd |
| 80 } | 81 } |
| 81 | 82 |
| 82 readonly SCONS_COMMON="./scons --verbose bitcode=1 -j8 -k" | 83 readonly SCONS_COMMON="./scons --verbose bitcode=1 -j8 -k" |
| 83 | 84 |
| 84 single-scons-test() { | 85 single-scons-test() { |
| 85 local platform=$1 | 86 local platform=$1 |
| 86 local extra=$2 | 87 local extra=$2 |
| 87 # this extra is actually printed as part of the build step | 88 # this extra is actually printed as part of the build step |
| 88 local extra2=$3 | 89 local extra2=$3 |
| 89 local test=$4 | 90 local test=$4 |
| 90 echo "@@@BUILD_STEP scons [${platform}] [${test}] [${extra2}]@@@" | 91 echo "@@@BUILD_STEP scons [${platform}] [${test}] [${extra2}]@@@" |
| 91 ${SCONS_COMMON} ${extra} ${extra2} platform=${platform} ${test} || \ | 92 ${SCONS_COMMON} ${extra} ${extra2} platform=${platform} ${test} || \ |
| 92 (RETCODE=$? && echo @@@STEP_FAILURE@@@) | 93 (RETCODE=$? && echo @@@STEP_FAILURE@@@) |
|
jvoung - send to chromium...
2011/04/19 16:46:14
can add quotes for the @@@ here too
| |
| 93 | 94 |
| 94 | 95 |
| 95 } | 96 } |
| 96 | 97 |
| 97 scons-tests() { | 98 scons-tests() { |
| 98 local platforms=$1 | 99 local platforms=$1 |
| 99 local extra=$2 | 100 local extra=$2 |
| 100 local test=$3 | 101 local test=$3 |
| 101 for platform in ${platforms} ; do | 102 for platform in ${platforms} ; do |
| 102 single-scons-test ${platform} "${extra}" "" "${test}" | 103 single-scons-test ${platform} "${extra}" "" "${test}" |
| 103 single-scons-test ${platform} "${extra}" "nacl_pic=1" "${test}" | 104 single-scons-test ${platform} "${extra}" "nacl_pic=1" "${test}" |
| 104 if [ "${platform}" != "arm" ] ; then | 105 if [ "${platform}" != "arm" ] ; then |
| 105 single-scons-test ${platform} "${extra}" \ | 106 single-scons-test ${platform} "${extra}" \ |
| 106 "use_sandboxed_translator=1" "${test}" | 107 "use_sandboxed_translator=1" "${test}" |
| 107 fi | 108 fi |
| 108 done | 109 done |
| 109 } | 110 } |
| 110 | 111 |
| 111 ###################################################################### | 112 ###################################################################### |
| 112 mode-trybot() { | 113 mode-trybot() { |
| 113 toolchain-setup | 114 clobber |
| 115 install-lkgr-toolchains | |
| 114 partial-sdk | 116 partial-sdk |
| 115 scons-tests "arm x86-32 x86-64" "--mode=opt-host,nacl" "smoke_tests" | 117 scons-tests "arm x86-32 x86-64" "--mode=opt-host,nacl" "smoke_tests" |
| 116 ad-hoc-shared-lib-tests | 118 ad-hoc-shared-lib-tests |
| 117 } | 119 } |
| 118 | 120 |
| 119 mode-buildbot() { | 121 mode-buildbot-x8632() { |
| 120 toolchain-setup | 122 clobber |
| 123 install-lkgr-toolchains | |
| 121 partial-sdk | 124 partial-sdk |
| 122 # First build everything | 125 # First build everything |
| 123 scons-tests "arm x86-32 x86-64" "--mode=opt-host,nacl" "" | 126 scons-tests "x86-32" "--mode=opt-host,nacl" "" |
| 124 # Then test (not all nexes which are build are also tested) | 127 # Then test (not all nexes which are build are also tested) |
| 125 scons-tests "arm x86-32 x86-64" "--mode=opt-host,nacl" "smoke_tests" | 128 scons-tests "x86-32" "--mode=opt-host,nacl" "smoke_tests" |
| 129 ad-hoc-shared-lib-tests | |
| 130 } | |
| 131 | |
| 132 mode-buildbot-x8664() { | |
| 133 clobber | |
| 134 install-lkgr-toolchains | |
| 135 partial-sdk | |
| 136 # First build everything | |
| 137 scons-tests "x86-64" "--mode=opt-host,nacl" "" | |
| 138 # Then test (not all nexes which are build are also tested) | |
| 139 scons-tests "x86-64" "--mode=opt-host,nacl" "smoke_tests" | |
| 126 ad-hoc-shared-lib-tests | 140 ad-hoc-shared-lib-tests |
| 127 } | 141 } |
| 128 | 142 |
| 129 # NOTE: not tested yet, for reference only to illustrate future plans | 143 # NOTE: not tested yet, for reference only to illustrate future plans |
| 130 # TOOD(robertm): see whether it really makes sense to merge dbg/opt | 144 # TOOD(robertm): see whether it really makes sense to merge dbg/opt |
| 131 mode-buildbot-arm() { | 145 mode-buildbot-arm() { |
| 132 toolchain-setup | 146 clobber |
| 147 install-lkgr-toolchains | |
| 133 partial-sdk | 148 partial-sdk |
| 134 # gyp tests for both opt and dbg | 149 # gyp tests for both opt and dbg |
| 135 gyp-arm-build opt | 150 gyp-arm-build opt |
| 136 gyp-arm-build dbg | 151 gyp-arm-build dbg |
| 137 # note we build both opt and dbg trusted components | 152 # note we build both opt and dbg trusted components |
| 138 scons-tests "arm" "--mode=dbg-host,nacl" "" | 153 scons-tests "arm" "--mode=dbg-host,nacl" "" |
| 139 scons-tests "arm" "--mode=opt-host,nacl" "" | 154 scons-tests "arm" "--mode=opt-host,nacl" "" |
| 140 # the testing is done only with opt components | 155 # the testing is done only with opt components |
| 141 scons-tests "arm" "--mode=opt-host,nacl" "small_tests" | 156 scons-tests "arm" "--mode=opt-host,nacl" "small_tests" |
| 142 scons-tests "arm" "--mode=opt-host,nacl" "medium_tests" | 157 scons-tests "arm" "--mode=opt-host,nacl" "medium_tests" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 165 fi | 180 fi |
| 166 | 181 |
| 167 if [ "$(type -t $1)" != "function" ]; then | 182 if [ "$(type -t $1)" != "function" ]; then |
| 168 Usage | 183 Usage |
| 169 echo "ERROR: unknown mode '$1'." >&2 | 184 echo "ERROR: unknown mode '$1'." >&2 |
| 170 exit 1 | 185 exit 1 |
| 171 fi | 186 fi |
| 172 | 187 |
| 173 eval "$@" | 188 eval "$@" |
| 174 | 189 |
| OLD | NEW |