OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # Tell build.sh and test.sh that we're a bot. | 10 # Tell build.sh and test.sh that we're a bot. |
11 export PNACL_BUILDBOT=true | 11 export PNACL_BUILDBOT=true |
12 # Make TC bots print all log output to console (this variable only affects | 12 # Make TC bots print all log output to console (this variable only affects |
13 # build.sh output) | 13 # build.sh output) |
14 export PNACL_VERBOSE=true | 14 export PNACL_VERBOSE=true |
15 | 15 |
16 # This affects trusted components of gyp and scons builds. | 16 # This affects trusted components of scons builds. |
17 # The setting OPT reuslts in optimized/release trusted executables, | 17 # The setting OPT reuslts in optimized/release trusted executables, |
18 # the setting DEBUG results in unoptimized/debug trusted executables | 18 # the setting DEBUG results in unoptimized/debug trusted executables |
19 BUILD_MODE_HOST=OPT | 19 BUILD_MODE_HOST=OPT |
20 # If true, terminate script when first scons error is encountered. | 20 # If true, terminate script when first scons error is encountered. |
21 FAIL_FAST=${FAIL_FAST:-true} | 21 FAIL_FAST=${FAIL_FAST:-true} |
22 # This remembers when any build steps failed, but we ended up continuing. | 22 # This remembers when any build steps failed, but we ended up continuing. |
23 RETCODE=0 | 23 RETCODE=0 |
24 | 24 |
25 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh" | 25 readonly UP_DOWN_LOAD="buildbot/file_up_down_load.sh" |
26 # This script is used by toolchain bots (i.e. tc-xxx functions) | 26 # This script is used by toolchain bots (i.e. tc-xxx functions) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBotsTry ${name} arm-scons.tgz | 104 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBotsTry ${name} arm-scons.tgz |
105 else | 105 else |
106 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBots ${name} arm-scons.tgz | 106 ${UP_DOWN_LOAD} DownloadArmBinariesForHWBots ${name} arm-scons.tgz |
107 fi | 107 fi |
108 | 108 |
109 echo "@@@BUILD_STEP untar_binaries@@@" | 109 echo "@@@BUILD_STEP untar_binaries@@@" |
110 rm -rf scons-out/ | 110 rm -rf scons-out/ |
111 tar xvfz arm-scons.tgz --no-same-owner | 111 tar xvfz arm-scons.tgz --no-same-owner |
112 } | 112 } |
113 | 113 |
114 # Build with gyp - this only exercises the trusted TC and hence this only | |
115 # makes sense to run for ARM. | |
116 gyp-arm-build() { | |
117 local gypmode="Release" | |
118 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then | |
119 gypmode="Debug" | |
120 fi | |
121 | |
122 echo "@@@BUILD_STEP gyp_configure [${gypmode}]@@@" | |
123 # Setup environment for arm. | |
124 export GYP_DEFINES="target_arch=arm" | |
125 export GYP_CROSSCOMPILE=1 | |
126 # NOTE: gclient runhooks and gyp_nacl use the exported env vars so we have to | |
127 # run it again | |
128 gclient runhooks | |
129 | |
130 echo "@@@BUILD_STEP gyp_compile [${gypmode}]@@@" | |
131 ninja -C ../out/${gypmode} -v | |
132 } | |
133 | |
134 # Build with gyp for MIPS. | |
135 gyp-mips32-build() { | |
136 local gypmode="Release" | |
137 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then | |
138 gypmode="Debug" | |
139 fi | |
140 | |
141 # Ensure the trusted mips toolchain is installed. | |
142 build/package_version/package_version.py \ | |
143 --packages linux_x86/mips_trusted sync -x | |
144 | |
145 echo "@@@BUILD_STEP gyp_configure [${gypmode}]@@@" | |
146 # Add mipsel-linux-gnu-gcc tools to the PATH | |
147 export PATH=$PATH:$PWD/toolchain/linux_x86/mips_trusted/bin/ | |
148 export GYP_DEFINES="target_arch=mipsel" | |
149 export GYP_CROSSCOMPILE=1 | |
150 # NOTE: gclient runhooks and gyp_nacl use the exported env vars so we have to | |
151 # run it again | |
152 gclient runhooks | |
153 | |
154 echo "@@@BUILD_STEP gyp_compile [${gypmode}]@@@" | |
155 ninja -C ../out/${gypmode} -v | |
156 } | |
157 | |
158 # QEMU upload bot runs this function, and the hardware download bot runs | 114 # QEMU upload bot runs this function, and the hardware download bot runs |
159 # mode-buildbot-arm-hw | 115 # mode-buildbot-arm-hw |
160 mode-buildbot-arm() { | 116 mode-buildbot-arm() { |
161 clobber | 117 clobber |
162 | 118 |
163 gyp-arm-build | |
164 | |
165 # Don't run the tests on qemu, only build them. | 119 # Don't run the tests on qemu, only build them. |
166 # QEMU is too flaky for the main waterfall | 120 # QEMU is too flaky for the main waterfall |
167 local mode | 121 local mode |
168 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then | 122 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then |
169 mode="dbg" | 123 mode="dbg" |
170 else | 124 else |
171 mode="opt" | 125 mode="opt" |
172 fi | 126 fi |
173 buildbot/buildbot_pnacl.py --skip-run ${mode} arm pnacl | 127 buildbot/buildbot_pnacl.py --skip-run ${mode} arm pnacl |
174 } | 128 } |
175 | 129 |
176 mode-buildbot-arm-hw() { | 130 mode-buildbot-arm-hw() { |
177 local mode | 131 local mode |
178 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then | 132 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then |
179 mode="dbg" | 133 mode="dbg" |
180 else | 134 else |
181 mode="opt" | 135 mode="opt" |
182 fi | 136 fi |
183 buildbot/buildbot_pnacl.py --skip-build ${mode} arm pnacl | 137 buildbot/buildbot_pnacl.py --skip-build ${mode} arm pnacl |
184 } | 138 } |
185 | 139 |
186 mode-trybot-qemu() { | 140 mode-trybot-qemu() { |
187 clobber | 141 clobber |
188 local arch=$1 | 142 local arch=$1 |
189 # TODO(dschuff): move the gyp build to buildbot_pnacl.py | |
190 if [[ ${arch} == "arm" ]] ; then | |
191 gyp-arm-build | |
192 elif [[ ${arch} == "mips32" ]] ; then | |
193 gyp-mips32-build | |
194 fi | |
195 | 143 |
196 buildbot/buildbot_pnacl.py opt $arch pnacl | 144 buildbot/buildbot_pnacl.py opt $arch pnacl |
197 } | 145 } |
198 | 146 |
199 mode-buildbot-arm-dbg() { | 147 mode-buildbot-arm-dbg() { |
200 BUILD_MODE_HOST=DEDUG | 148 BUILD_MODE_HOST=DEDUG |
201 mode-buildbot-arm | 149 mode-buildbot-arm |
202 archive-for-hw-bots $(NAME_ARM_UPLOAD) regular | 150 archive-for-hw-bots $(NAME_ARM_UPLOAD) regular |
203 } | 151 } |
204 | 152 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 exit 1 | 248 exit 1 |
301 fi | 249 fi |
302 | 250 |
303 "$@" | 251 "$@" |
304 | 252 |
305 if [[ ${RETCODE} != 0 ]]; then | 253 if [[ ${RETCODE} != 0 ]]; then |
306 echo "@@@BUILD_STEP summary@@@" | 254 echo "@@@BUILD_STEP summary@@@" |
307 echo There were failed stages. | 255 echo There were failed stages. |
308 exit ${RETCODE} | 256 exit ${RETCODE} |
309 fi | 257 fi |
OLD | NEW |