Bug 1201179: Use custom branch gecko objdir for emulator and phone builds. r=garndt
authorWander Lairson Costa <wcosta@mozilla.com>
Thu, 10 Sep 2015 11:40:21 -0300
changeset 294254 d38a3f773d07946466e09ccb156cbe484070d6bc
parent 294253 6324e134f80b9fae5bfcfd2281a7076c0ea16fe7
child 294255 7671701d15cadd2b343fc27685231e0689bb71df
child 294270 9f6bd98f767c90b5abbe0c5ba90409404f99cc3e
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgarndt
bugs1201179
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1201179: Use custom branch gecko objdir for emulator and phone builds. r=garndt Messing up with shared cached object directories for different branches often triggers build bustage. Make the object directory unique for each branch.
testing/mozharness/scripts/b2g_build.py
testing/taskcluster/scripts/builder/build-emulator-x86.sh
testing/taskcluster/scripts/builder/build-emulator.sh
testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
testing/taskcluster/scripts/phone-builder/build-phone.sh
testing/taskcluster/scripts/phone-builder/pre-build.sh
testing/taskcluster/tasks/builds/b2g_aries_spark_debug.yml
testing/taskcluster/tasks/builds/b2g_aries_spark_dogfood.yml
testing/taskcluster/tasks/builds/b2g_aries_spark_eng.yml
testing/taskcluster/tasks/builds/b2g_aries_spark_opt.yml
testing/taskcluster/tasks/builds/b2g_aries_spark_ota_debug.yml
testing/taskcluster/tasks/builds/b2g_aries_spark_ota_opt.yml
testing/taskcluster/tasks/builds/b2g_emulator_ics_debug.yml
testing/taskcluster/tasks/builds/b2g_emulator_ics_opt.yml
testing/taskcluster/tasks/builds/b2g_emulator_jb_debug.yml
testing/taskcluster/tasks/builds/b2g_emulator_jb_opt.yml
testing/taskcluster/tasks/builds/b2g_emulator_kk_debug.yml
testing/taskcluster/tasks/builds/b2g_emulator_kk_opt.yml
testing/taskcluster/tasks/builds/b2g_emulator_l_debug.yml
testing/taskcluster/tasks/builds/b2g_emulator_l_opt.yml
testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_debug.yml
testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_opt.yml
testing/taskcluster/tasks/builds/b2g_emulator_x86_l_opt.yml
testing/taskcluster/tasks/builds/b2g_flame_kk_debug.yml
testing/taskcluster/tasks/builds/b2g_flame_kk_eng.yml
testing/taskcluster/tasks/builds/b2g_flame_kk_opt.yml
testing/taskcluster/tasks/builds/b2g_flame_kk_ota_debug.yml
testing/taskcluster/tasks/builds/b2g_flame_kk_ota_opt.yml
testing/taskcluster/tasks/builds/b2g_flame_kk_spark_eng.yml
--- a/testing/mozharness/scripts/b2g_build.py
+++ b/testing/mozharness/scripts/b2g_build.py
@@ -109,16 +109,20 @@ class B2GBuild(LocalesMixin, PurgeMixin,
         [["--complete-mar-url"], {
             "dest": "complete_mar_url",
             "help": "the URL where the complete MAR was uploaded. Required if submit-to-balrog is requested and upload isn't.",
         }],
         [["--platform"], {
             "dest": "platform",
             "help": "the platform used by balrog submmiter.",
         }],
+        [["--gecko-objdir"], {
+            "dest": "gecko_objdir",
+            "help": "Specifies the gecko object directory.",
+        }],
     ]
 
     def __init__(self, require_config_file=False, config={},
                  all_actions=all_actions,
                  default_actions=default_actions):
         # Default configuration
         default_config = {
             'default_vcs': 'hgtool',
@@ -152,17 +156,18 @@ class B2GBuild(LocalesMixin, PurgeMixin,
             config_options=self.config_options,
             require_config_file=require_config_file,
             config=default_config,
             all_actions=all_actions,
             default_actions=default_actions,
         )
 
         dirs = self.query_abs_dirs()
-        self.objdir = os.path.join(dirs['work_dir'], 'objdir-gecko')
+        self.objdir = self.config.get("gecko_objdir",
+                os.path.join(dirs['work_dir'], 'objdir-gecko'))
         self.abs_dirs['abs_obj_dir'] = self.objdir
         if self.config.get("update_type", "ota") == "fota":
             self.make_updates_cmd = ['./build.sh', 'gecko-update-fota']
             self.extra_update_attrs = 'isOsUpdate="true"'
             self.isOSUpdate = True
         else:
             self.make_updates_cmd = ['./build.sh', 'gecko-update-full']
             self.extra_update_attrs = None
@@ -552,16 +557,19 @@ class B2GBuild(LocalesMixin, PurgeMixin,
             env['L10NBASEDIR'] = dirs['abs_l10n_dir']
             env['MOZ_CHROME_MULTILOCALE'] = " ".join(self.query_locales())
             if 'PATH' not in env:
                 env['PATH'] = os.environ.get('PATH')
             env['PATH'] += ':%s' % os.path.join(dirs['compare_locales_dir'], 'scripts')
             env['PYTHONPATH'] = os.environ.get('PYTHONPATH', '')
             env['PYTHONPATH'] += ':%s' % os.path.join(dirs['compare_locales_dir'], 'lib')
 
+        with open(os.path.join(dirs['work_dir'], '.userconfig'), 'w') as cfg:
+            cfg.write('GECKO_OBJDIR={0}'.format(self.objdir))
+
         self.enable_mock()
         if self.config['ccache']:
             self.run_command('ccache -z', cwd=dirs['work_dir'], env=env)
         for cmd in cmds:
             retval = self.run_command(cmd, cwd=dirs['work_dir'], env=env, error_list=B2GMakefileErrorList)
             if retval != 0:
                 break
         if self.config['ccache']:
--- a/testing/taskcluster/scripts/builder/build-emulator-x86.sh
+++ b/testing/taskcluster/scripts/builder/build-emulator-x86.sh
@@ -30,35 +30,38 @@ install-packages.sh $WORKSPACE/gecko
 
 debug_flag=""
 if [ 0$B2G_DEBUG -ne 0 ]; then
   debug_flag='--debug'
 fi
 
 rm -rf $WORKSPACE/B2G/out/target/product/generic_x86/tests/
 
+gecko_objdir=/home/worker/objdir-gecko/objdir
+
 $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
   --config b2g/taskcluster-emulator.py \
   "$debug_flag" \
   --disable-mock \
   --work-dir=$WORKSPACE/B2G \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
-  --repo=$WORKSPACE/gecko
+  --repo=$WORKSPACE/gecko \
+  --gecko-objdir=$gecko_objdir
 
 # Move files into artifact locations!
 mkdir -p $HOME/artifacts
 
 ls -lah $WORKSPACE/B2G/out
-ls -lah $WORKSPACE/B2G/objdir-gecko/dist/
+ls -lah $gecko_objdir/dist/
 
 mv $WORKSPACE/B2G/sources.xml $HOME/artifacts/sources.xml
 mv $WORKSPACE/B2G/out/target/product/generic_x86/tests/gaia-tests.zip $HOME/artifacts/gaia-tests.zip
 for name in common cppunittest reftest mochitest xpcshell web-platform; do
-    mv $WORKSPACE/B2G/objdir-gecko/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
+    mv $gecko_objdir/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
 done
-mv $WORKSPACE/B2G/objdir-gecko/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
+mv $gecko_objdir/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
 mv $WORKSPACE/B2G/out/emulator.tar.gz $HOME/artifacts/emulator.tar.gz
-mv $WORKSPACE/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
+mv $gecko_objdir/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
 
 ccache -s
--- a/testing/taskcluster/scripts/builder/build-emulator.sh
+++ b/testing/taskcluster/scripts/builder/build-emulator.sh
@@ -32,35 +32,38 @@ install-packages.sh $WORKSPACE/gecko
 
 debug_flag=""
 if [ 0$B2G_DEBUG -ne 0 ]; then
   debug_flag='--debug'
 fi
 
 rm -rf $WORKSPACE/B2G/out/target/product/generic/tests/
 
+gecko_objdir=/home/worker/objdir-gecko/objdir
+
 $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
   --config b2g/taskcluster-emulator.py \
   "$debug_flag" \
   --disable-mock \
   --work-dir=$WORKSPACE/B2G \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
-  --repo=$WORKSPACE/gecko
+  --repo=$WORKSPACE/gecko \
+  --gecko-objdir=$gecko_objdir
 
 # Move files into artifact locations!
 mkdir -p $HOME/artifacts
 
 ls -lah $WORKSPACE/B2G/out
-ls -lah $WORKSPACE/B2G/objdir-gecko/dist/
+ls -lah $gecko_objdir/dist/
 
 mv $WORKSPACE/B2G/sources.xml $HOME/artifacts/sources.xml
 mv $WORKSPACE/B2G/out/target/product/generic/tests/gaia-tests.zip $HOME/artifacts/gaia-tests.zip
 for name in common cppunittest reftest mochitest xpcshell web-platform; do
-    mv $WORKSPACE/B2G/objdir-gecko/dist/*.$name.tests.zip  $HOME/artifacts/target.$name.tests.zip ;
+    mv $gecko_objdir/dist/*.$name.tests.zip  $HOME/artifacts/target.$name.tests.zip ;
 done
-mv $WORKSPACE/B2G/objdir-gecko/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
+mv $gecko_objdir/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
 mv $WORKSPACE/B2G/out/emulator.tar.gz $HOME/artifacts/emulator.tar.gz
-mv $WORKSPACE/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
+mv $gecko_objdir/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
 
 ccache -s
--- a/testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
+++ b/testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
@@ -1,15 +1,15 @@
 #! /bin/bash -vex
 
 . pre-build.sh
 
 if [ $TARGET == "aries" -o $TARGET == "shinano" ]; then
   # caching objects might be dangerous for some devices (aka aries)
-  rm -rf $WORKSPACE/B2G/objdir*
+  rm -rf $gecko_objdir
   rm -rf $WORKSPACE/B2G/out
 fi
 
 PLATFORM=${TARGET%%-*}
 
 aws s3 cp s3://b2g-nightly-credentials/balrog_credentials .
 mar_file=b2g-$PLATFORM-gecko-update.mar
 
@@ -35,11 +35,12 @@ rm -rf $WORKSPACE/B2G/upload/
   --work-dir=$WORKSPACE/B2G \
   --gaia-languages-file locales/languages_all.json \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
   --repo=$WORKSPACE/gecko \
   --platform $PLATFORM \
+  --gecko-objdir=$gecko_objdir \
   --complete-mar-url https://queue.taskcluster.net/v1/task/$TASK_ID/runs/$RUN_ID/artifacts/public/build/$mar_file
 
 . post-build.sh
--- a/testing/taskcluster/scripts/phone-builder/build-phone.sh
+++ b/testing/taskcluster/scripts/phone-builder/build-phone.sh
@@ -1,15 +1,15 @@
 #! /bin/bash -vex
 
 . pre-build.sh
 
 if [ $TARGET == "aries" -o $TARGET == "shinano" ]; then
   # caching objects might be dangerous for some devices (aka aries)
-  rm -rf $WORKSPACE/B2G/objdir*
+  rm -rf $gecko_objdir
   rm -rf $WORKSPACE/B2G/out
 fi
 
 MOZHARNESS_CONFIG=${MOZHARNESS_CONFIG:=b2g/taskcluster-phone.py}
 
 rm -rf $WORKSPACE/B2G/upload/
 
 $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
@@ -18,11 +18,12 @@ rm -rf $WORKSPACE/B2G/upload/
   --disable-mock \
   --variant=$VARIANT \
   --work-dir=$WORKSPACE/B2G \
   --gaia-languages-file locales/languages_all.json \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
-  --repo=$WORKSPACE/gecko
+  --repo=$WORKSPACE/gecko \
+  --gecko-objdir=$gecko_objdir
 
 . post-build.sh
--- a/testing/taskcluster/scripts/phone-builder/pre-build.sh
+++ b/testing/taskcluster/scripts/phone-builder/pre-build.sh
@@ -1,16 +1,18 @@
 #!/bin/bash -vex
 
 # Ensure all the scripts in this dir are on the path....
 DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
 PATH=$DIRNAME:$PATH
 
 WORKSPACE=$1
 
+gecko_objdir=/home/worker/objdir-gecko/objdir
+
 ### Check that require variables are defined
 test -d $WORKSPACE
 test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
 test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
 test $GECKO_HEAD_REV # Should be an hg revision to pull down
 test $TARGET
 test $VARIANT
 
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_debug.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'aries'
     build_type: 'debug'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-aries-debug'
+    - 'docker-worker:cache:build-aries-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Aries Debug'
 
   payload:
     cache:
       build-aries-debug: /home/worker/workspace
+      build-aries-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'aries'
       DEBUG: 0
       VARIANT: userdebug
       GAIA_OPTIMIZE: '1'
       B2G_SYSTEM_APPS: '1'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
     command:
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_dogfood.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_dogfood.yml
@@ -3,19 +3,21 @@
   variables:
     build_name: 'aries-dogfood'
     build_type: 'debug'
 task:
   metadata:
     name: '[TC] B2G Aries Dogfood'
   scopes:
     - 'docker-worker:cache:build-aries-spark-dogfood'
+    - 'docker-worker:cache:build-aries-spark-dogfood-objdir-gecko-{{project}}'
   payload:
     cache:
       build-aries-spark-dogfood: /home/worker/workspace
+      build-aries-spark-dogfood-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: userdebug
       DOGFOOD: 1
       HARDWARE_COMPOSER: 0
       MOZHARNESS_CONFIG: b2g/taskcluster-spark-dogfood.py
   extra:
     treeherderEnv:
       - production
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_eng.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_eng.yml
@@ -1,22 +1,24 @@
 $inherits:
   from: 'tasks/builds/b2g_phone_eng_base.yml'
   variables:
     build_name: 'aries-eng'
     build_type: 'opt'
 task:
   scopes:
     - 'docker-worker:cache:build-aries-eng'
+    - 'docker-worker:cache:build-aries-eng-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Aries Eng'
 
   payload:
     cache:
       build-aries-eng: /home/worker/workspace
+      build-aries-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'aries'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_opt.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'aries'
     build_type: 'opt'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-aries-opt'
+    - 'docker-worker:cache:build-aries-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Aries Opt'
 
   payload:
     cache:
       build-aries-opt: /home/worker/workspace
+      build-aries-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'aries'
       DEBUG: 0
       VARIANT: user
       GAIA_OPTIMIZE: '1'
       B2G_SYSTEM_APPS: '1'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
     command:
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_debug.yml
@@ -3,15 +3,17 @@
   variables:
     build_name: 'aries-ota'
     build_type: 'debug'
 task:
   metadata:
     name: '[TC] B2G Aries OTA (userdebug)'
   scopes:
     - 'docker-worker:cache:build-aries-spark-ota-debug'
+    - 'docker-worker:cache:build-aries-spark-ota-debug-objdir-gecko-{{project}}'
   payload:
     cache:
       build-aries-spark-ota-debug: /home/worker/workspace
+      build-aries-spark-ota-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: userdebug
       B2G_DEBUG: 0
 
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_opt.yml
@@ -3,14 +3,16 @@
   variables:
     build_name: 'aries-ota'
     build_type: 'opt'
 task:
   metadata:
     name: '[TC] B2G Aries OTA (user)'
   scopes:
     - 'docker-worker:cache:build-aries-spark-ota-user'
+    - 'docker-worker:cache:build-aries-spark-ota-user-objdir-gecko-{{project}}'
   payload:
     cache:
       build-aries-spark-ota-user: /home/worker/workspace
+      build-aries-spark-ota-user-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: user
 
--- a/testing/taskcluster/tasks/builds/b2g_emulator_ics_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_ics_debug.yml
@@ -2,25 +2,27 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-ics'
     build_type: 'debug'
 task:
   workerType: emulator-ics-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-ics-debug'
+    - 'docker-worker:cache:workspace-emulator-ics-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator ICS Debug'
   extra:
     treeherder:
       collection:
         debug: true
       machine:
         platform: b2g-emu-ics
 
 
   payload:
     cache:
       workspace-emulator-ics-debug: /home/worker/workspace
+      workspace-emulator-ics-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator'
       B2G_DEBUG: 1
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-ics/releng-emulator-ics.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_ics_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_ics_opt.yml
@@ -5,23 +5,25 @@
     build_name: 'emulator-ics'
 task:
   workerType: emulator-ics
   routes:
     - 'index.buildbot.branches.{{project}}.emulator-ics'
     - 'index.buildbot.revisions.{{head_rev}}.{{project}}.emulator-ics'
   scopes:
     - 'docker-worker:cache:workspace-emulator-ics-opt'
+    - 'docker-worker:cache:workspace-emulator-ics-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator ICS Opt'
 
   extra:
     treeherder:
       machine:
         platform: b2g-emu-ics
 
   payload:
     cache:
       workspace-emulator-ics-opt: /home/worker/workspace
+      workspace-emulator-ics-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
 
     env:
       TARGET: 'emulator'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-ics/releng-emulator-ics.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_jb_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_jb_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-jb'
     build_type: 'debug'
 task:
   workerType: emulator-jb-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-jb-debug'
+    - 'docker-worker:cache:workspace-emulator-jb-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator JB (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,12 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-jb
 
   payload:
     cache:
       workspace-emulator-jb-debug: /home/worker/workspace
+      workspace-emulator-jb-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-jb'
       B2G_DEBUG: 1
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-jb/releng-emulator-jb.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_jb_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_jb_opt.yml
@@ -2,27 +2,29 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-jb'
     build_type: 'opt'
 task:
   workerType: emulator-jb
   scopes:
     - 'docker-worker:cache:workspace-emulator-jb-opt'
+    - 'docker-worker:cache:workspace-emulator-jb-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G JB Emulator: (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     # Disable "TC" prefix...
     treeherder:
       groupSymbol: "?"
       machine:
         platform: b2g-emu-jb
 
   payload:
     cache:
       workspace-emulator-jb-opt: /home/worker/workspace
+      workspace-emulator-jb-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-jb'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-jb/releng-emulator-jb.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_kk_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_kk_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-kk'
     build_type: 'debug'
 task:
   workerType: emulator-kk-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-debug'
+    - 'docker-worker:cache:workspace-emulator-kk-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator KK (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,12 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-kk
 
   payload:
     cache:
       workspace-emulator-kk-debug: /home/worker/workspace
+      workspace-emulator-kk-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-kk'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-kk/releng-emulator-kk.tt'
       B2G_DEBUG: 1
--- a/testing/taskcluster/tasks/builds/b2g_emulator_kk_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_kk_opt.yml
@@ -5,27 +5,29 @@
     build_type: 'opt'
 task:
   workerType: emulator-kk
   routes:
     - 'index.buildbot.branches.{{project}}.emulator-kk'
     - 'index.buildbot.revisions.{{head_rev}}.{{project}}.emulator-kk'
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-opt'
+    - 'docker-worker:cache:workspace-emulator-kk-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G KK Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       # Disable "TC" prefix...
       groupSymbol: "?"
       machine:
         platform: b2g-emu-kk
 
   payload:
     cache:
       workspace-emulator-kk-opt: /home/worker/workspace
+      workspace-emulator-kk-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-kk'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-kk/releng-emulator-kk.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_l_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_l_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-l'
     build_type: 'debug'
 task:
   workerType: emulator-l-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-l-debug'
+    - 'docker-worker:cache:workspace-emulator-l-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator L (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,12 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-l
 
   payload:
     cache:
       workspace-emulator-l-debug: /home/worker/workspace
+      workspace-emulator-l-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-l'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-l/releng-emulator-l.tt'
       B2G_DEBUG: 1
--- a/testing/taskcluster/tasks/builds/b2g_emulator_l_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_l_opt.yml
@@ -2,27 +2,29 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-l'
     build_type: 'opt'
 task:
   workerType: emulator-l
   scopes:
     - 'docker-worker:cache:workspace-emulator-l-opt'
+    - 'docker-worker:cache:workspace-emulator-l-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G L Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       # Disable "TC" prefix...
       groupSymbol: "?"
       machine:
         platform: b2g-emu-l
 
   payload:
     cache:
       workspace-emulator-l-opt: /home/worker/workspace
+      workspace-emulator-l-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-l'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-l/releng-emulator-l.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_x86_base.yml'
   variables:
     build_name: 'emulator-x86-kk'
     build_type: 'debug'
 task:
   workerType: emulator-x86-kk
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-x86-debug'
+    - 'docker-worker:cache:workspace-emulator-kk-x86-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G KK X86 Emulator (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,12 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-x86-kk
 
   payload:
     cache:
       workspace-emulator-kk-x86-debug: /home/worker/workspace
+      workspace-emulator-kk-x86-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-x86-kk'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-kk/releng-emulator-kk.tt'
       B2G_DEBUG: 1
--- a/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_opt.yml
@@ -2,27 +2,29 @@
   from: 'tasks/builds/b2g_emulator_x86_base.yml'
   variables:
     build_name: 'emulator-x86-kk'
     build_type: 'opt'
 task:
   workerType: emulator-x86-kk
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-x86-opt'
+    - 'docker-worker:cache:workspace-emulator-kk-x86-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G KK X86 Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       # Disable "TC" prefix...
       groupSymbol: "?"
       machine:
         platform: b2g-emu-x86-kk
 
   payload:
     cache:
       workspace-emulator-kk-x86-opt: /home/worker/workspace
+      workspace-emulator-kk-x86-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-x86-kk'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-kk/releng-emulator-kk.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_x86_l_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_x86_l_opt.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-x86-l'
     build_type: 'opt'
 task:
   workerType: emulator-l
   scopes:
     - 'docker-worker:cache:workspace-emulator-l-x86-opt'
+    - 'docker-worker:cache:workspace-emulator-l-x86-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G X86 L Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - staging
     treeherder:
       # Disable "TC" prefix...
@@ -25,11 +26,12 @@ task:
       - -c
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/builder &&
         buildbot_step 'Build' ./build-emulator-x86.sh $HOME/workspace
 
     cache:
       workspace-emulator-l-x86-opt: /home/worker/workspace
+      workspace-emulator-l-x86-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-x86-l'
       TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-l/releng-emulator-l.tt'
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_debug.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'flame-kk'
     build_type: 'debug'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-flame-kk-debug'
+    - 'docker-worker:cache:build-flame-kk-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Debug'
 
   payload:
     cache:
       build-flame-kk-debug: /home/worker/workspace
+      build-flame-kk-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
       DEBUG: 0
       VARIANT: userdebug
     command:
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_eng.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_eng.yml
@@ -1,22 +1,24 @@
 $inherits:
   from: 'tasks/builds/b2g_phone_eng_base.yml'
   variables:
     build_name: 'flame-kk-eng'
     build_type: 'opt'
 task:
   scopes:
     - 'docker-worker:cache:build-flame-kk-eng'
+    - 'docker-worker:cache:build-flame-kk-eng-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Eng'
 
   payload:
     cache:
       build-flame-kk-eng: /home/worker/workspace
+      build-flame-kk-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       symbol: Be
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_opt.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'flame-kk'
     build_type: 'opt'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-flame-kk-opt'
+    - 'docker-worker:cache:build-flame-kk-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Opt'
 
   payload:
     cache:
       build-flame-kk-opt: /home/worker/workspace
+      build-flame-kk-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
       DEBUG: 0
     command:
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
         buildbot_step 'Build' ./build-phone.sh $HOME/workspace
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_debug.yml
@@ -3,15 +3,17 @@
   variables:
     build_name: 'flame-kk-ota'
     build_type: 'debug'
 task:
   metadata:
     name: '[TC] B2G Flame KK OTA (userdebug)'
   scopes:
     - 'docker-worker:cache:build-flame-kk-ota-debug'
+    - 'docker-worker:cache:build-flame-kk-ota-debug-objdir-gecko-{{project}}'
 
   payload:
     cache:
-        build-flame-kk-ota-debug: /home/worker/workspace
+      build-flame-kk-ota-debug: /home/worker/workspace
+      build-flame-kk-ota-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: userdebug
       B2G_DEBUG: 0
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_opt.yml
@@ -3,14 +3,16 @@
   variables:
     build_name: 'flame-kk-ota'
     build_type: 'opt'
 task:
   metadata:
     name: '[TC] B2G Flame KK OTA (user)'
   scopes:
     - 'docker-worker:cache:build-flame-kk-ota-user'
+    - 'docker-worker:cache:build-flame-kk-ota-user-objdir-gecko-{{project}}'
 
   payload:
     cache:
       build-flame-kk-ota-user: /home/worker/workspace
+      build-flame-kk-ota-user-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: user
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_spark_eng.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_spark_eng.yml
@@ -1,22 +1,24 @@
 $inherits:
   from: 'tasks/builds/b2g_phone_eng_base.yml'
   variables:
     build_name: 'flame-kk-spark-eng'
     build_type: 'opt'
 task:
   scopes:
     - 'docker-worker:cache:build-flame-kk-spark-eng'
+    - 'docker-worker:cache:build-flame-kk-spark-eng-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Eng (spark)'
 
   payload:
     cache:
       build-flame-kk-spark-eng: /home/worker/workspace
+      build-flame-kk-spark-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
   extra:
     treeherderEnv:
       - staging
     treeherder:
       symbol: Be