Bug 1250709 - Clobber builds, r=terrence
☠☠ backed out by e2b9894a48e5 ☠ ☠
authorSteve Fink <sfink@mozilla.com>
Wed, 24 Feb 2016 15:14:17 -0800
changeset 288755 68e3c64301214d4a656f9aadea250f13ec768480
parent 288754 5b48be011a930964b86ba5276e772a8c174c6f91
child 288756 f1b77ed0c0c4a5d40d4ba854db9ae506d906b070
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1250709
milestone48.0a1
Bug 1250709 - Clobber builds, r=terrence
js/src/devtools/rootAnalysis/analyze.py
testing/taskcluster/scripts/builder/hazard-analysis.sh
--- a/js/src/devtools/rootAnalysis/analyze.py
+++ b/js/src/devtools/rootAnalysis/analyze.py
@@ -101,16 +101,20 @@ JOBS = { 'dbs':
                '--build-root=%(objdir)s',
                '--wrap-dir=%(sixgill)s/scripts/wrap_gcc',
                '--work-dir=work',
                '-b', '%(sixgill_bin)s',
                '--buildcommand=%(buildcommand)s',
                '.'),
               ()),
 
+         'list-dbs':
+             (('ls', '-l'),
+              ()),
+
          'callgraph':
              (('%(js)s', '%(analysis_scriptdir)s/computeCallgraph.js'),
               'callgraph.txt'),
 
          'gcFunctions':
              (('%(js)s', '%(analysis_scriptdir)s/computeGCFunctions.js', '%(callgraph)s',
                '[gcFunctions]', '[gcFunctions_list]', '[gcEdges]', '[suppressedFunctions_list]'),
               ('gcFunctions.txt', 'gcFunctions.lst', 'gcEdges.txt', 'suppressedFunctions.lst')),
--- a/testing/taskcluster/scripts/builder/hazard-analysis.sh
+++ b/testing/taskcluster/scripts/builder/hazard-analysis.sh
@@ -11,28 +11,43 @@ ANALYSIS_SRCDIR=$JS_SRCDIR/devtools/root
 PYTHON=python2.7
 if ! which $PYTHON; then
     PYTHON=python
 fi
 
 export CC="$GECKO_DIR/gcc/bin/gcc"
 export CXX="$GECKO_DIR/gcc/bin/g++"
 
+function check_commit_msg () {
+    hg --cwd "$GECKO_DIR" log -r. --template '{desc}\n' | grep -q -- "$1"
+}
+
+if check_commit_msg "--dep"; then
+    HAZ_DEP=1
+fi
+
 function build_js_shell () {
     ( cd $JS_SRCDIR; autoconf-2.13 )
+    if [[ -z "$HAZ_DEP" ]]; then
+        [ -d $HAZARD_SHELL_OBJDIR ] && rm -rf $HAZARD_SHELL_OBJDIR
+    fi
     mkdir -p $HAZARD_SHELL_OBJDIR || true
     cd $HAZARD_SHELL_OBJDIR
     $JS_SRCDIR/configure --enable-optimize --disable-debug --enable-ctypes --enable-nspr-build --without-intl-api --with-ccache
     make -j4
 }
 
 function configure_analysis () {
     local analysis_dir
     analysis_dir="$1"
 
+    if [[ -z "$HAZ_DEP" ]]; then
+        [ -d "$analysis_dir" ] && rm -rf "$analysis_dir"
+    fi
+
     mkdir -p "$analysis_dir" || true
     (
         cd "$analysis_dir"
         cat > defaults.py <<EOF
 js = "$HAZARD_SHELL_OBJDIR/dist/bin/js"
 analysis_scriptdir = "$ANALYSIS_SRCDIR"
 objdir = "$MOZ_OBJDIR"
 source = "$GECKO_DIR"
@@ -43,16 +58,20 @@ EOF
 }
 
 function run_analysis () {
     local analysis_dir
     analysis_dir="$1"
     local build_type
     build_type="$2"
 
+    if [[ -z "$HAZ_DEP" ]]; then
+        [ -d $MOZ_OBJDIR ] && rm -rf $MOZ_OBJDIR
+    fi
+
     (
         cd "$analysis_dir"
         $PYTHON "$ANALYSIS_SRCDIR/analyze.py" --buildcommand="$GECKO_DIR/testing/mozharness/scripts/spidermonkey/build.${build_type}"
     )
 }
 
 function grab_artifacts () {
     local analysis_dir
@@ -67,18 +86,21 @@ function grab_artifacts () {
         # Do not error out if no files found
         shopt -s nullglob
         set +e
         for f in *.txt *.lst; do
             gzip -9 -c "$f" > "${artifacts}/$f.gz"
         done
 
         # Check whether the user requested .xdb file upload in the top commit comment
+        if check_commit_msg "--upload-xdbs"; then
+            HAZ_UPLOAD_XDBS=1
+        fi
 
-        if hg --cwd "$GECKO_DIR" log -l1 --template '{desc}\n' | grep -q -- '--upload-xdbs'; then
+        if [ -n "$HAZ_UPLOAD_XDBS" ]; then
             for f in *.xdb; do
                 bzip2 -c "$f" > "${artifacts}/$f.bz2"
             done
         fi
     )
 }
 
 function check_hazards () {