bug 1316329 - build from a symlink dir in generic-worker builds. r=pmoore,gps
authorTed Mielczarek <ted@mielczarek.org>
Mon, 14 Nov 2016 11:47:59 -0500
changeset 442971 f4c1cb96ec823030444ad4fd5bf69c2eb2967d6b
parent 442970 e5a62d4ce95aa7d460b3745332e0878974d12714
child 442972 3e0850dcf03ecc24f988c93cf0f98cd45989b17f
push id36877
push userbmo:ato@mozilla.com
push dateWed, 23 Nov 2016 16:26:21 +0000
reviewerspmoore, gps
bugs1316329
milestone53.0a1
bug 1316329 - build from a symlink dir in generic-worker builds. r=pmoore,gps MozReview-Commit-ID: EXp08oIquPF
taskcluster/taskgraph/transforms/job/mozharness.py
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -215,12 +215,25 @@ def mozharness_on_windows(config, job, t
     hg_command.append('robustcheckout')
     hg_command.extend(['--sharebase', 'y:\\hg-shared'])
     hg_command.append('--purge')
     hg_command.extend(['--upstream', 'https://hg.mozilla.org/mozilla-unified'])
     hg_command.extend(['--revision', env['GECKO_HEAD_REV']])
     hg_command.append(env['GECKO_HEAD_REPOSITORY'])
     hg_command.append('.\\build\\src')
 
-    worker['command'] = [
+    worker['command'] = []
+    # sccache currently uses the full compiler commandline as input to the
+    # cache hash key, so create a symlink to the task dir and build from
+    # the symlink dir to get consistent paths.
+    if taskdesc.get('needs-sccache'):
+        worker['command'].extend([
+            r'if exist z:\build rmdir z:\build',
+            r'mklink /d z:\build %cd%',
+            # Grant delete permission on the link to everyone.
+            r'icacls z:\build /grant *S-1-1-0:D /L',
+            r'cd /d z:\build',
+        ])
+
+    worker['command'].extend([
         ' '.join(hg_command),
         ' '.join(mh_command)
-    ]
+    ])