Bug 1542242 - [taskgraph] Hack required mozbase module onto PYTHONPATH rather than run 'mach python' for Windows builds, r=marco
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 09 Apr 2019 15:58:49 +0000
changeset 468586 20c86313e33273d6b5eb02a5eb8fc3e291abc753
parent 468585 d470f958ea613268f839f8346e983dc9d8820c06
child 468587 3aa2e84843939738f07e6fa12983e1c52788d9a1
push id35843
push usernbeleuzu@mozilla.com
push dateTue, 09 Apr 2019 22:08:13 +0000
treeherdermozilla-central@a31032a16330 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarco
bugs1542242, 1195299, 1543149
milestone68.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 1542242 - [taskgraph] Hack required mozbase module onto PYTHONPATH rather than run 'mach python' for Windows builds, r=marco This is a hack to get around Windows ccov build hangs caused by bug 1195299. Bug 1543149 will track the investigation of the hang and removal of this hack. Differential Revision: https://phabricator.services.mozilla.com/D26750
taskcluster/taskgraph/transforms/job/mozharness.py
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -295,22 +295,33 @@ def mozharness_on_generic_worker(config,
     if config.params.is_try():
         env['TRY_COMMIT_MSG'] = config.params['message'] or 'no commit message'
 
     if not job['attributes']['build_platform'].startswith('win'):
         raise Exception(
             "Task generation for mozharness build jobs currently only supported on Windows"
         )
 
+    # TODO We should run the mozharness script with `mach python` so these
+    # modules are automatically available, but doing so somehow caused hangs in
+    # Windows ccov builds (see bug 1543149).
     gecko = env['GECKO_PATH'].replace('.', '%cd%')
+    mozbase_dir = "{}/testing/mozbase".format(gecko)
+    env['PYTHONPATH'] = ';'.join([
+        "{}/manifestparser".format(mozbase_dir),
+        "{}/mozinfo".format(mozbase_dir),
+        "{}/mozfile".format(mozbase_dir),
+        "{}/mozprocess".format(mozbase_dir),
+        "{}/third_party/python/six".format(gecko),
+    ])
+
     mh_command = [
             'c:/mozilla-build/python/python.exe',
-            '{}/mach'.format(gecko), 'python',
+            '{}/testing/{}'.format(gecko, run['script']),
     ]
-    mh_command.append('/'.join([gecko, 'testing', run['script']]))
 
     if 'config-paths' in run:
         for path in run['config-paths']:
             mh_command.append('--extra-config-path {}/{}'.format(gecko, path))
 
     for cfg in run['config']:
         mh_command.append('--config ' + cfg)
     if run['use-magic-mh-args']: