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

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

Issue 9570042: Use goma for android builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment Created 8 years, 9 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 | build/android/envsetup.sh » ('j') | 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists." 83 echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists."
84 echo "@@@STEP_WARNINGS@@@" 84 echo "@@@STEP_WARNINGS@@@"
85 fi 85 fi
86 fi 86 fi
87 87
88 echo "@@@BUILD_STEP android_gyp@@@" 88 echo "@@@BUILD_STEP android_gyp@@@"
89 android_gyp 89 android_gyp
90 } 90 }
91 91
92 92
93 # Setup goma. Used internally to buildbot_functions.sh.
94 function bb_setup_goma_internal {
95 local goma_ctl=$(which goma_ctl.sh)
96 if [ "${goma_ctl}" != "" ]; then
97 local goma_dir=$(dirname ${goma_ctl})
98 fi
99 goma_dir=${goma_dir:-/b/build/goma}
100
101 if [ ! -f ${goma_dir}/goma_ctl.sh ]; then
102 echo "@@@STEP_WARNINGS@@@"
103 echo "Goma not found on this machine; defaulting to make"
104 return
105 fi
106 export GOMA_DIR=${goma_dir}
107 echo "GOMA_DIR: " $GOMA_DIR
108
109 ${GOMA_DIR}/goma_ctl.sh start
110 if [ -f ${goma_dir}/goma.key ]; then
111 export GOMA_API_KEY_FILE=${GOMA_DIR}/goma.key
112 fi
113 export GOMA_COMPILER_PROXY_DAEMON_MODE=true
114 export GOMA_COMPILER_PROXY_RPC_TIMEOUT_SECS=300
115 export PATH=$GOMA_DIR:$PATH
116 }
117
118 # $@: make args.
119 # Use goma if possible; degrades to non-Goma if needed.
120 function bb_goma_make {
121 bb_setup_goma_internal
122
123 if [ "${GOMA_DIR}" = "" ]; then
124 make -j${JOBS} "$@"
125 return
126 fi
127
128 HOST_CC=$GOMA_DIR/gcc
129 HOST_CXX=$GOMA_DIR/g++
130 TARGET_CC=$(/bin/ls $ANDROID_TOOLCHAIN/*-gcc | head -n1)
131 TARGET_CXX=$(/bin/ls $ANDROID_TOOLCHAIN/*-g++ | head -n1)
132 TARGET_CC="$GOMA_DIR/gomacc $TARGET_CC"
133 TARGET_CXX="$GOMA_DIR/gomacc $TARGET_CXX"
134 COMMON_JAVAC="$GOMA_DIR/gomacc /usr/bin/javac -J-Xmx512M \
135 -target 1.5 -Xmaxerrs 9999999"
136
137 make \
138 -j100 \
139 -l20 \
140 HOST_CC="$HOST_CC" \
141 HOST_CXX="$HOST_CXX" \
142 TARGET_CC="$TARGET_CC" \
143 TARGET_CXX="$TARGET_CXX" \
144 CC.host="$HOST_CC" \
145 CXX.host="$HOST_CXX" \
146 CC.target="$TARGET_CC" \
147 CXX.target="$TARGET_CXX" \
148 LINK.target="$TARGET_CXX" \
149 COMMON_JAVAC="$COMMON_JAVAC" \
150 "$@"
151 }
152
93 # Compile step 153 # Compile step
94 function bb_compile { 154 function bb_compile {
95 echo "@@@BUILD_STEP Compile@@@" 155 echo "@@@BUILD_STEP Compile@@@"
96 make -j${JOBS} 156 bb_goma_make
97 } 157 }
98 158
99 # Experimental compile step; does not turn the tree red if it fails. 159 # Experimental compile step; does not turn the tree red if it fails.
100 function bb_compile_experimental { 160 function bb_compile_experimental {
101 # Linking DumpRenderTree appears to hang forever? 161 # Linking DumpRenderTree appears to hang forever?
102 EXPERIMENTAL_TARGETS="android_experimental" 162 EXPERIMENTAL_TARGETS="android_experimental"
103 for target in ${EXPERIMENTAL_TARGETS} ; do 163 for target in ${EXPERIMENTAL_TARGETS} ; do
104 echo "@@@BUILD_STEP Experimental Compile $target @@@" 164 echo "@@@BUILD_STEP Experimental Compile $target @@@"
105 set +e 165 set +e
106 make -k -j4 "${target}" 166 bb_goma_make -k "${target}"
107 if [ $? -ne 0 ] ; then 167 if [ $? -ne 0 ] ; then
108 echo "@@@STEP_WARNINGS@@@" 168 echo "@@@STEP_WARNINGS@@@"
109 fi 169 fi
110 set -e 170 set -e
111 done 171 done
112 } 172 }
113 173
114 # Run tests on an emulator. 174 # Run tests on an emulator.
115 function bb_run_tests_emulator { 175 function bb_run_tests_emulator {
116 echo "@@@BUILD_STEP Run Tests on an Emulator@@@" 176 echo "@@@BUILD_STEP Run Tests on an Emulator@@@"
117 build/android/run_tests.py -e --xvfb --verbose 177 build/android/run_tests.py -e --xvfb --verbose
118 } 178 }
119 179
120 # Run tests on an actual device. (Better have one plugged in!) 180 # Run tests on an actual device. (Better have one plugged in!)
121 function bb_run_tests { 181 function bb_run_tests {
122 echo "@@@BUILD_STEP Run Tests on actual hardware@@@" 182 echo "@@@BUILD_STEP Run Tests on actual hardware@@@"
123 build/android/run_tests.py --xvfb --verbose 183 build/android/run_tests.py --xvfb --verbose
124 } 184 }
OLDNEW
« no previous file with comments | « no previous file | build/android/envsetup.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698