Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 19 matching lines...) Expand all Loading... | |
| 30 shift | 30 shift |
| 31 done | 31 done |
| 32 } | 32 } |
| 33 | 33 |
| 34 # Function to force-green a bot. | 34 # Function to force-green a bot. |
| 35 function bb_force_bot_green_and_exit { | 35 function bb_force_bot_green_and_exit { |
| 36 echo "@@@BUILD_STEP Bot forced green.@@@" | 36 echo "@@@BUILD_STEP Bot forced green.@@@" |
| 37 exit 0 | 37 exit 0 |
| 38 } | 38 } |
| 39 | 39 |
| 40 function bb_run_gclient_hooks { | |
| 41 gclient runhooks | |
| 42 } | |
| 43 | |
| 44 # Basic setup for all bots to run after a source tree checkout. | 40 # Basic setup for all bots to run after a source tree checkout. |
| 45 # Args: | 41 # Args: |
| 46 # $1: source root. | 42 # $1: source root. |
| 47 # $2 and beyond: key value pairs which are parsed by bb_parse_args. | 43 # $2 and beyond: key value pairs which are parsed by bb_parse_args. |
| 48 function bb_baseline_setup { | 44 function bb_baseline_setup { |
| 49 SRC_ROOT="$1" | 45 SRC_ROOT="$1" |
| 50 # Remove SRC_ROOT param | 46 # Remove SRC_ROOT param |
| 51 shift | 47 shift |
| 52 cd $SRC_ROOT | 48 cd $SRC_ROOT |
| 53 | 49 |
| 54 if [[ $BUILDBOT_CLOBBER ]]; then | 50 if [[ $BUILDBOT_CLOBBER ]]; then |
| 55 echo "@@@BUILD_STEP Clobber@@@" | 51 echo "@@@BUILD_STEP Clobber@@@" |
| 56 # Sdk key expires, delete android folder. | 52 # Sdk key expires, delete android folder. |
| 57 # crbug.com/145860 | 53 # crbug.com/145860 |
| 58 rm -rf ~/.android | 54 rm -rf ~/.android |
| 59 rm -rf "${SRC_ROOT}"/out | 55 rm -rf "${SRC_ROOT}"/out |
| 60 if [ -e "${SRC_ROOT}"/out ] ; then | 56 if [ -e "${SRC_ROOT}"/out ] ; then |
| 61 echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists." | 57 echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists." |
| 62 echo "@@@STEP_WARNINGS@@@" | 58 echo "@@@STEP_WARNINGS@@@" |
| 63 fi | 59 fi |
| 64 fi | 60 fi |
| 65 | 61 |
| 66 echo "@@@BUILD_STEP Environment setup@@@" | 62 echo "@@@BUILD_STEP Environment setup@@@" |
| 67 bb_parse_args "$@" | 63 bb_parse_args "$@" |
| 68 | 64 |
| 69 local BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) | 65 local BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) |
| 70 if [[ $BUILDTOOL = ninja ]]; then | 66 if [[ $BUILDTOOL = ninja ]]; then |
| 71 export GYP_GENERATORS=ninja | 67 export GYP_GENERATORS=ninja |
| 72 fi | 68 fi |
| 73 bb_setup_goma_internal | 69 export GOMA_DIR=/b/build/goma |
| 74 . build/android/envsetup.sh | 70 . build/android/envsetup.sh |
| 71 } | |
|
Yaron
2012/09/28 03:18:55
I take it testers don't need to runhooks and have
Isaac (away)
2012/09/28 03:28:13
I don't think so. We did have that compiler failu
| |
| 72 | |
| 73 function bb_compile_setup { | |
| 75 local extra_gyp_defines="$(bb_get_json_prop "$FACTORY_PROPERTIES" \ | 74 local extra_gyp_defines="$(bb_get_json_prop "$FACTORY_PROPERTIES" \ |
| 76 extra_gyp_defines)" | 75 extra_gyp_defines)" |
| 77 export GYP_DEFINES+=" fastbuild=1 $extra_gyp_defines" | 76 export GYP_DEFINES+=" fastbuild=1 $extra_gyp_defines" |
| 78 if echo $extra_gyp_defines | grep -q clang; then | 77 if echo $extra_gyp_defines | grep -q clang; then |
| 79 unset CXX_target | 78 unset CXX_target |
| 80 fi | 79 fi |
| 80 bb_setup_goma_internal | |
| 81 # Should be called only after envsetup is done. | 81 # Should be called only after envsetup is done. |
| 82 bb_run_gclient_hooks | 82 gclient runhooks |
| 83 } | 83 } |
| 84 | 84 |
| 85 | |
| 86 # Setup goma. Used internally to buildbot_functions.sh. | 85 # Setup goma. Used internally to buildbot_functions.sh. |
| 87 function bb_setup_goma_internal { | 86 function bb_setup_goma_internal { |
| 88 export GOMA_DIR=/b/build/goma | |
| 89 export GOMA_API_KEY_FILE=${GOMA_DIR}/goma.key | 87 export GOMA_API_KEY_FILE=${GOMA_DIR}/goma.key |
| 90 export GOMA_COMPILER_PROXY_DAEMON_MODE=true | 88 export GOMA_COMPILER_PROXY_DAEMON_MODE=true |
| 91 export GOMA_COMPILER_PROXY_RPC_TIMEOUT_SECS=300 | 89 export GOMA_COMPILER_PROXY_RPC_TIMEOUT_SECS=300 |
| 92 | 90 |
| 93 echo "Killing old goma processes" | 91 echo "Killing old goma processes" |
| 94 ${GOMA_DIR}/goma_ctl.sh stop || true | 92 ${GOMA_DIR}/goma_ctl.sh stop || true |
| 95 killall -9 compiler_proxy || true | 93 killall -9 compiler_proxy || true |
| 96 | 94 |
| 97 echo "Starting goma" | 95 echo "Starting goma" |
| 98 ${GOMA_DIR}/goma_ctl.sh start | 96 ${GOMA_DIR}/goma_ctl.sh start |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 | 142 |
| 145 # Build using ninja. | 143 # Build using ninja. |
| 146 function bb_goma_ninja { | 144 function bb_goma_ninja { |
| 147 echo "Using ninja to build." | 145 echo "Using ninja to build." |
| 148 local TARGET=$1 | 146 local TARGET=$1 |
| 149 ninja -C out/$BUILDTYPE -j120 -l20 $TARGET | 147 ninja -C out/$BUILDTYPE -j120 -l20 $TARGET |
| 150 } | 148 } |
| 151 | 149 |
| 152 # Compile step | 150 # Compile step |
| 153 function bb_compile { | 151 function bb_compile { |
| 152 bb_compile_setup | |
| 154 # This must be named 'compile', not 'Compile', for CQ interaction. | 153 # This must be named 'compile', not 'Compile', for CQ interaction. |
| 155 # Talk to maruel for details. | 154 # Talk to maruel for details. |
| 156 echo "@@@BUILD_STEP compile@@@" | 155 echo "@@@BUILD_STEP compile@@@" |
| 157 | 156 |
| 158 BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) | 157 BUILDTOOL=$(bb_get_json_prop "$FACTORY_PROPERTIES" buildtool) |
| 159 if [[ $BUILDTOOL = ninja ]]; then | 158 if [[ $BUILDTOOL = ninja ]]; then |
| 160 bb_goma_ninja All | 159 bb_goma_ninja All |
| 161 else | 160 else |
| 162 bb_goma_make | 161 bb_goma_make |
| 163 fi | 162 fi |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 ) | 298 ) |
| 300 } | 299 } |
| 301 | 300 |
| 302 # Retrieve a packed json property using python | 301 # Retrieve a packed json property using python |
| 303 function bb_get_json_prop { | 302 function bb_get_json_prop { |
| 304 local JSON="$1" | 303 local JSON="$1" |
| 305 local PROP="$2" | 304 local PROP="$2" |
| 306 | 305 |
| 307 python -c "import json; print json.loads('$JSON').get('$PROP', '')" | 306 python -c "import json; print json.loads('$JSON').get('$PROP', '')" |
| 308 } | 307 } |
| OLD | NEW |