Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: build/android/buildbot/buildbot_functions.sh

Issue 10911140: Fix more ninja issues (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium 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 # Bash functions used by buildbot annotator scripts for the android 6 # Bash functions used by buildbot annotator scripts for the android
7 # build of chromium. Executing this script should not perform actions 7 # build of chromium. Executing this script should not perform actions
8 # other than setting variables and defining of functions. 8 # other than setting variables and defining of functions.
9 9
10 # Number of jobs on the compile line; e.g. make -j"${JOBS}" 10 # Number of jobs on the compile line; e.g. make -j"${JOBS}"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 bb_parse_args "$@" 58 bb_parse_args "$@"
59 59
60 cd $SRC_ROOT 60 cd $SRC_ROOT
61 if [ ! "$BUILDBOT_CLOBBER" = "" ]; then 61 if [ ! "$BUILDBOT_CLOBBER" = "" ]; then
62 NEED_CLOBBER=1 62 NEED_CLOBBER=1
63 fi 63 fi
64 64
65 export GOMA_DIR=/b/build/goma 65 export GOMA_DIR=/b/build/goma
66 66
67 local BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) 67 local BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool)
68 if [ $BUILDTOOL = "ninja" ]; then 68 if [[ $BUILDTOOL = ninja ]]; then
69 export GYP_GENERATORS=ninja 69 export GYP_GENERATORS=ninja
70 fi 70 fi
71 71
72 . build/android/envsetup.sh 72 . build/android/envsetup.sh
73 73
74 if [ "$NEED_CLOBBER" -eq 1 ]; then 74 if [ "$NEED_CLOBBER" -eq 1 ]; then
75 echo "@@@BUILD_STEP Clobber@@@" 75 echo "@@@BUILD_STEP Clobber@@@"
76 # Sdk key expires, delete android folder. 76 # Sdk key expires, delete android folder.
77 # crbug.com/145860 77 # crbug.com/145860
78 rm -rf ~/.android 78 rm -rf ~/.android
79 rm -rf "${SRC_ROOT}"/out 79 rm -rf "${SRC_ROOT}"/out
80 if [ -e "${SRC_ROOT}"/out ] ; then 80 if [ -e "${SRC_ROOT}"/out ] ; then
81 echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists." 81 echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists."
82 echo "@@@STEP_WARNINGS@@@" 82 echo "@@@STEP_WARNINGS@@@"
83 fi 83 fi
84 fi 84 fi
85 85
86 # Should be called only after envsetup is done. 86 # Should be called only after envsetup is done.
87 bb_run_gclient_hooks 87 bb_run_gclient_hooks
88 } 88 }
89 89
90 90
91 # Setup goma. Used internally to buildbot_functions.sh. 91 # Setup goma. Used internally to buildbot_functions.sh.
92 function bb_setup_goma_internal { 92 function bb_setup_goma_internal {
93 export GOMA_API_KEY_FILE=${GOMA_DIR}/goma.key 93 export GOMA_API_KEY_FILE=${GOMA_DIR}/goma.key
94 export GOMA_COMPILER_PROXY_DAEMON_MODE=true 94 export GOMA_COMPILER_PROXY_DAEMON_MODE=true
95 export GOMA_COMPILER_PROXY_RPC_TIMEOUT_SECS=300 95 export GOMA_COMPILER_PROXY_RPC_TIMEOUT_SECS=300
96 96
97 echo "Killing old goma processes"
98 ${GOMA_DIR}/goma_ctl.sh stop || true
99 killall compiler_proxy || true
100
97 echo "Starting goma" 101 echo "Starting goma"
98 ${GOMA_DIR}/goma_ctl.sh ensure_start 102 ${GOMA_DIR}/goma_ctl.sh ensure_start
99 trap bb_stop_goma_internal SIGHUP SIGINT SIGTERM 103 trap bb_stop_goma_internal SIGHUP SIGINT SIGTERM
100 } 104 }
101 105
102 # Stop goma. 106 # Stop goma.
103 function bb_stop_goma_internal { 107 function bb_stop_goma_internal {
104 echo "Stopping goma" 108 echo "Stopping goma"
105 ${GOMA_DIR}/goma_ctl.sh stop 109 ${GOMA_DIR}/goma_ctl.sh stop
106 } 110 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 155
152 # Compile step 156 # Compile step
153 function bb_compile { 157 function bb_compile {
154 # This must be named 'compile', not 'Compile', for CQ interaction. 158 # This must be named 'compile', not 'Compile', for CQ interaction.
155 # Talk to maruel for details. 159 # Talk to maruel for details.
156 echo "@@@BUILD_STEP compile@@@" 160 echo "@@@BUILD_STEP compile@@@"
157 161
158 bb_setup_goma_internal 162 bb_setup_goma_internal
159 163
160 BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) 164 BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool)
161 if [ $BUILDTOOL = "ninja" ]; then 165 if [[ $BUILDTOOL = ninja ]]; then
162 bb_goma_ninja All 166 bb_goma_ninja All
163 else 167 else
164 bb_goma_make 168 bb_goma_make
165 fi 169 fi
166 170
167 bb_stop_goma_internal 171 bb_stop_goma_internal
168 } 172 }
169 173
170 # Experimental compile step; does not turn the tree red if it fails. 174 # Experimental compile step; does not turn the tree red if it fails.
171 function bb_compile_experimental { 175 function bb_compile_experimental {
172 # Linking DumpRenderTree appears to hang forever? 176 # Linking DumpRenderTree appears to hang forever?
173 EXPERIMENTAL_TARGETS="android_experimental" 177 EXPERIMENTAL_TARGETS="android_experimental"
174 for target in ${EXPERIMENTAL_TARGETS} ; do 178 for target in ${EXPERIMENTAL_TARGETS} ; do
175 echo "@@@BUILD_STEP Experimental Compile $target @@@" 179 echo "@@@BUILD_STEP Experimental Compile $target @@@"
176 set +e 180 set +e
177 if [ $BUILDTOOL = "ninja" ]; then 181 if [[ $BUILDTOOL = ninja ]]; then
178 bb_goma_ninja "${target}" 182 bb_goma_ninja "${target}"
179 else 183 else
180 bb_goma_make -k "${target}" 184 bb_goma_make -k "${target}"
181 fi 185 fi
182 if [ $? -ne 0 ] ; then 186 if [ $? -ne 0 ] ; then
183 echo "@@@STEP_WARNINGS@@@" 187 echo "@@@STEP_WARNINGS@@@"
184 fi 188 fi
185 set -e 189 set -e
186 done 190 done
187 } 191 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 ) 302 )
299 } 303 }
300 304
301 # Retrieve a packed json property using python 305 # Retrieve a packed json property using python
302 function bb_get_json_prop { 306 function bb_get_json_prop {
303 local JSON="$1" 307 local JSON="$1"
304 local PROP="$2" 308 local PROP="$2"
305 309
306 python -c "import json; print json.loads('$JSON').get('$PROP')" 310 python -c "import json; print json.loads('$JSON').get('$PROP')"
307 } 311 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698