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

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

Issue 12310007: Switch all remaining android builders to ninja (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 29 matching lines...) Expand all
40 # $2 and beyond: key value pairs which are parsed by bb_parse_args. 40 # $2 and beyond: key value pairs which are parsed by bb_parse_args.
41 function bb_baseline_setup { 41 function bb_baseline_setup {
42 SRC_ROOT="$1" 42 SRC_ROOT="$1"
43 # Remove SRC_ROOT param 43 # Remove SRC_ROOT param
44 shift 44 shift
45 cd $SRC_ROOT 45 cd $SRC_ROOT
46 46
47 echo "@@@BUILD_STEP Environment setup@@@" 47 echo "@@@BUILD_STEP Environment setup@@@"
48 bb_parse_args "$@" 48 bb_parse_args "$@"
49 49
50 local BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) 50 export GYP_GENERATORS=ninja
51 if [[ $BUILDTOOL = ninja ]]; then
52 export GYP_GENERATORS=ninja
53 fi
54 export GOMA_DIR=/b/build/goma 51 export GOMA_DIR=/b/build/goma
55 . build/android/envsetup.sh 52 . build/android/envsetup.sh
56 53
57 local extra_gyp_defines="$(bb_get_json_prop "$FACTORY_PROPERTIES" \ 54 local extra_gyp_defines="$(bb_get_json_prop "$FACTORY_PROPERTIES" \
58 extra_gyp_defines)" 55 extra_gyp_defines)"
59 export GYP_DEFINES+=" fastbuild=1 $extra_gyp_defines" 56 export GYP_DEFINES+=" fastbuild=1 $extra_gyp_defines"
60 if echo $extra_gyp_defines | grep -qE 'clang|asan'; then 57 if echo $extra_gyp_defines | grep -qE 'clang|asan'; then
61 unset CXX_target 58 unset CXX_target
62 fi 59 fi
63 60
(...skipping 16 matching lines...) Expand all
80 # crbug.com/145860 77 # crbug.com/145860
81 rm -rf ~/.android 78 rm -rf ~/.android
82 rm -rf "$build_path" 79 rm -rf "$build_path"
83 if [[ -e $build_path ]] ; then 80 if [[ -e $build_path ]] ; then
84 echo "Clobber appeared to fail? $build_path still exists." 81 echo "Clobber appeared to fail? $build_path still exists."
85 echo "@@@STEP_WARNINGS@@@" 82 echo "@@@STEP_WARNINGS@@@"
86 fi 83 fi
87 fi 84 fi
88 } 85 }
89 86
90 function bb_compile_setup {
91 bb_setup_goma_internal
92 # Should be called only after envsetup is done.
93 gclient runhooks
94 }
95
96 function bb_asan_tests_setup { 87 function bb_asan_tests_setup {
97 # Download or build the ASan runtime library. 88 # Download or build the ASan runtime library.
98 ${SRC_ROOT}/tools/clang/scripts/update.sh 89 ${SRC_ROOT}/tools/clang/scripts/update.sh
99 } 90 }
100 91
101 # Setup goma. Used internally to buildbot_functions.sh. 92 # Setup goma. Used internally to buildbot_functions.sh.
102 function bb_setup_goma_internal { 93 function bb_setup_goma_internal {
103 export GOMA_API_KEY_FILE=${GOMA_DIR}/goma.key
104 export GOMA_COMPILER_PROXY_DAEMON_MODE=true
105 export GOMA_COMPILER_PROXY_RPC_TIMEOUT_SECS=300
106
107 echo "Killing old goma processes" 94 echo "Killing old goma processes"
108 ${GOMA_DIR}/goma_ctl.sh stop || true 95 ${GOMA_DIR}/goma_ctl.sh stop || true
109 killall -9 compiler_proxy || true 96 killall -9 compiler_proxy || true
110 97
111 echo "Starting goma" 98 echo "Starting goma"
112 ${GOMA_DIR}/goma_ctl.sh start 99 ${GOMA_DIR}/goma_ctl.sh start
113 trap bb_stop_goma_internal SIGHUP SIGINT SIGTERM 100 trap bb_stop_goma_internal SIGHUP SIGINT SIGTERM
114 } 101 }
115 102
116 # Stop goma. 103 # Stop goma.
117 function bb_stop_goma_internal { 104 function bb_stop_goma_internal {
118 echo "Stopping goma" 105 echo "Stopping goma"
119 ${GOMA_DIR}/goma_ctl.sh stop 106 ${GOMA_DIR}/goma_ctl.sh stop
120 } 107 }
121 108
122 # $@: make args.
123 # Use goma if possible; degrades to non-Goma if needed.
124 function bb_goma_make {
125 if [ "${GOMA_DIR}" = "" ]; then
126 make -j${JOBS} "$@"
127 return
128 fi
129
130 HOST_CC=$GOMA_DIR/gcc
131 HOST_CXX=$GOMA_DIR/g++
132 TARGET_CC=$(/bin/ls $ANDROID_TOOLCHAIN/*-gcc | head -n1)
133 TARGET_CXX=$(/bin/ls $ANDROID_TOOLCHAIN/*-g++ | head -n1)
134 TARGET_CC="$GOMA_DIR/gomacc $TARGET_CC"
135 TARGET_CXX="$GOMA_DIR/gomacc $TARGET_CXX"
136 COMMON_JAVAC="$GOMA_DIR/gomacc /usr/bin/javac -J-Xmx512M \
137 -target 1.5 -Xmaxerrs 9999999"
138
139 command make \
140 -j100 \
141 -l20 \
142 HOST_CC="$HOST_CC" \
143 HOST_CXX="$HOST_CXX" \
144 TARGET_CC="$TARGET_CC" \
145 TARGET_CXX="$TARGET_CXX" \
146 CC.host="$HOST_CC" \
147 CXX.host="$HOST_CXX" \
148 CC.target="$TARGET_CC" \
149 CXX.target="$TARGET_CXX" \
150 LINK.target="$TARGET_CXX" \
151 COMMON_JAVAC="$COMMON_JAVAC" \
152 BUILDTYPE="$BUILDTYPE" \
153 "$@"
154
155 local make_exit_code=$?
156 return $make_exit_code
157 }
158
159 # Build using ninja. 109 # Build using ninja.
160 function bb_goma_ninja { 110 function bb_goma_ninja {
161 echo "Using ninja to build." 111 echo "Using ninja to build."
162 local TARGET=$1 112 local TARGET=$1
163 ninja -C out/$BUILDTYPE -j120 -l20 $TARGET 113 bb_setup_goma_internal
114 ninja -C out/$BUILDTYPE -j1000 -l20 $TARGET
Yaron 2013/02/20 18:59:21 Why change the -j now?
Isaac (away) 2013/02/21 00:09:18 didn't think it mattered. I just took a look at c
115 bb_stop_goma_internal
164 } 116 }
165 117
166 # Compile step 118 # Compile step
167 function bb_compile { 119 function bb_compile {
168 # This must be named 'compile', not 'Compile', for CQ interaction. 120 # This must be named 'compile' for CQ.
169 # Talk to maruel for details.
170 echo "@@@BUILD_STEP compile@@@" 121 echo "@@@BUILD_STEP compile@@@"
171 bb_compile_setup 122 gclient runhooks
172 123 bb_goma_ninja All
173 BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool)
174 if [[ $BUILDTOOL = ninja ]]; then
175 bb_goma_ninja All
176 else
177 bb_goma_make
178 fi
179
180 bb_stop_goma_internal
181 } 124 }
182 125
183 # Experimental compile step; does not turn the tree red if it fails. 126 # Experimental compile step; does not turn the tree red if it fails.
184 function bb_compile_experimental { 127 function bb_compile_experimental {
185 # Linking DumpRenderTree appears to hang forever? 128 # Linking DumpRenderTree appears to hang forever?
186 EXPERIMENTAL_TARGETS="android_experimental" 129 EXPERIMENTAL_TARGETS="android_experimental"
187 for target in ${EXPERIMENTAL_TARGETS} ; do 130 for target in ${EXPERIMENTAL_TARGETS} ; do
188 echo "@@@BUILD_STEP Experimental Compile $target @@@" 131 echo "@@@BUILD_STEP Experimental Compile $target @@@"
189 set +e 132 set +e
190 if [[ $BUILDTOOL = ninja ]]; then 133 bb_goma_ninja "${target}"
191 bb_goma_ninja "${target}"
192 else
193 bb_goma_make -k "${target}"
194 fi
195 if [ $? -ne 0 ] ; then 134 if [ $? -ne 0 ] ; then
196 echo "@@@STEP_WARNINGS@@@" 135 echo "@@@STEP_WARNINGS@@@"
197 fi 136 fi
198 set -e 137 set -e
199 done 138 done
200 } 139 }
201 140
202 # Run findbugs. 141 # Run findbugs.
203 function bb_run_findbugs { 142 function bb_run_findbugs {
204 echo "@@@BUILD_STEP findbugs@@@" 143 echo "@@@BUILD_STEP findbugs@@@"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 ) 218 )
280 } 219 }
281 220
282 # Retrieve a packed json property using python 221 # Retrieve a packed json property using python
283 function bb_get_json_prop { 222 function bb_get_json_prop {
284 local JSON="$1" 223 local JSON="$1"
285 local PROP="$2" 224 local PROP="$2"
286 225
287 python -c "import json; print json.loads('$JSON').get('$PROP', '')" 226 python -c "import json; print json.loads('$JSON').get('$PROP', '')"
288 } 227 }
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